Commit e5f85533 authored by caluka's avatar caluka

amount match condition is removed


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101184 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5eca1bf7
......@@ -63,8 +63,9 @@ public class EcollectionSchedule implements Schedule
userInfo = new ibase.utility.UserInfoBean( scheduleParamXML );
siteCode = userInfo.getSiteCode();
xtraParams = "loginEmpCode="+userInfo.getEmpCode()+"~~termId="+userInfo.getRemoteHost()+"~~loginSiteCode="+loginSiteCode;
E12GenericUtility genericUtility = new E12GenericUtility();
// GenericUtility genericUtility=GenericUtility.getInstance();
//GenericUtility genericUtility=GenericUtility.getInstance();
E12GenericUtility genericUtility= new E12GenericUtility();
Document dom=genericUtility.parseString(scheduleParamXML);
NodeList paramList = dom.getElementsByTagName( "SCHEDULE" );
......@@ -136,10 +137,10 @@ public class EcollectionSchedule implements Schedule
String errString ="",xmlString="";
String strToWrite = "";
String endDateStr = null;
String currencyCode="";
String currencyCode="",stmtId="";
double exchRate = 0.0;
double rcpAmt=0,bankAmount=0,rcpAmtDet=0;
int cnt=0,lineNo=0;
int cnt=0,lineNo=0,bankCnt=0;
Date refDate=null,effDate=null;
//E12GenericUtility e12GenericUtility = new E12GenericUtility();
SimpleDateFormat sdf = new SimpleDateFormat(e12GenericUtility.getApplDateFormat());
......@@ -157,7 +158,8 @@ public class EcollectionSchedule implements Schedule
java.util.Calendar cal = java.util.Calendar.getInstance();
tranDate = simpleDateFormat.format(cal.getTime());
sql = "select bank_code,ref_no,chq_amt,cust_code,tran_type,rcp_mode,ref_date,eff_date,remarks,tran_id,curr_code,exch_rate from " + " receipt_form where confirmed='Y' and status='C' and site_code= ? ";
sql = "select bank_code,ref_no,chq_amt,cust_code,tran_type,rcp_mode,ref_date,eff_date," +
"remarks,tran_id,curr_code,exch_rate,stmt_id from " + " receipt_form where confirmed='Y' and status='C' and site_code= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
......@@ -176,6 +178,7 @@ public class EcollectionSchedule implements Schedule
tranId = rs.getString("tran_id");
currencyCode = rs.getString("curr_code");
exchRate = rs.getDouble("exch_rate");
stmtId = rs.getString("stmt_id");
System.out.println("receipt form tranId:::::::::" + tranId);
strToWrite = tranId+",";
......@@ -200,7 +203,7 @@ public class EcollectionSchedule implements Schedule
pstmt1 = null;
finEntity = finEntity == null ? "" : finEntity.trim();
bankAmount=0;
/*bankAmount=0;
sql1 = " select amount from bank_statement where site_code=? and bank_code= ? and ref_no= ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, siteCode);
......@@ -214,11 +217,11 @@ public class EcollectionSchedule implements Schedule
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
pstmt1 = null;*/
System.out.println("bankAmount>>>>>>[" + bankAmount + "]rcpAmt>>>>>[" + rcpAmt + ']');
if (rcpAmt == bankAmount)
{
//System.out.println("bankAmount>>>>>>[" + bankAmount + "]rcpAmt>>>>>[" + rcpAmt + ']');
//if (rcpAmt == bankAmount)
//{
StringBuffer xmlBuff = new StringBuffer();
StringBuffer advBuff = new StringBuffer();
errString = "";
......@@ -284,7 +287,8 @@ public class EcollectionSchedule implements Schedule
xmlBuff.append("<fin_scheme><![CDATA[]]></fin_scheme>");
xmlBuff.append("<item_ser><![CDATA[]]></item_ser>");
xmlBuff.append("<rcp_type><![CDATA[]]></rcp_type>");
xmlBuff.append("<remarks><![CDATA[" + remarks + "]]></remarks>");
//xmlBuff.append("<remarks><![CDATA[" + remarks + "]]></remarks>");
xmlBuff.append("<remarks><![CDATA[Transaction created from Ecollection scheduler]]></remarks>");
xmlBuff.append("<fin_entity><![CDATA[" + finEntity + "]]></fin_entity>");
xmlBuff.append("<curr_code><![CDATA["+currencyCode+"]]></curr_code>");
xmlBuff.append("<exch_rate><![CDATA["+exchRate+"]]></exch_rate>");
......@@ -349,17 +353,38 @@ public class EcollectionSchedule implements Schedule
System.out.println("retString from conf ::" + errString);
if (errString.indexOf("VTCICONF3") > -1)
{
sql1 = " update receipt_form set status= 'P' where tran_id = ? ";
cnt=0;
bankCnt=0;
sql1 = " update receipt_form set status= 'P',TRAN_ID__RCP=? where tran_id = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, tranId);
pstmt1.setString(1, tranIdForIssue);
pstmt1.setString(2, tranId);
cnt = pstmt1.executeUpdate();
if (cnt > 0)
/*if (cnt > 0)
{
System.out.println("UPDATE QUERY FOR STATUS");
conn.commit();
}
}*/
pstmt1.close();
pstmt1 = null;
sql1 = " update bank_statement set collection_form_ref= ? where tran_id = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, tranId);
pstmt1.setString(2, stmtId);
bankCnt = pstmt1.executeUpdate();
/*if (bankCnt > 0)
{
System.out.println("UPDATE QUERY FOR STATUS");
conn.commit();
}*/
pstmt1.close();
pstmt1 = null;
if(cnt >0 && bankCnt>0)
{
conn.commit();
System.out.println("UPDATE QUERY FOR STATUS");
}
} else
{
System.out.println("connection roll back for confirmation");
......@@ -380,7 +405,7 @@ public class EcollectionSchedule implements Schedule
fos1.write(strToWrite.getBytes());
System.out.println("End Time for transaction"+endDateStr+"string to write"+strToWrite);
} else
/*} else
{
sql1 = " update receipt_form set remarks = 'Mismatch amount in bank statement and total receipt amount',status= 'R' where tran_id = ? ";
pstmt1 = conn.prepareStatement(sql1);
......@@ -392,7 +417,7 @@ public class EcollectionSchedule implements Schedule
}
pstmt1.close();
pstmt1 = null;
}
}*/
}
rs.close();
......
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