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,9 +60,10 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc
double diffAmtExcHdr=0.0;
File filePtr = new File("../log/pbnitrace.log");
//Commented by Manoj dtd 03/05/2014File filePtr = new File("../log/pbnitrace.log");
static
/*Commented by Manoj dtd 03/05/2014
static
{
File mkd = new File("../log");
if(!mkd.exists())
......@@ -71,7 +72,7 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc
System.out.println("Directory Built................ "+mkd);
}
}
}*/
/*public void ejbCreate() throws RemoteException, CreateException
{
......@@ -106,6 +107,7 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc
String rtrStr = "";
Document headerDom = null;
Document detailDom = null;
/* Commented by Manoj dtd 03/05/2014
try
{
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
{
e.printStackTrace();
throw new ITMException(e);
}
}*/
try
{
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
}
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
DatabaseMetaData dbmd = conn.getMetaData();
/*Commented by Manoj dtd 03/05/2014
writeLog(filePtr,"DriverName["+dbmd.getDriverName() + "]",true);
writeLog(filePtr,"DriverURI["+dbmd.getURL() + "]",true);
writeLog(filePtr,"DriverUSER["+dbmd.getUserName() + "]",true);
writeLog(filePtr,"ApplDateFormat["+genericUtility.getApplDateFormat() + "]",true);
writeLog(filePtr,"DBDateFormat["+genericUtility.getDBDateFormat() + "]",true);
*/
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);
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
}
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";
errString = itmDBAccessEJB.getErrorString("site_code",errCode,userId,"",conn);
return errString;
......@@ -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("cust_code__from is :::"+custCodeFrom);
System.out.println("cust_code__to is :::"+custCodeTo);
writeLog(filePtr,"cust_code__from:::"+custCodeFrom,true);
writeLog(filePtr,"cust_code__to:::"+custCodeTo,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"cust_code__from:::"+custCodeFrom,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
{
......@@ -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);
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 )
{
sdueDate = "";
......@@ -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);
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 )
{
sdueDate = "";
......@@ -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 <= ? ) OR (D.TRAN_DATE IS NULL)) "
+ "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.setString(1,siteCode.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
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,"%%%%%%%%% CHEQUE_DATE :::."+rs.getString(7),true);
writeLog(filePtr,"%%%%%%%%% CHQ_AMOUNT :::."+rs.getDouble(9),true);
writeLog(filePtr,"%%%%%%%%% CHEQUE_DATE :::."+rs.getString(6),true);
*/
retTabSepStrBuff.append("</Detail2>");
......@@ -672,20 +677,20 @@ Put a validation chq amount in filter and total of details matches in case heade
}//try
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() + ":");
throw new ITMException(e);
}
catch(Exception ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception []::GenerateReceiptPrcEJB :"+ex.getMessage());
ex.printStackTrace();
throw new ITMException(ex);
}
resultString = retTabSepStrBuff.toString();
writeLog(filePtr,resultString,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,resultString,true);
if (!errCode.equals(""))
{
resultString = itmDBAccessEJB.getErrorString("", errCode, "", "", conn);
......@@ -694,13 +699,13 @@ Put a validation chq amount in filter and total of details matches in case heade
}//outer try
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() + ":");
throw new ITMException(e);
}
catch(Exception ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception []::GenerateReceiptPrcEJB :"+ex.getMessage());
ex.printStackTrace();
throw new ITMException(ex);
......@@ -720,7 +725,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch(Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
e.printStackTrace();
}
......@@ -732,10 +737,12 @@ Put a validation chq amount in filter and total of details matches in case heade
{
try
{
writeLog(filePtr,"P R O C E S S FX I N P R O C E S S :::.",true);
/*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,"Generating Receipt............... ",true);
writeLog(filePtr,"xmlString :::."+xmlString,true);
writeLog(filePtr,"xmlString :::."+xmlString2,true);
*/
}catch(Exception e){
System.out.println(e.getMessage());}
......@@ -757,7 +764,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}
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() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -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
System.out.println("siteCode in process() "+siteCode);
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);
sFilterChqAmt = genericUtility.getColumnValue("cheque_amount",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
dueDate = java.sql.Timestamp.valueOf(sdueDate + " 00:00:00");
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;
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getDBDateFormat());
date = sdf.parse(tranDate.toString());
tranDate = java.sql.Timestamp.valueOf(sdf.format(date).toString() + " 00:00:00.0");
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());
String trDate = sdf1.format(date).toString();
System.out.println("TranDate ::::-"+trDate);
writeLog(filePtr,"TranDate ::::-"+trDate,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"TranDate ::::-"+trDate,true);
/* try
......@@ -1149,7 +1156,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}
}//inner for
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.setString(1,custCode);
rs = pstmt.executeQuery();
......@@ -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 + ":" + 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,"searchKey::::: "+searchKey,true);
writeLog(filePtr,"searchKey::::: "+searchKey,true);*/
// if(tranSer.equalsIgnoreCase("S-INV"))
//{
java.sql.Timestamp chequeDate = null;
//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)
{
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
else
{
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");
}
receiptMap = new HashMap();
......@@ -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, chequeNo);
System.out.println("ele::::::::::"+ele);
writeLog(filePtr,"ele::::::::::"+ele,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"ele::::::::::"+ele,true);
ReceiptElements receiptElements;
if (ele == -1)
......@@ -1217,7 +1224,7 @@ Put a validation chq amount in filter and total of details matches in case heade
//ele = receiptList.size() -1;
ele = getListElement(receiptList, searchKey);
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
......@@ -1233,7 +1240,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}//Outer For
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
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
ReceiptElements receiptElements = (ReceiptElements)receiptList.get(Ctr);
double chequeAmt = 0.0;
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();
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
double rcpAmount =0.0;
int invSize = 0;
invSize = invoiceList.size();
writeLog(filePtr,"@@@@ The TotalInvoicewrrrrrrrrrrrrrrr is @@@@ ["+invoiceList.size()+"]",true);
writeLog(filePtr,"!!!!!!!! invSize " +invSize ,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"@@@@ The TotalInvoicewrrrrrrrrrrrrrrr is @@@@ ["+invoiceList.size()+"]",true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"!!!!!!!! invSize " +invSize ,true);
for (int Ctr1 = 0; Ctr1 < invSize ; Ctr1++)
{
ReceiptDetail receiptDetail = (ReceiptDetail)invoiceList.get(Ctr1);
rcpAmount = rcpAmount +receiptDetail.getRcpAmt();
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);
writeLog(filePtr,"chequeAmt:-[ "+chequeAmt+"]",true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"rcpAmount:-[ "+rcpAmount+"]",true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"chequeAmt:-[ "+chequeAmt+"]",true);
//if(chequeAmt != rcpAmount) // *********
if(chequeAmt != rcpAmount && chequeAmt != 0 && rcpAmount != 0) // *********
{
amtFlag = false;
writeLog(filePtr,"MITCH MATCH AMOUNT Cheque No["+receiptElements.getChequeNo()+"] TotalChequeAmt ["+chequeAmt+"]",true);
writeLog(filePtr,"RcpAmount:-"+rcpAmount,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"MITCH MATCH AMOUNT Cheque No["+receiptElements.getChequeNo()+"] TotalChequeAmt ["+chequeAmt+"]",true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"RcpAmount:-"+rcpAmount,true);
}
if (filterChqAmt != chequeAmt && chequeAmt != 0)
{
amtFlag = false;
writeLog(filePtr,"MITCH MATCH AMOUNT Cheque No["+receiptElements.getChequeNo()+"] TotalChequeAmt ["+chequeAmt+"]",true);
writeLog(filePtr,"RcpAmount:-"+rcpAmount,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"MITCH MATCH AMOUNT Cheque No["+receiptElements.getChequeNo()+"] TotalChequeAmt ["+chequeAmt+"]",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)
{
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++)
{
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
//tranId = generateTranTd("w_receipt_adv",trDate,siteCode);
tranId = generateTranTd("w_receivables_jv",trDate,siteCode,conn);
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);
try
{
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);
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)
{
conn.rollback();
......@@ -1315,15 +1322,15 @@ Put a validation chq amount in filter and total of details matches in case heade
}
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();
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);
}
}
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -1331,11 +1338,11 @@ Put a validation chq amount in filter and total of details matches in case heade
try
{
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)
{
writeLog(filePtr,"Update Successfully in header["+tranId+"]",true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Update Successfully in header["+tranId+"]",true);
netAmtHdr = 0;
billAmt = 0;
billDiscAmt = 0;
......@@ -1349,7 +1356,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -1361,7 +1368,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}
else
{
writeLog(filePtr,"AMTMITCHMATCH........",true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"AMTMITCHMATCH........",true);
returnString= itmDBAccessEJB.getErrorString("","AMTMITCHMATCH","","",conn);
return returnString;
}
......@@ -1415,14 +1422,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}//outer try
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() + ":");
e.printStackTrace();
throw new ITMException(e);
}
finally
{
writeLog(filePtr,"Finally Closing Connection....",true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Finally Closing Connection....",true);
System.out.println("Closing Connection2....");
try
{
......@@ -1433,7 +1440,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}
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;
}//process()
......@@ -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
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 sql = "";
......@@ -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,"
+ "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);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -1505,14 +1512,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
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() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -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 "
+ "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);
rs = pstmt.executeQuery();
......@@ -1544,14 +1551,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
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() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -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
{
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);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -1578,14 +1585,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
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() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -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
{
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);
rs = pstmt.executeQuery();
......@@ -1615,14 +1622,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
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() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -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,"
+ "CCTR_CODE__CF,ACCT_CODE__CF_AR, CCTR_CODE__CF_AR "
+ "FROM BANK WHERE BANK_CODE = '"+bankCode+"'";
writeLog(filePtr,sql,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
......@@ -1671,14 +1678,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
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() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -1782,7 +1789,7 @@ Put a validation chq amount in filter and total of details matches in case heade
+ "VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'N',?,?,?,?,? ,'J')";
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.setString(1,tranId);
pstmt.setTimestamp(2,tranDate);
......@@ -1825,14 +1832,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -1840,7 +1847,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -2098,7 +2105,7 @@ Put a validation chq amount in filter and total of details matches in case heade
//+ "AND LINE_NO__REF = '"+lineNo+"'";
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();
rs = stmt.executeQuery(sql);
if(rs.next())
......@@ -2106,7 +2113,7 @@ Put a validation chq amount in filter and total of details matches in case heade
flag = true;
refDate = rs.getTimestamp(1);
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);
acctCode = rs.getString(4);
cctrCode = rs.getString(5);
......@@ -2142,14 +2149,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -2157,7 +2164,7 @@ Put a validation chq amount in filter and total of details matches in case heade
try
{
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();
rs = stmt.executeQuery(sql);
......@@ -2175,14 +2182,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -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_FUNDET.REF_SER = '"+tranSer+"' ) AND "
+ "( EXPORT_FUNDET.REF_NO = '"+invoiceId+"') ) ";
writeLog(filePtr,sql,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
......@@ -2207,14 +2214,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -2229,7 +2236,7 @@ Put a validation chq amount in filter and total of details matches in case heade
System.out.println("rcpAmt----"+rcpAmt);
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"))
{
......@@ -2261,7 +2268,7 @@ Put a validation chq amount in filter and total of details matches in case heade
//}
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -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
{
writeLog(filePtr,"[insertReceiptDtl]START:::",true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[insertReceiptDtl]START:::",true);
java.sql.Timestamp refDate = null,dueDate = null;
String lineNo = "",refNo = "",currCode = "",custCode = "",acctCodeAr = "";
String cctrCodeAr = "",billDisc = "",refSer="";
......@@ -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,"
+ "ACCT_CODE__AR,CCTR_CODE__AR,BAD_DEBT_AMT,BILL_DISC,LINE_NO__REF ) "
+ "VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? )";
writeLog(filePtr,"[RCPDET SQL]:::"+sql,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[RCPDET SQL]:::"+sql,true);
try
{
......@@ -2359,11 +2366,11 @@ Put a validation chq amount in filter and total of details matches in case heade
refNo = receiptDetail.getInvoiceId();
writeLog(filePtr,"[INVOICE]"+refNo,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[INVOICE]"+refNo,true);
lineNo = receiptDetail.getLineNo();
refDate = receiptDetail.getRefDate();
currCode = receiptDetail.getCurrCode();
writeLog(filePtr,"[CURRCODE GOING]:::"+currCode,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[CURRCODE GOING]:::"+currCode,true);
exchRateRcv = receiptDetail.getExchRateRcv();
acctCodeAr = receiptDetail.getAcctCode();
......@@ -2380,7 +2387,7 @@ Put a validation chq amount in filter and total of details matches in case heade
exchRate = receiptDetail.getExchRate();
diffAmtExch = receiptDetail.getAmtDiffExchRate();
refSer = receiptDetail.getRefSer();
writeLog(filePtr,"[REFSER]"+refSer,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[REFSER]"+refSer,true);
netAmtHdr = (netAmtHdr + netAmt);
......@@ -2415,13 +2422,13 @@ Put a validation chq amount in filter and total of details matches in case heade
}
pstmt.executeBatch();
writeLog(filePtr,"[billAmt TO BE + UPDATE ]:::"+billAmt,true);
writeLog(filePtr,"[billDiscAmt TO BE + UPDATE ]:::"+billDiscAmt,true);
writeLog(filePtr,"[insertReceiptDtl]END:::",true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[billAmt TO BE + UPDATE ]:::"+billAmt,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[billDiscAmt TO BE + UPDATE ]:::"+billDiscAmt,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"[insertReceiptDtl]END:::",true);
}
catch (SQLException Se)
{
writeLog(filePtr,Se,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,Se,true);
System.out.println("Exception ::" + Se.getMessage() + ":");
Se.printStackTrace();
throw new ITMException(Se);
......@@ -2429,7 +2436,7 @@ Put a validation chq amount in filter and total of details matches in case heade
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -2564,14 +2571,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
......@@ -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()+"'";
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()+"'";
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();
cnt = stmt.executeUpdate(sql);
......@@ -2614,14 +2621,14 @@ Put a validation chq amount in filter and total of details matches in case heade
}
catch (SQLException ex)
{
writeLog(filePtr,ex,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
catch (Exception e)
{
writeLog(filePtr,e,true);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
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