Commit cf8cc0b3 authored by msharma's avatar msharma

Commented Log file creation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95021 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e5edd2e3
...@@ -60,8 +60,9 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc ...@@ -60,8 +60,9 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc
double diffAmtExcHdr=0.0; double diffAmtExcHdr=0.0;
File filePtr = new File("../log/pbnitrace.log"); //Commented by Manoj dtd 03/05/2014File filePtr = new File("../log/pbnitrace.log");
/*Commented by Manoj dtd 03/05/2014
static static
{ {
File mkd = new File("../log"); File mkd = new File("../log");
...@@ -71,7 +72,7 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc ...@@ -71,7 +72,7 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc
System.out.println("Directory Built................ "+mkd); System.out.println("Directory Built................ "+mkd);
} }
} }*/
/*public void ejbCreate() throws RemoteException, CreateException /*public void ejbCreate() throws RemoteException, CreateException
{ {
...@@ -106,6 +107,7 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc ...@@ -106,6 +107,7 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc
String rtrStr = ""; String rtrStr = "";
Document headerDom = null; Document headerDom = null;
Document detailDom = null; Document detailDom = null;
/* Commented by Manoj dtd 03/05/2014
try try
{ {
writeLog(filePtr,"G E T D A T A I N P R O C E S S ",false); writeLog(filePtr,"G E T D A T A I N P R O C E S S ",false);
...@@ -116,7 +118,7 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc ...@@ -116,7 +118,7 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc
{ {
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }*/
try try
{ {
if(xmlString != null && xmlString.trim().length()!=0 ) if(xmlString != null && xmlString.trim().length()!=0 )
...@@ -183,14 +185,16 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -183,14 +185,16 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
DatabaseMetaData dbmd = conn.getMetaData(); DatabaseMetaData dbmd = conn.getMetaData();
/*Commented by Manoj dtd 03/05/2014
writeLog(filePtr,"DriverName["+dbmd.getDriverName() + "]",true); writeLog(filePtr,"DriverName["+dbmd.getDriverName() + "]",true);
writeLog(filePtr,"DriverURI["+dbmd.getURL() + "]",true); writeLog(filePtr,"DriverURI["+dbmd.getURL() + "]",true);
writeLog(filePtr,"DriverUSER["+dbmd.getUserName() + "]",true); writeLog(filePtr,"DriverUSER["+dbmd.getUserName() + "]",true);
writeLog(filePtr,"ApplDateFormat["+genericUtility.getApplDateFormat() + "]",true); writeLog(filePtr,"ApplDateFormat["+genericUtility.getApplDateFormat() + "]",true);
writeLog(filePtr,"DBDateFormat["+genericUtility.getDBDateFormat() + "]",true); writeLog(filePtr,"DBDateFormat["+genericUtility.getDBDateFormat() + "]",true);
*/
siteCode = genericUtility.getColumnValue("site_code",headerDom); siteCode = genericUtility.getColumnValue("site_code",headerDom);
writeLog(filePtr,"siteCode:::"+siteCode,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"siteCode:::"+siteCode,true);
System.out.println("siteCode------>"+ siteCode); System.out.println("siteCode------>"+ siteCode);
if(siteCode == null || siteCode.trim().length() == 0) if(siteCode == null || siteCode.trim().length() == 0)
...@@ -214,7 +218,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -214,7 +218,7 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
if(count == 0) if(count == 0)
{ {
writeLog(filePtr,"siteCode NOT founds in siteMaster:::",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"siteCode NOT founds in siteMaster:::",true);
errCode = "VMSITE1"; errCode = "VMSITE1";
errString = itmDBAccessEJB.getErrorString("site_code",errCode,userId,"",conn); errString = itmDBAccessEJB.getErrorString("site_code",errCode,userId,"",conn);
return errString; return errString;
...@@ -252,8 +256,8 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -252,8 +256,8 @@ Put a validation chq amount in filter and total of details matches in case heade
//System.out.println("custCode is :::"+custCode); //System.out.println("custCode is :::"+custCode);
System.out.println("cust_code__from is :::"+custCodeFrom); System.out.println("cust_code__from is :::"+custCodeFrom);
System.out.println("cust_code__to is :::"+custCodeTo); System.out.println("cust_code__to is :::"+custCodeTo);
writeLog(filePtr,"cust_code__from:::"+custCodeFrom,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"cust_code__from:::"+custCodeFrom,true);
writeLog(filePtr,"cust_code__to:::"+custCodeTo,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"cust_code__to:::"+custCodeTo,true);
if(custCodeFrom == null || custCodeFrom.trim().length() ==0) //ADDED BY RAJESH K TO CHECK CUSTCODEFROM AND CUSTCODETO if(custCodeFrom == null || custCodeFrom.trim().length() ==0) //ADDED BY RAJESH K TO CHECK CUSTCODEFROM AND CUSTCODETO
{ {
...@@ -276,7 +280,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -276,7 +280,7 @@ Put a validation chq amount in filter and total of details matches in case heade
sdueDate = genericUtility.getColumnValue("due_date",headerDom); sdueDate = genericUtility.getColumnValue("due_date",headerDom);
System.out.println("due_date is :::"+sdueDate); System.out.println("due_date is :::"+sdueDate);
writeLog(filePtr,"sdueDate:::"+sdueDate,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"sdueDate:::"+sdueDate,true);
if ( sdueDate == null || sdueDate.trim().length() == 0 ) if ( sdueDate == null || sdueDate.trim().length() == 0 )
{ {
sdueDate = ""; sdueDate = "";
...@@ -290,7 +294,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -290,7 +294,7 @@ Put a validation chq amount in filter and total of details matches in case heade
sdueDate = genericUtility.getColumnValue("due_date_to",headerDom); sdueDate = genericUtility.getColumnValue("due_date_to",headerDom);
System.out.println("due_date is :::"+sdueDate); System.out.println("due_date is :::"+sdueDate);
writeLog(filePtr,"sdueDate:::"+sdueDate,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"sdueDate:::"+sdueDate,true);
if ( sdueDate == null || sdueDate.trim().length() == 0 ) if ( sdueDate == null || sdueDate.trim().length() == 0 )
{ {
sdueDate = ""; sdueDate = "";
...@@ -491,7 +495,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -491,7 +495,7 @@ Put a validation chq amount in filter and total of details matches in case heade
+ "AND ((D.TRAN_DATE >= ? " + "AND ((D.TRAN_DATE >= ? "
+ "AND D.TRAN_DATE <= ? ) OR (D.TRAN_DATE IS NULL)) " + "AND D.TRAN_DATE <= ? ) OR (D.TRAN_DATE IS NULL)) "
+ "ORDER BY D.TRAN_DATE "; + "ORDER BY D.TRAN_DATE ";
writeLog(filePtr,"GetData 2nd Sql :::."+ sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"GetData 2nd Sql :::."+ sql,true);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode.trim()); pstmt.setString(1,siteCode.trim());
pstmt.setString(2,custCodeFrom.trim()); pstmt.setString(2,custCodeFrom.trim());
...@@ -651,11 +655,12 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -651,11 +655,12 @@ Put a validation chq amount in filter and total of details matches in case heade
System.out.println("INVOICE_ID :::::::: "+rs.getString(1)); System.out.println("INVOICE_ID :::::::: "+rs.getString(1));
/*Commented by Manoj dtd 03/05/2014
writeLog(filePtr,"%%%%%%%%% INVOICE_ID :::."+rs.getString(1),true); writeLog(filePtr,"%%%%%%%%% INVOICE_ID :::."+rs.getString(1),true);
writeLog(filePtr,"%%%%%%%%% CHEQUE_DATE :::."+rs.getString(7),true); writeLog(filePtr,"%%%%%%%%% CHEQUE_DATE :::."+rs.getString(7),true);
writeLog(filePtr,"%%%%%%%%% CHQ_AMOUNT :::."+rs.getDouble(9),true); writeLog(filePtr,"%%%%%%%%% CHQ_AMOUNT :::."+rs.getDouble(9),true);
writeLog(filePtr,"%%%%%%%%% CHEQUE_DATE :::."+rs.getString(6),true); writeLog(filePtr,"%%%%%%%%% CHEQUE_DATE :::."+rs.getString(6),true);
*/
retTabSepStrBuff.append("</Detail2>"); retTabSepStrBuff.append("</Detail2>");
...@@ -672,20 +677,20 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -672,20 +677,20 @@ Put a validation chq amount in filter and total of details matches in case heade
}//try }//try
catch (SQLException e) catch (SQLException e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("SQLException ::GenerateReceiptPrcEJB :" +sql+ e.getMessage() + ":"); System.out.println("SQLException ::GenerateReceiptPrcEJB :" +sql+ e.getMessage() + ":");
throw new ITMException(e); throw new ITMException(e);
} }
catch(Exception ex) catch(Exception ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception []::GenerateReceiptPrcEJB :"+ex.getMessage()); System.out.println("Exception []::GenerateReceiptPrcEJB :"+ex.getMessage());
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
resultString = retTabSepStrBuff.toString(); resultString = retTabSepStrBuff.toString();
writeLog(filePtr,resultString,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,resultString,true);
if (!errCode.equals("")) if (!errCode.equals(""))
{ {
resultString = itmDBAccessEJB.getErrorString("", errCode, "", "", conn); resultString = itmDBAccessEJB.getErrorString("", errCode, "", "", conn);
...@@ -694,13 +699,13 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -694,13 +699,13 @@ Put a validation chq amount in filter and total of details matches in case heade
}//outer try }//outer try
catch (SQLException e) catch (SQLException e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("SQLException ::GenerateReceiptPrcEJB :" +sql+ e.getMessage() + ":"); System.out.println("SQLException ::GenerateReceiptPrcEJB :" +sql+ e.getMessage() + ":");
throw new ITMException(e); throw new ITMException(e);
} }
catch(Exception ex) catch(Exception ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception []::GenerateReceiptPrcEJB :"+ex.getMessage()); System.out.println("Exception []::GenerateReceiptPrcEJB :"+ex.getMessage());
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
...@@ -720,7 +725,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -720,7 +725,7 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch(Exception e) catch(Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
e.printStackTrace(); e.printStackTrace();
} }
...@@ -732,10 +737,12 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -732,10 +737,12 @@ Put a validation chq amount in filter and total of details matches in case heade
{ {
try try
{ {
/*Commented by Manoj dtd 03/05/2014
writeLog(filePtr,"P R O C E S S FX I N P R O C E S S :::.",true); writeLog(filePtr,"P R O C E S S FX I N P R O C E S S :::.",true);
writeLog(filePtr,"Generating Receipt............... ",true); writeLog(filePtr,"Generating Receipt............... ",true);
writeLog(filePtr,"xmlString :::."+xmlString,true); writeLog(filePtr,"xmlString :::."+xmlString,true);
writeLog(filePtr,"xmlString :::."+xmlString2,true); writeLog(filePtr,"xmlString :::."+xmlString2,true);
*/
}catch(Exception e){ }catch(Exception e){
System.out.println(e.getMessage());} System.out.println(e.getMessage());}
...@@ -757,7 +764,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -757,7 +764,7 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception :GenerateReceiptPrcEJB :process(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":"); System.out.println("Exception :GenerateReceiptPrcEJB :process(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -811,7 +818,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -811,7 +818,7 @@ Put a validation chq amount in filter and total of details matches in case heade
bankCode= genericUtility.getColumnValue("bank_code",headerDom);//Added by manoj dtd 03/01/2014 bankCode= genericUtility.getColumnValue("bank_code",headerDom);//Added by manoj dtd 03/01/2014
System.out.println("siteCode in process() "+siteCode); System.out.println("siteCode in process() "+siteCode);
System.out.println("custCode in process() "+custCode); System.out.println("custCode in process() "+custCode);
writeLog(filePtr,"siteCode in process() "+siteCode,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"siteCode in process() "+siteCode,true);
//writeLog(filePtr,"custCode in process() "+custCode,true); //writeLog(filePtr,"custCode in process() "+custCode,true);
sFilterChqAmt = genericUtility.getColumnValue("cheque_amount",headerDom); sFilterChqAmt = genericUtility.getColumnValue("cheque_amount",headerDom);
//sFilterChqDate = genericUtility.getColumnValue("cheque_date",headerDom); //sFilterChqDate = genericUtility.getColumnValue("cheque_date",headerDom);
...@@ -824,21 +831,21 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -824,21 +831,21 @@ Put a validation chq amount in filter and total of details matches in case heade
dueDate = java.sql.Timestamp.valueOf(sdueDate + " 00:00:00"); dueDate = java.sql.Timestamp.valueOf(sdueDate + " 00:00:00");
System.out.println("dueDate in process() "+dueDate); System.out.println("dueDate in process() "+dueDate);
writeLog(filePtr,"dueDate in process() "+dueDate,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"dueDate in process() "+dueDate,true);
Object date = null; Object date = null;
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getDBDateFormat());
date = sdf.parse(tranDate.toString()); date = sdf.parse(tranDate.toString());
tranDate = java.sql.Timestamp.valueOf(sdf.format(date).toString() + " 00:00:00.0"); tranDate = java.sql.Timestamp.valueOf(sdf.format(date).toString() + " 00:00:00.0");
System.out.println("TRAN DATE :::::-"+tranDate); System.out.println("TRAN DATE :::::-"+tranDate);
writeLog(filePtr,"TRAN DATE :::::-"+tranDate,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"TRAN DATE :::::-"+tranDate,true);
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getApplDateFormat());
String trDate = sdf1.format(date).toString(); String trDate = sdf1.format(date).toString();
System.out.println("TranDate ::::-"+trDate); System.out.println("TranDate ::::-"+trDate);
writeLog(filePtr,"TranDate ::::-"+trDate,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"TranDate ::::-"+trDate,true);
/* try /* try
...@@ -1149,7 +1156,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1149,7 +1156,7 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
}//inner for }//inner for
sql = "SELECT GROUP_CODE FROM CUSTOMER WHERE CUST_CODE = ?"; sql = "SELECT GROUP_CODE FROM CUSTOMER WHERE CUST_CODE = ?";
writeLog(filePtr,sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,custCode); pstmt.setString(1,custCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1164,14 +1171,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1164,14 +1171,14 @@ Put a validation chq amount in filter and total of details matches in case heade
//searchKey = chequeNo + ":" + custCode; //added by rajesh k to concate chequeNo and custCode //searchKey = chequeNo + ":" + custCode; //added by rajesh k to concate chequeNo and custCode
searchKey= chequeNo + ":" + groupCode;//Added By Manoj dtd 26/11/2012 for Group Code searchKey= chequeNo + ":" + groupCode;//Added By Manoj dtd 26/11/2012 for Group Code
writeLog(filePtr,"chequeNo::::: "+chequeNo,true); /*Commented by Manoj dtd 03/05/2014writeLog(filePtr,"chequeNo::::: "+chequeNo,true);
writeLog(filePtr,"custCode::::: "+custCode,true); writeLog(filePtr,"custCode::::: "+custCode,true);
writeLog(filePtr,"searchKey::::: "+searchKey,true); writeLog(filePtr,"searchKey::::: "+searchKey,true);*/
// if(tranSer.equalsIgnoreCase("S-INV")) // if(tranSer.equalsIgnoreCase("S-INV"))
//{ //{
java.sql.Timestamp chequeDate = null; java.sql.Timestamp chequeDate = null;
//schequeDate = schequeDate.substring(0,8); //schequeDate = schequeDate.substring(0,8);
writeLog(filePtr,"schequeDate::::: "+schequeDate,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"schequeDate::::: "+schequeDate,true);
if(schequeDate.indexOf("-")!=-1) if(schequeDate.indexOf("-")!=-1)
{ {
chequeDate = java.sql.Timestamp.valueOf(schequeDate+" 00:00:00"); chequeDate = java.sql.Timestamp.valueOf(schequeDate+" 00:00:00");
...@@ -1179,7 +1186,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1179,7 +1186,7 @@ Put a validation chq amount in filter and total of details matches in case heade
else else
{ {
schequeDate = genericUtility.getValidDateString(schequeDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()); schequeDate = genericUtility.getValidDateString(schequeDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
writeLog(filePtr,"genericUtility.getValidDateString Return "+schequeDate,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"genericUtility.getValidDateString Return "+schequeDate,true);
chequeDate = java.sql.Timestamp.valueOf(schequeDate+" 00:00:00"); chequeDate = java.sql.Timestamp.valueOf(schequeDate+" 00:00:00");
} }
receiptMap = new HashMap(); receiptMap = new HashMap();
...@@ -1200,7 +1207,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1200,7 +1207,7 @@ Put a validation chq amount in filter and total of details matches in case heade
int ele = getListElement(receiptList, searchKey); int ele = getListElement(receiptList, searchKey);
//int ele = getListElement(receiptList, chequeNo); //int ele = getListElement(receiptList, chequeNo);
System.out.println("ele::::::::::"+ele); System.out.println("ele::::::::::"+ele);
writeLog(filePtr,"ele::::::::::"+ele,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"ele::::::::::"+ele,true);
ReceiptElements receiptElements; ReceiptElements receiptElements;
if (ele == -1) if (ele == -1)
...@@ -1217,7 +1224,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1217,7 +1224,7 @@ Put a validation chq amount in filter and total of details matches in case heade
//ele = receiptList.size() -1; //ele = receiptList.size() -1;
ele = getListElement(receiptList, searchKey); ele = getListElement(receiptList, searchKey);
System.out.println("The size of the element is "+ele); System.out.println("The size of the element is "+ele);
writeLog(filePtr,"The size of the element is "+ele,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"The size of the element is "+ele,true);
} }
else else
...@@ -1233,7 +1240,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1233,7 +1240,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}//Outer For }//Outer For
System.out.println("@@@@ The size of receiptList is @@@@ "+receiptList.size()); System.out.println("@@@@ The size of receiptList is @@@@ "+receiptList.size());
writeLog(filePtr,"@@@@ The ReceiptGenerated is @@@@ "+receiptList.size(),true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"@@@@ The ReceiptGenerated is @@@@ "+receiptList.size(),true);
// *****************************added on 25102006 // *****************************added on 25102006
for (int Ctr = 0; Ctr < receiptList.size() ; Ctr++) for (int Ctr = 0; Ctr < receiptList.size() ; Ctr++)
...@@ -1241,51 +1248,51 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1241,51 +1248,51 @@ Put a validation chq amount in filter and total of details matches in case heade
ReceiptElements receiptElements = (ReceiptElements)receiptList.get(Ctr); ReceiptElements receiptElements = (ReceiptElements)receiptList.get(Ctr);
double chequeAmt = 0.0; double chequeAmt = 0.0;
chequeAmt = receiptElements.getChequeAmt(); chequeAmt = receiptElements.getChequeAmt();
writeLog(filePtr,"Cheque No["+receiptElements.getChequeNo()+"] TotalChequeAmt ["+chequeAmt+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Cheque No["+receiptElements.getChequeNo()+"] TotalChequeAmt ["+chequeAmt+"]",true);
invoiceList = receiptElements.getInvoiceList(); invoiceList = receiptElements.getInvoiceList();
custCode = receiptElements.getCustCode();//added by rajesh k to add custcode to receipt element custCode = receiptElements.getCustCode();//added by rajesh k to add custcode to receipt element
chequeNo = receiptElements.getChequeNo();//added by rajesh k to add chequeno to receipt element chequeNo = receiptElements.getChequeNo();//added by rajesh k to add chequeno to receipt element
double rcpAmount =0.0; double rcpAmount =0.0;
int invSize = 0; int invSize = 0;
invSize = invoiceList.size(); invSize = invoiceList.size();
writeLog(filePtr,"@@@@ The TotalInvoicewrrrrrrrrrrrrrrr is @@@@ ["+invoiceList.size()+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"@@@@ The TotalInvoicewrrrrrrrrrrrrrrr is @@@@ ["+invoiceList.size()+"]",true);
writeLog(filePtr,"!!!!!!!! invSize " +invSize ,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"!!!!!!!! invSize " +invSize ,true);
for (int Ctr1 = 0; Ctr1 < invSize ; Ctr1++) for (int Ctr1 = 0; Ctr1 < invSize ; Ctr1++)
{ {
ReceiptDetail receiptDetail = (ReceiptDetail)invoiceList.get(Ctr1); ReceiptDetail receiptDetail = (ReceiptDetail)invoiceList.get(Ctr1);
rcpAmount = rcpAmount +receiptDetail.getRcpAmt(); rcpAmount = rcpAmount +receiptDetail.getRcpAmt();
rcpAmount = getRequiredDecimal(rcpAmount,3); // Added by rajesh k to convert number format rcpAmount = getRequiredDecimal(rcpAmount,3); // Added by rajesh k to convert number format
writeLog(filePtr,"rcpAmount**********[ "+rcpAmount+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"rcpAmount**********[ "+rcpAmount+"]",true);
} }
writeLog(filePtr,"rcpAmount:-[ "+rcpAmount+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"rcpAmount:-[ "+rcpAmount+"]",true);
writeLog(filePtr,"chequeAmt:-[ "+chequeAmt+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"chequeAmt:-[ "+chequeAmt+"]",true);
//if(chequeAmt != rcpAmount) // ********* //if(chequeAmt != rcpAmount) // *********
if(chequeAmt != rcpAmount && chequeAmt != 0 && rcpAmount != 0) // ********* if(chequeAmt != rcpAmount && chequeAmt != 0 && rcpAmount != 0) // *********
{ {
amtFlag = false; amtFlag = false;
writeLog(filePtr,"MITCH MATCH AMOUNT Cheque No["+receiptElements.getChequeNo()+"] TotalChequeAmt ["+chequeAmt+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"MITCH MATCH AMOUNT Cheque No["+receiptElements.getChequeNo()+"] TotalChequeAmt ["+chequeAmt+"]",true);
writeLog(filePtr,"RcpAmount:-"+rcpAmount,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"RcpAmount:-"+rcpAmount,true);
} }
if (filterChqAmt != chequeAmt && chequeAmt != 0) if (filterChqAmt != chequeAmt && chequeAmt != 0)
{ {
amtFlag = false; amtFlag = false;
writeLog(filePtr,"MITCH MATCH AMOUNT Cheque No["+receiptElements.getChequeNo()+"] TotalChequeAmt ["+chequeAmt+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"MITCH MATCH AMOUNT Cheque No["+receiptElements.getChequeNo()+"] TotalChequeAmt ["+chequeAmt+"]",true);
writeLog(filePtr,"RcpAmount:-"+rcpAmount,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"RcpAmount:-"+rcpAmount,true);
} }
writeLog(filePtr,"TotalReceiptAmount:::-["+rcpAmount+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"TotalReceiptAmount:::-["+rcpAmount+"]",true);
} }
//****************************** //******************************
writeLog(filePtr,"amtFlag:::-["+amtFlag+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"amtFlag:::-["+amtFlag+"]",true);
if(amtFlag) if(amtFlag)
{ {
writeLog(filePtr,"[===>R E C E I P T G E N E R A T I N G I N P R O G R E S S<=== ]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[===>R E C E I P T G E N E R A T I N G I N P R O G R E S S<=== ]",true);
for (int Ctr = 0; Ctr < receiptList.size() ; Ctr++) for (int Ctr = 0; Ctr < receiptList.size() ; Ctr++)
{ {
ReceiptElements receiptElements = (ReceiptElements)receiptList.get(Ctr); ReceiptElements receiptElements = (ReceiptElements)receiptList.get(Ctr);
...@@ -1298,15 +1305,15 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1298,15 +1305,15 @@ Put a validation chq amount in filter and total of details matches in case heade
//tranId = generateTranTd("w_receipt_adv",trDate,siteCode); //tranId = generateTranTd("w_receipt_adv",trDate,siteCode);
tranId = generateTranTd("w_receivables_jv",trDate,siteCode,conn); tranId = generateTranTd("w_receivables_jv",trDate,siteCode,conn);
System.out.println("TranId :::::::::::::::::; "+tranId); System.out.println("TranId :::::::::::::::::; "+tranId);
writeLog(filePtr,"TranId ["+tranId+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"TranId ["+tranId+"]",true);
receiptMap.put("tran_id",tranId); receiptMap.put("tran_id",tranId);
try try
{ {
cntHdr = 0; cntHdr = 0;
writeLog(filePtr,"AMOUNTCHEQUE GOING TO HEADER:::["+amountcheque+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"AMOUNTCHEQUE GOING TO HEADER:::["+amountcheque+"]",true);
cntHdr = insertReceiptHdr(receiptMap,amountcheque,conn); cntHdr = insertReceiptHdr(receiptMap,amountcheque,conn);
writeLog(filePtr,"Cheque No["+receiptMap.get("ref_no")+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Cheque No["+receiptMap.get("ref_no")+"]",true);
if(cntHdr == 0) if(cntHdr == 0)
{ {
conn.rollback(); conn.rollback();
...@@ -1315,15 +1322,15 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1315,15 +1322,15 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
else else
{ {
writeLog(filePtr,"Record Success fully inserted in header["+tranId+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Record Success fully inserted in header["+tranId+"]",true);
ArrayList invoiceList = receiptElements.getInvoiceList(); ArrayList invoiceList = receiptElements.getInvoiceList();
writeLog(filePtr,"No Of Invoice for receipt ["+tranId+"]"+invoiceList.size(),true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"No Of Invoice for receipt ["+tranId+"]"+invoiceList.size(),true);
insertReceiptDtl(tranId,invoiceList,conn); insertReceiptDtl(tranId,invoiceList,conn);
} }
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -1331,11 +1338,11 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1331,11 +1338,11 @@ Put a validation chq amount in filter and total of details matches in case heade
try try
{ {
int cnt = updateReceipt(netAmtHdr,billAmt,billDiscAmt,tranId,conn); int cnt = updateReceipt(netAmtHdr,billAmt,billDiscAmt,tranId,conn);
writeLog(filePtr,"[UPDATE AMT]netAmtHdr["+netAmtHdr+"]billAmt["+billAmt+"]billDiscAmt["+billDiscAmt+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[UPDATE AMT]netAmtHdr["+netAmtHdr+"]billAmt["+billAmt+"]billDiscAmt["+billDiscAmt+"]",true);
if(cnt > 0) if(cnt > 0)
{ {
writeLog(filePtr,"Update Successfully in header["+tranId+"]",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Update Successfully in header["+tranId+"]",true);
netAmtHdr = 0; netAmtHdr = 0;
billAmt = 0; billAmt = 0;
billDiscAmt = 0; billDiscAmt = 0;
...@@ -1349,7 +1356,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1349,7 +1356,7 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -1361,7 +1368,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1361,7 +1368,7 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
else else
{ {
writeLog(filePtr,"AMTMITCHMATCH........",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"AMTMITCHMATCH........",true);
returnString= itmDBAccessEJB.getErrorString("","AMTMITCHMATCH","","",conn); returnString= itmDBAccessEJB.getErrorString("","AMTMITCHMATCH","","",conn);
return returnString; return returnString;
} }
...@@ -1415,14 +1422,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1415,14 +1422,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}//outer try }//outer try
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::GenerateReceiptPrcEJB ::process():" + e.getMessage() + ":"); System.out.println("Exception ::GenerateReceiptPrcEJB ::process():" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
finally finally
{ {
writeLog(filePtr,"Finally Closing Connection....",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Finally Closing Connection....",true);
System.out.println("Closing Connection2...."); System.out.println("Closing Connection2....");
try try
{ {
...@@ -1433,7 +1440,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1433,7 +1440,7 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch(Exception se){} catch(Exception se){}
}// }//
writeLog(filePtr,"Finally Return String"+returnString,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Finally Return String"+returnString,true);
return returnString; return returnString;
}//process() }//process()
...@@ -1455,7 +1462,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1455,7 +1462,7 @@ Put a validation chq amount in filter and total of details matches in case heade
// added this method by rajesh k // added this method by rajesh k
private HashMap CustDetail(String custCode, HashMap rcpMap,String siteCode )throws ITMException private HashMap CustDetail(String custCode, HashMap rcpMap,String siteCode )throws ITMException
{ {
writeLog(filePtr," coming siteCode Return String"+siteCode,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr," coming siteCode Return String"+siteCode,true);
String custDetail = ""; String custDetail = "";
String sql = ""; String sql = "";
...@@ -1472,7 +1479,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1472,7 +1479,7 @@ Put a validation chq amount in filter and total of details matches in case heade
sql = "SELECT CUST_NAME,ACCT_CODE__AR,CCTR_CODE__AR,CURR_CODE,RCP_MODE,ACCT_CODE__ADV," sql = "SELECT CUST_NAME,ACCT_CODE__AR,CCTR_CODE__AR,CURR_CODE,RCP_MODE,ACCT_CODE__ADV,"
+ "CCTR_CODE__ADV,BANK_NAME FROM CUSTOMER WHERE CUST_CODE = '"+custCode.trim()+"'"; + "CCTR_CODE__ADV,BANK_NAME FROM CUSTOMER WHERE CUST_CODE = '"+custCode.trim()+"'";
writeLog(filePtr,sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
...@@ -1505,14 +1512,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1505,14 +1512,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::process():" +sql+ e.getMessage() + ":"); System.out.println("Exception ::process():" +sql+ e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -1524,7 +1531,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1524,7 +1531,7 @@ Put a validation chq amount in filter and total of details matches in case heade
sql = "SELECT C.STD_EXRT,S.FIN_ENTITY FROM CURRENCY C,SITE S " sql = "SELECT C.STD_EXRT,S.FIN_ENTITY FROM CURRENCY C,SITE S "
+ "WHERE C.CURR_CODE = '"+currCode.trim()+"' AND S.SITE_CODE = '"+siteCode.trim()+"'" ; + "WHERE C.CURR_CODE = '"+currCode.trim()+"' AND S.SITE_CODE = '"+siteCode.trim()+"'" ;
writeLog(filePtr,sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1544,14 +1551,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1544,14 +1551,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::process():" +sql+ e.getMessage() + ":"); System.out.println("Exception ::process():" +sql+ e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -1563,7 +1570,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1563,7 +1570,7 @@ Put a validation chq amount in filter and total of details matches in case heade
if(bankCode==null || bankCode.trim().length()==0)//Condition added by manoj dtd 03/01/2014 to be set from header screen if(bankCode==null || bankCode.trim().length()==0)//Condition added by manoj dtd 03/01/2014 to be set from header screen
{ {
sql = "SELECT CASH_CODE FROM SITE WHERE SITE_CODE = '"+siteCode+"'"; sql = "SELECT CASH_CODE FROM SITE WHERE SITE_CODE = '"+siteCode+"'";
writeLog(filePtr,sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
...@@ -1578,14 +1585,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1578,14 +1585,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::process():" +sql+ e.getMessage() + ":"); System.out.println("Exception ::process():" +sql+ e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -1598,7 +1605,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1598,7 +1605,7 @@ Put a validation chq amount in filter and total of details matches in case heade
if(bankCode==null || bankCode.trim().length()==0)//Condition added by manoj dtd 03/01/2014 to be set from header screen if(bankCode==null || bankCode.trim().length()==0)//Condition added by manoj dtd 03/01/2014 to be set from header screen
{ {
sql = "SELECT BANK_CODE FROM SITE WHERE SITE_CODE = '"+siteCode+"'"; sql = "SELECT BANK_CODE FROM SITE WHERE SITE_CODE = '"+siteCode+"'";
writeLog(filePtr,sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1615,14 +1622,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1615,14 +1622,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::process():" +sql+ e.getMessage() + ":"); System.out.println("Exception ::process():" +sql+ e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -1635,7 +1642,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1635,7 +1642,7 @@ Put a validation chq amount in filter and total of details matches in case heade
sql = "SELECT BANK_NAME, ACCT_CODE__BAL, CCTR_CODE__BAL, ACCT_CODE__CF," sql = "SELECT BANK_NAME, ACCT_CODE__BAL, CCTR_CODE__BAL, ACCT_CODE__CF,"
+ "CCTR_CODE__CF,ACCT_CODE__CF_AR, CCTR_CODE__CF_AR " + "CCTR_CODE__CF,ACCT_CODE__CF_AR, CCTR_CODE__CF_AR "
+ "FROM BANK WHERE BANK_CODE = '"+bankCode+"'"; + "FROM BANK WHERE BANK_CODE = '"+bankCode+"'";
writeLog(filePtr,sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1671,14 +1678,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1671,14 +1678,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::process():" +sql+ e.getMessage() + ":"); System.out.println("Exception ::process():" +sql+ e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -1782,7 +1789,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1782,7 +1789,7 @@ Put a validation chq amount in filter and total of details matches in case heade
+ "VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'N',?,?,?,?,? ,'J')"; + "VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'N',?,?,?,?,? ,'J')";
System.out.println("Insert SQL ::- "+sql); System.out.println("Insert SQL ::- "+sql);
writeLog(filePtr,"Insert SQL ::- "+sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Insert SQL ::- "+sql,true);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId); pstmt.setString(1,tranId);
pstmt.setTimestamp(2,tranDate); pstmt.setTimestamp(2,tranDate);
...@@ -1825,14 +1832,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1825,14 +1832,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -1840,7 +1847,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1840,7 +1847,7 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -2098,7 +2105,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2098,7 +2105,7 @@ Put a validation chq amount in filter and total of details matches in case heade
//+ "AND LINE_NO__REF = '"+lineNo+"'"; //+ "AND LINE_NO__REF = '"+lineNo+"'";
System.out.println("Receivables SQL : "+sql); System.out.println("Receivables SQL : "+sql);
writeLog(filePtr,"Receivables SQL : "+sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Receivables SQL : "+sql,true);
stmt = conn.createStatement(); stmt = conn.createStatement();
rs = stmt.executeQuery(sql); rs = stmt.executeQuery(sql);
if(rs.next()) if(rs.next())
...@@ -2106,7 +2113,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2106,7 +2113,7 @@ Put a validation chq amount in filter and total of details matches in case heade
flag = true; flag = true;
refDate = rs.getTimestamp(1); refDate = rs.getTimestamp(1);
currCode = rs.getString(2); currCode = rs.getString(2);
writeLog(filePtr,"SETTING CURRCODE IN BEAN FOR DETAIL:::"+currCode,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"SETTING CURRCODE IN BEAN FOR DETAIL:::"+currCode,true);
exchRateRcv = rs.getDouble(3); exchRateRcv = rs.getDouble(3);
acctCode = rs.getString(4); acctCode = rs.getString(4);
cctrCode = rs.getString(5); cctrCode = rs.getString(5);
...@@ -2142,14 +2149,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2142,14 +2149,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -2157,7 +2164,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2157,7 +2164,7 @@ Put a validation chq amount in filter and total of details matches in case heade
try try
{ {
sql = "SELECT BILL_DISC FROM RECEIVABLES WHERE TRAN_SER = '"+tranSer+"' AND REF_NO = '"+invoiceId+"'"; sql = "SELECT BILL_DISC FROM RECEIVABLES WHERE TRAN_SER = '"+tranSer+"' AND REF_NO = '"+invoiceId+"'";
writeLog(filePtr,sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
stmt = conn.createStatement(); stmt = conn.createStatement();
rs = stmt.executeQuery(sql); rs = stmt.executeQuery(sql);
...@@ -2175,14 +2182,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2175,14 +2182,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -2196,7 +2203,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2196,7 +2203,7 @@ Put a validation chq amount in filter and total of details matches in case heade
+ "( EXPORT_FUND.CONFIRMED = 'Y' ) AND " + "( EXPORT_FUND.CONFIRMED = 'Y' ) AND "
+ "( ( EXPORT_FUNDET.REF_SER = '"+tranSer+"' ) AND " + "( ( EXPORT_FUNDET.REF_SER = '"+tranSer+"' ) AND "
+ "( EXPORT_FUNDET.REF_NO = '"+invoiceId+"') ) "; + "( EXPORT_FUNDET.REF_NO = '"+invoiceId+"') ) ";
writeLog(filePtr,sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
stmt = conn.createStatement(); stmt = conn.createStatement();
rs = stmt.executeQuery(sql); rs = stmt.executeQuery(sql);
...@@ -2207,14 +2214,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2207,14 +2214,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -2229,7 +2236,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2229,7 +2236,7 @@ Put a validation chq amount in filter and total of details matches in case heade
System.out.println("rcpAmt----"+rcpAmt); System.out.println("rcpAmt----"+rcpAmt);
bdFluctuation = finCommon.getFinparams("999999","BD_FLUCTUATION_CF",conn); bdFluctuation = finCommon.getFinparams("999999","BD_FLUCTUATION_CF",conn);
writeLog(filePtr,"bdFluctuation:::"+bdFluctuation,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"bdFluctuation:::"+bdFluctuation,true);
if(bdFluctuation.equals("NULLFOUND")) if(bdFluctuation.equals("NULLFOUND"))
{ {
...@@ -2261,7 +2268,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2261,7 +2268,7 @@ Put a validation chq amount in filter and total of details matches in case heade
//} //}
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -2335,7 +2342,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2335,7 +2342,7 @@ Put a validation chq amount in filter and total of details matches in case heade
private void insertReceiptDtl(String tranId,ArrayList invoiceList,Connection conn)throws ITMException private void insertReceiptDtl(String tranId,ArrayList invoiceList,Connection conn)throws ITMException
{ {
writeLog(filePtr,"[insertReceiptDtl]START:::",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[insertReceiptDtl]START:::",true);
java.sql.Timestamp refDate = null,dueDate = null; java.sql.Timestamp refDate = null,dueDate = null;
String lineNo = "",refNo = "",currCode = "",custCode = "",acctCodeAr = ""; String lineNo = "",refNo = "",currCode = "",custCode = "",acctCodeAr = "";
String cctrCodeAr = "",billDisc = "",refSer=""; String cctrCodeAr = "",billDisc = "",refSer="";
...@@ -2348,7 +2355,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2348,7 +2355,7 @@ Put a validation chq amount in filter and total of details matches in case heade
+ "DISC_AMT,TAX_AMT,EXCH_RATE,NET_AMT,RCP_AMT,DIFF_AMT__EXCH,CUST_CODE,DUE_DATE," + "DISC_AMT,TAX_AMT,EXCH_RATE,NET_AMT,RCP_AMT,DIFF_AMT__EXCH,CUST_CODE,DUE_DATE,"
+ "ACCT_CODE__AR,CCTR_CODE__AR,BAD_DEBT_AMT,BILL_DISC,LINE_NO__REF ) " + "ACCT_CODE__AR,CCTR_CODE__AR,BAD_DEBT_AMT,BILL_DISC,LINE_NO__REF ) "
+ "VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? )"; + "VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? )";
writeLog(filePtr,"[RCPDET SQL]:::"+sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[RCPDET SQL]:::"+sql,true);
try try
{ {
...@@ -2359,11 +2366,11 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2359,11 +2366,11 @@ Put a validation chq amount in filter and total of details matches in case heade
refNo = receiptDetail.getInvoiceId(); refNo = receiptDetail.getInvoiceId();
writeLog(filePtr,"[INVOICE]"+refNo,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[INVOICE]"+refNo,true);
lineNo = receiptDetail.getLineNo(); lineNo = receiptDetail.getLineNo();
refDate = receiptDetail.getRefDate(); refDate = receiptDetail.getRefDate();
currCode = receiptDetail.getCurrCode(); currCode = receiptDetail.getCurrCode();
writeLog(filePtr,"[CURRCODE GOING]:::"+currCode,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[CURRCODE GOING]:::"+currCode,true);
exchRateRcv = receiptDetail.getExchRateRcv(); exchRateRcv = receiptDetail.getExchRateRcv();
acctCodeAr = receiptDetail.getAcctCode(); acctCodeAr = receiptDetail.getAcctCode();
...@@ -2380,7 +2387,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2380,7 +2387,7 @@ Put a validation chq amount in filter and total of details matches in case heade
exchRate = receiptDetail.getExchRate(); exchRate = receiptDetail.getExchRate();
diffAmtExch = receiptDetail.getAmtDiffExchRate(); diffAmtExch = receiptDetail.getAmtDiffExchRate();
refSer = receiptDetail.getRefSer(); refSer = receiptDetail.getRefSer();
writeLog(filePtr,"[REFSER]"+refSer,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[REFSER]"+refSer,true);
netAmtHdr = (netAmtHdr + netAmt); netAmtHdr = (netAmtHdr + netAmt);
...@@ -2415,13 +2422,13 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2415,13 +2422,13 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
pstmt.executeBatch(); pstmt.executeBatch();
writeLog(filePtr,"[billAmt TO BE + UPDATE ]:::"+billAmt,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[billAmt TO BE + UPDATE ]:::"+billAmt,true);
writeLog(filePtr,"[billDiscAmt TO BE + UPDATE ]:::"+billDiscAmt,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[billDiscAmt TO BE + UPDATE ]:::"+billDiscAmt,true);
writeLog(filePtr,"[insertReceiptDtl]END:::",true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[insertReceiptDtl]END:::",true);
} }
catch (SQLException Se) catch (SQLException Se)
{ {
writeLog(filePtr,Se,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,Se,true);
System.out.println("Exception ::" + Se.getMessage() + ":"); System.out.println("Exception ::" + Se.getMessage() + ":");
Se.printStackTrace(); Se.printStackTrace();
throw new ITMException(Se); throw new ITMException(Se);
...@@ -2429,7 +2436,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2429,7 +2436,7 @@ Put a validation chq amount in filter and total of details matches in case heade
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -2564,14 +2571,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2564,14 +2571,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
...@@ -2602,7 +2609,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2602,7 +2609,7 @@ Put a validation chq amount in filter and total of details matches in case heade
// + "BILL_DISC_AMT = (CASE WHEN BILL_DISC_AMT IS NULL THEN 0 ELSE BILL_DISC_AMT END + ("+billDiscAmt+")) WHERE TRAN_ID = '"+tranId.trim()+"'"; // + "BILL_DISC_AMT = (CASE WHEN BILL_DISC_AMT IS NULL THEN 0 ELSE BILL_DISC_AMT END + ("+billDiscAmt+")) WHERE TRAN_ID = '"+tranId.trim()+"'";
sql = "UPDATE RECEIPT SET BILL_AMT = (CASE WHEN BILL_AMT IS NULL THEN 0 ELSE BILL_AMT END + ("+billAmt+")), " sql = "UPDATE RECEIPT SET BILL_AMT = (CASE WHEN BILL_AMT IS NULL THEN 0 ELSE BILL_AMT END + ("+billAmt+")), "
+ "BILL_DISC_AMT = (CASE WHEN BILL_DISC_AMT IS NULL THEN 0 ELSE BILL_DISC_AMT END + ("+billDiscAmt+")) WHERE TRAN_ID = '"+tranId.trim()+"'"; + "BILL_DISC_AMT = (CASE WHEN BILL_DISC_AMT IS NULL THEN 0 ELSE BILL_DISC_AMT END + ("+billDiscAmt+")) WHERE TRAN_ID = '"+tranId.trim()+"'";
writeLog(filePtr,"UPDATE SQL FOR RECEIPT(S-INV)"+sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"UPDATE SQL FOR RECEIPT(S-INV)"+sql,true);
stmt = conn.createStatement(); stmt = conn.createStatement();
cnt = stmt.executeUpdate(sql); cnt = stmt.executeUpdate(sql);
...@@ -2614,14 +2621,14 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2614,14 +2621,14 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
catch (SQLException ex) catch (SQLException ex)
{ {
writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
{ {
writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment