Commit 70044cab authored by vdhoble's avatar vdhoble

changes for tran_id linkage,cust_bank_ref - vishakha


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99177 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 718365ad
......@@ -77,7 +77,7 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
ValidatorEJB validatorEJB = null;
boolean connStatus=false;
int cnt=0;
int cnt=0,cnt1 = 0;
try
{
System.out.println("Confirm method() :tran id = "+tranId);
......@@ -127,18 +127,35 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
if(errString.indexOf("Success") > -1)
{
//added by vishakha on 15-sept-15 for 'Generate Receipt' Tran_id linkage to be provided in 'Receipt' transaction for tracking purpose.
sql="update receipt_form set confirmed='Y', conf_date = ? where tran_id= ?";
System.out.println("@@@@@@3: retString"+errString);
String[] arrayForTranId = errString.split("<TranID>");
int endIndex = arrayForTranId[1].indexOf("</TranID>");
String tranIdForRCP = arrayForTranId[1].substring(0,endIndex);
System.out.println("-TranId for tracking RCP-"+tranIdForRCP);
sql="update receipt_form set confirmed='Y', conf_date = ?,tran_id__rcp = ? where tran_id = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setDate(1, new java.sql.Date(new java.util.Date().getTime()));
pstmt.setString(2, tranId );
pstmt.setString(2,tranIdForRCP);
pstmt.setString(3,tranId );
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
//for setting link in receipt table for that generated receipt
sql="update receipt set parent__tran_id = ? where tran_id = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString(1,tranId);
pstmt.setString(2,tranIdForRCP);
cnt1 = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("cnt==>"+cnt);
if(cnt>0)
System.out.println("cnt==>"+cnt + " cnt1=====>"+cnt1);
if(cnt>0 && cnt1>0)
{
conn.commit();
errStr = "VCNFSUC1";
......@@ -247,7 +264,7 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
PreparedStatement pstmt1=null;
ResultSet rs =null;
ResultSet rs1 =null;
String bankRef = "";
String tranDate =null;
int lineNo=0,lineNoCnt=0;
String siteCode="";
......@@ -274,8 +291,8 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
System.out.println("chgTerm :"+chgTerm);
System.out.println("loginEmpCode :"+loginEmpCode);
sql = "select CUST_CODE,TRAN_TYPE,RCP_MODE,BANK_CODE ,REF_NO,REF_DATE,SITE_CODE, " +
System.out.println("CALLING!!!!!!! 294");
sql = "select CUST_CODE,TRAN_TYPE,RCP_MODE,BANK_CODE ,REF_NO,REF_DATE,SITE_CODE,cust_bank_ref," +
" EFF_DATE,CUST_BANK_REF,CHQ_AMT,REMARKS,curr_code,exch_rate from RECEIPT_FORM where tran_id = ? ";
......@@ -297,7 +314,7 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
remarks=rs.getString("REMARKS");
currencyCodeHD=rs.getString("curr_code");
exchRateHD=rs.getDouble("exch_rate");
bankRef = rs.getString("cust_bank_ref");
}
rs.close();
......@@ -308,7 +325,7 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
System.out.println("refDate :"+refDate);
System.out.println("effDate :"+effDate);
//System.out.println("refDate :"+refDate);
bankRef = bankRef == null ? "" : bankRef.trim();
custCode = custCode == null ? "" : custCode.trim();
tranType = tranType == null ? "" : tranType.trim();
rcpMode = rcpMode == null ? "" : rcpMode.trim();
......@@ -443,6 +460,9 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
xmlBuff.append("<tran_type><![CDATA["+tranType+"]]></tran_type>");
xmlBuff.append("<rcp_mode><![CDATA["+rcpMode+"]]></rcp_mode>");
xmlBuff.append("<bank_code><![CDATA["+bankCode+"]]></bank_code>");
//added by vishakha
xmlBuff.append("<cust_bank_ref><![CDATA["+bankRef+"]]></cust_bank_ref>");
//ended by vishakha
xmlBuff.append("<ref_no><![CDATA["+refNoHD+"]]></ref_no>");//cheque no
if(refDate != null)
{
......@@ -469,7 +489,7 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
xmlBuff.append("<diff_amt__exch><![CDATA[]]></diff_amt__exch>");
xmlBuff.append("<sale_order><![CDATA[]]></sale_order>");
xmlBuff.append("<cust_bank_ref><![CDATA[]]></cust_bank_ref>");
// xmlBuff.append("<cust_bank_ref><![CDATA[]]></cust_bank_ref>");
xmlBuff.append("<entry_batch_no><![CDATA[]]></entry_batch_no>");
xmlBuff.append("<emp_code__aprv><![CDATA[]]></emp_code__aprv>");
......@@ -508,8 +528,9 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
for(int i = 1 ; i <= lineNoCnt ; i++ )
{
xmlBuff.append("<Detail2 objContext=\"2\" objName=\"receipt_adv\" domID=\"1\" dbID=''>");
if(tempMap.get("ref_ser" + i).trim().length() > 0 && tempMap.get("ref_no" + i).trim().length() > 0)
{
xmlBuff.append("<Detail2 objContext=\"2\" objName=\"receipt_adv\" domID=\""+i+"\" dbID=''>");
xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlBuff.append("<tran_id/>");
......@@ -520,6 +541,7 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
xmlBuff.append("<ref_no><![CDATA["+tempMap.get("ref_no" + i)+"]]></ref_no>");
xmlBuff.append("<rcp_amt><![CDATA["+tempMap.get("rcp_amt" + i)+"]]></rcp_amt>");
xmlBuff.append("</Detail2>");
}
}
xmlBuff.append(advBuff.toString());
......
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