Commit 51323e64 authored by msalla's avatar msalla

:On confirmation of receipt dishonor system is giving error of coin difference...

:On confirmation of receipt dishonor system is giving error of coin difference error. the receipt includes packing credit adjustment and taxes in details

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@212153 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3d2292f0
...@@ -13,6 +13,9 @@ import org.w3c.dom.CDATASection; ...@@ -13,6 +13,9 @@ import org.w3c.dom.CDATASection;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import com.itextpdf.text.log.SysoCounter;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon; import ibase.webitm.ejb.dis.DistCommon;
...@@ -138,11 +141,12 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -138,11 +141,12 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
System.out.println("inside try currcolumn val["+childNodeName+"]"); //System.out.println("inside try currcolumn val["+childNodeName+"]");
if (childNodeName.equalsIgnoreCase("cust_code")) if (childNodeName.equalsIgnoreCase("cust_code"))
{ {
System.out.println("cust_code wfValData"); //System.out.println("cust_code wfValData");
custCode = this.genericUtility.getColumnValue("cust_code", dom); custCode = this.genericUtility.getColumnValue("cust_code", dom);
// System.out.println("cust_code in validation"+custCode);
tranSeries = this.genericUtility.getColumnValue("tran_ser", dom); tranSeries = this.genericUtility.getColumnValue("tran_ser", dom);
if ("R".equalsIgnoreCase(tranSeries)) if ("R".equalsIgnoreCase(tranSeries))
{ {
...@@ -168,13 +172,21 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -168,13 +172,21 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
else else
{ {
receiptNo = this.genericUtility.getColumnValue("receipt_no", dom); receiptNo = this.genericUtility.getColumnValue("receipt_no", dom);
sql = " select misc_rcpdet.sundry_type from misc_receipt, misc_rcpdet,"+ /*sql = " select misc_rcpdet.sundry_type from misc_receipt, misc_rcpdet,"+
" bank,customer,site where misc_receipt.tran_id = misc_rcpdet.tran_id and "+ " bank,customer,site where misc_receipt.tran_id = misc_rcpdet.tran_id and "+
" misc_receipt.bank_code = bank.bank_code and "+ " misc_receipt.bank_code = bank.bank_code and "+
" misc_rcpdet.sundry_code= customer.cust_code and "+ " misc_rcpdet.sundry_code= customer.cust_code and "+
" misc_receipt.site_code = site.site_code and "+ " misc_receipt.site_code = site.site_code and "+
" misc_receipt.tran_id= ? and "+ " misc_receipt.tran_id= ? and "+
" misc_rcpdet.line_no = 1";*///commented by monika 15 nov 2019
sql = " select misc_rcpdet.sundry_type from misc_receipt, misc_rcpdet,"+
" bank,site where misc_receipt.tran_id = misc_rcpdet.tran_id and "+
" misc_receipt.bank_code = bank.bank_code and "+
" misc_receipt.site_code = site.site_code and "+
" misc_receipt.tran_id= ? and "+
" misc_rcpdet.line_no = 1"; " misc_rcpdet.line_no = 1";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, receiptNo); pstmt.setString(1, receiptNo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -186,6 +198,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -186,6 +198,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
// System.out.println("sundry type:::"+sundryType);
switch (sundryType) switch (sundryType)
{ {
case "E": case "E":
...@@ -334,7 +347,8 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -334,7 +347,8 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else if (rtranDate.compareTo(trandate) >= 0) // else if (rtranDate.compareTo(trandate) >=0) //commenetd by monika-14 nov 2019
else if (rtranDate.compareTo(trandate) >0) //changes done to set rcp date and dishr ate should be same
{ {
errCode = "VTDATE10"; errCode = "VTDATE10";
errList.add(errCode); errList.add(errCode);
...@@ -389,7 +403,9 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -389,7 +403,9 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else if (rtranDate.compareTo(trandate) >= 0) { // else if (rtranDate.compareTo(trandate) > =0) {//COMMENTED BY MONIKA 14 NOV 2019
else if (rtranDate.compareTo(trandate) > 0) {
errCode = "VTDATE10"; errCode = "VTDATE10";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -530,13 +546,15 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -530,13 +546,15 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(rtranDate.compareTo(trandate)>= 0) // if(rtranDate.compareTo(trandate)>= 0)//COMMENTED BY MONIKA 14 NOV 2019
if(rtranDate.compareTo(trandate)>0)
{ {
errCode = "VTDATE10"; errCode = "VTDATE10";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
//tran_date from misc_receipt //tran_date from misc_receipt
else else
...@@ -555,7 +573,8 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -555,7 +573,8 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(rtranDate.compareTo(trandate)>= 0) // if(rtranDate.compareTo(trandate)>= 0)//COMMENTED BY MONIKA 14 NOV 2019
if(rtranDate.compareTo(trandate)>0)
{ {
errCode = "VTDATE10"; errCode = "VTDATE10";
errList.add(errCode); errList.add(errCode);
...@@ -733,7 +752,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -733,7 +752,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
String sql = null, rcptcode; String sql = null, rcptcode;
try try
{ {
System.out.println("inside the try itemChanged block"); //System.out.println("inside the try itemChanged block"+currentColumn);
dateFormat1 = new SimpleDateFormat(genericUtility.getApplDateFormat()); dateFormat1 = new SimpleDateFormat(genericUtility.getApplDateFormat());
conn = getConnection(); conn = getConnection();
conn.setAutoCommit(false); conn.setAutoCommit(false);
...@@ -756,12 +775,12 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -756,12 +775,12 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
case 1: case 1:
valueXmlString.append("<Detail1>"); valueXmlString.append("<Detail1>");
parentNodeList = dom.getElementsByTagName("Detail1"); parentNodeList = dom.getElementsByTagName("Detail1");
System.out.println("inside the case1"); // System.out.println("inside the case1");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
rcpMode = genericUtility.getColumnValue("rcp_mode_t", dom); rcpMode = genericUtility.getColumnValue("rcp_mode_t", dom);
System.out.println("first receipt mode ------>" + rcpMode); //System.out.println("first receipt mode ------>" + rcpMode);
do do
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
...@@ -792,9 +811,10 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -792,9 +811,10 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
} }
else if ("cust_code".equalsIgnoreCase(currentColumn.trim())) else if ("cust_code".equalsIgnoreCase(currentColumn.trim()))
{ {
System.out.println("inside the cust code itmchange"); //System.out.println("inside the cust code itmchange");
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom)); custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
sql = "select cust_name from customer where cust_code = ?"; sql = "select cust_name from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode); pstmt.setString(1, custCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -802,11 +822,13 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -802,11 +822,13 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
{ {
custName = checkNull(rs.getString("cust_name")); custName = checkNull(rs.getString("cust_name"));
} }
System.out.println("custCode in cust code method----------->>>>>>>>>>>>>"+custCode); // System.out.println("custCode in cust code method----------->>>>>>>>>>>>>"+custCode);
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
valueXmlString.append("<cust_code>").append("<![CDATA[" + custName + "]]>").append("</cust_code>"); valueXmlString.append("<cust_code>").append("<![CDATA[" + custName + "]]>").append("</cust_code>");//COMMENTED BY MONIKA
// valueXmlString.append("<cust_name>").append("<![CDATA[" + custName + "]]>").append("</cust_name>");
} }
else if ("tran_date".equalsIgnoreCase(currentColumn.trim())) else if ("tran_date".equalsIgnoreCase(currentColumn.trim()))
{ {
...@@ -815,13 +837,15 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -815,13 +837,15 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
} }
else if (currentColumn.trim().equalsIgnoreCase("receipt_no")|| currentColumn.trim().equalsIgnoreCase("tran_ser")) else if (currentColumn.trim().equalsIgnoreCase("receipt_no")|| currentColumn.trim().equalsIgnoreCase("tran_ser"))
{ {
System.out.println("inside the Receipt number and tran series itmchange"); //System.out.println("inside the Receipt number and tran series itmchange");
finparamcrterm = finCommon.getFinparams("999999", "DISHONOUR_CR_TERM", conn); finparamcrterm = finCommon.getFinparams("999999", "DISHONOUR_CR_TERM", conn);
tranSer = checkNull(genericUtility.getColumnValue("tran_ser", dom)); tranSer = checkNull(genericUtility.getColumnValue("tran_ser", dom));
if ("R".equalsIgnoreCase(tranSer)) if ("R".equalsIgnoreCase(tranSer))
{ {
System.out.println("inside the if R Receipt number and tran series itmchange"); //System.out.println("inside the if R Receipt number and tran series itmchange"+tranSer);
rcptcode = genericUtility.getColumnValue("receipt_no", dom); rcptcode = genericUtility.getColumnValue("receipt_no", dom);
//System.out.println("inside the if R Receipt number and tran series itmchange"+rcptcode);
sql = "select receipt.cust_code,receipt.ref_no,receipt.ref_date, receipt.net_amt,receipt.adv_amt,receipt.bill_amt, " sql = "select receipt.cust_code,receipt.ref_no,receipt.ref_date, receipt.net_amt,receipt.adv_amt,receipt.bill_amt, "
+ " receipt.bank_code,receipt.site_code,receipt.fin_entity,receipt.curr_code,receipt.rcp_mode,receipt.acct_code__cf, " + " receipt.bank_code,receipt.site_code,receipt.fin_entity,receipt.curr_code,receipt.rcp_mode,receipt.acct_code__cf, "
+ " receipt.cctr_code__cf,receipt.exch_rate,receipt.diff_amt__exch,bank.bank_name,bank.acct_code__bc, " + " receipt.cctr_code__cf,receipt.exch_rate,receipt.diff_amt__exch,bank.bank_name,bank.acct_code__bc, "
...@@ -837,20 +861,27 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -837,20 +861,27 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
if (rs.next()) if (rs.next())
{ {
custCode = checkNull(rs.getString("cust_code")); custCode = checkNull(rs.getString("cust_code"));
System.out.println("custCode in rs----------->>>>>>>>>>>>>"+custCode); //System.out.println("custCode in rs----------->>>>>>>>>>>>>"+custCode);
refNo = checkNull(rs.getString("ref_no")); refNo = checkNull(rs.getString("ref_no"));
refDate = rs.getTimestamp("ref_date"); refDate = rs.getTimestamp("ref_date");
//System.out.println("ref_date::::>>"+refDate);
netAmt = rs.getDouble("net_amt"); netAmt = rs.getDouble("net_amt");
advAmt = rs.getDouble("adv_amt"); advAmt = rs.getDouble("adv_amt");
billAmt = rs.getInt("bill_amt"); billAmt = rs.getInt("bill_amt");
bankCode = checkNull(rs.getString("bank_code")); bankCode = checkNull(rs.getString("bank_code"));
siteCode = checkNull(rs.getString("site_code")); siteCode = checkNull(rs.getString("site_code"));
finEntity = checkNull(rs.getString("fin_entity")); finEntity = checkNull(rs.getString("fin_entity"));
//System.out.println("curr code in dishrnr"+finEntity);
currCode = checkNull(rs.getString("curr_code")); currCode = checkNull(rs.getString("curr_code"));
//System.out.println("curr code in dishrnr"+currCode);
rcpMode = checkNull(rs.getString("rcp_mode")); rcpMode = checkNull(rs.getString("rcp_mode"));
accCodeCf = checkNull(rs.getString("acct_code__cf")); accCodeCf = checkNull(rs.getString("acct_code__cf"));
cctrCodeCf = checkNull(rs.getString("cctr_code__cf")); cctrCodeCf = checkNull(rs.getString("cctr_code__cf"));
exchRate = rs.getDouble("exch_rate"); exchRate = rs.getDouble("exch_rate");
// System.out.println("exch rate in dishrnr"+exchRate);
diffAmtExchange = checkNull(rs.getString("diff_amt__exch")); diffAmtExchange = checkNull(rs.getString("diff_amt__exch"));
bankBName = checkNull(rs.getString("bank_name")); bankBName = checkNull(rs.getString("bank_name"));
bankAccCodeBc = checkNull(rs.getString("acct_code__bc")); bankAccCodeBc = checkNull(rs.getString("acct_code__bc"));
...@@ -868,8 +899,8 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -868,8 +899,8 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
{ {
finparmCrTerm = crTerm; finparmCrTerm = crTerm;
} }
System.out.println("inside the if finparamcrterm"); // System.out.println("inside the if finparamcrterm");
System.out.println("custCode----------->>>>>>>>>>>>>"+custCode); //System.out.println("custCode----------->>>>>>>>>>>>>"+custCode);
sql = "select descr from crterm where cr_term = ?"; sql = "select descr from crterm where cr_term = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, crTerm); pstmt.setString(1, crTerm);
...@@ -884,7 +915,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -884,7 +915,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
pstmt = null; pstmt = null;
if (finEntity != null && finEntity.trim().length() > 0) if (finEntity != null && finEntity.trim().length() > 0)
{ {
System.out.println("inside the if FinEntity"); // System.out.println("inside the if FinEntity"+finEntity);
sql = "select curr_code from finent where FIN_ENTITY = ?"; sql = "select curr_code from finent where FIN_ENTITY = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity); pstmt.setString(1, finEntity);
...@@ -893,6 +924,8 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -893,6 +924,8 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
{ {
currCodeBc = checkNull(rs.getString("curr_code")); currCodeBc = checkNull(rs.getString("curr_code"));
} }
// System.out.println("curr_code_bc>>["+currCodeBc);
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
...@@ -924,43 +957,51 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -924,43 +957,51 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
valueXmlString.append("<exch_rate>").append("<![CDATA[" + exchRate + "]]>").append("</exch_rate>"); valueXmlString.append("<exch_rate>").append("<![CDATA[" + exchRate + "]]>").append("</exch_rate>");
valueXmlString.append("<diff_amt__exch>").append("<![CDATA[" + diffAmtExchange + "]]>").append("</diff_amt__exch>"); valueXmlString.append("<diff_amt__exch>").append("<![CDATA[" + diffAmtExchange + "]]>").append("</diff_amt__exch>");
valueXmlString.append("<crterm_descr>").append("<![CDATA[" + crTermDesr + "]]>").append("</crterm_descr>"); valueXmlString.append("<crterm_descr>").append("<![CDATA[" + crTermDesr + "]]>").append("</crterm_descr>");
// System.out.println("currency_code bc before --"+currCodeBc);
valueXmlString.append("<curr_code__bc>").append("<![CDATA[" + currCodeBc + "]]>").append("</curr_code__bc>"); valueXmlString.append("<curr_code__bc>").append("<![CDATA[" + currCodeBc + "]]>").append("</curr_code__bc>");
// System.out.println("currency_code bc after --"+currCodeBc);
setNodeValue(dom, "curr_code__bc", currCodeBc); setNodeValue(dom, "curr_code__bc", currCodeBc);
// System.out.println("\nInside header..dom.."+genericUtility.serializeDom(dom));
// System.out.println("\nInside header..dom.."+genericUtility.serializeDom(dom1));
reStr = itemChanged(dom, dom1, objContext, "curr_code__bc", editFlag, xtraParams); reStr = itemChanged(dom, dom1, objContext, "curr_code__bc", editFlag, xtraParams);
pos = reStr.indexOf("<Detail1>"); pos = reStr.indexOf("<Detail1>");
reStr = reStr.substring(pos + 9); reStr = reStr.substring(pos + 9);
pos = reStr.indexOf("</Detail1>"); pos = reStr.indexOf("</Detail1>");
reStr = reStr.substring(0, pos); reStr = reStr.substring(0, pos);
valueXmlString.append(reStr); valueXmlString.append(reStr);
// System.out.println("\nInside header..dom.."+reStr);
} }
else else
{ {
System.out.println("inside the else receipt_no"); //System.out.println("inside the else receipt_no");
rcptcode = genericUtility.getColumnValue("receipt_no", dom); rcptcode = genericUtility.getColumnValue("receipt_no", dom);
System.out.println(" receipt_no"+rcpNo); // System.out.println(" receipt_no"+rcpNo);
System.out.println("recp length = "+ rcpNo.trim().length()); // System.out.println("recp length = "+ rcpNo.trim().length());
if(rcptcode!=null) if(rcptcode!=null)
{ {
sql = "select site_code, site_code__for from misc_receipt where tran_id = ?"; sql = "select site_code, site_code__for from misc_receipt where tran_id = ?";
System.out.println("inside the else receipt_after sql" + rcptcode); //System.out.println("inside the else receipt_after sql" + rcptcode);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, rcptcode); pstmt.setString(1, rcptcode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
siteCode = checkNull(rs.getString("site_code")); siteCode = checkNull(rs.getString("site_code"));
System.out.println("sidecode" + siteCode); // System.out.println("sidecode" + siteCode);
siteCodeFor = checkNull(rs.getString("site_code__for")); siteCodeFor = checkNull(rs.getString("site_code__for"));
System.out.println("sitecodefor" + siteCodeFor); // System.out.println("sitecodefor" + siteCodeFor);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (!siteCode.equalsIgnoreCase(siteCodeFor)) if((siteCodeFor!=null && siteCodeFor.length() > 0 )&&( !siteCode.trim().equalsIgnoreCase(siteCodeFor)))
{ {
System.out.println("inside the if !siteCode.equals(siteCodeFor)"); // System.out.println("inside the if !siteCode.equals(siteCodeFor)");
System.out.println("inside the DB name"); //System.out.println("inside the DB name");
sql = "select misc_receipt.ref_no,misc_receipt.ref_date,misc_receipt.net_amt,misc_receipt.bank_code, " sql = "select misc_receipt.ref_no,misc_receipt.ref_date,misc_receipt.net_amt,misc_receipt.bank_code, "
+ " misc_receipt.rcp_mode,misc_receipt.curr_code, misc_receipt.exch_rate,misc_receipt.fin_entity," + " misc_receipt.rcp_mode,misc_receipt.curr_code, misc_receipt.exch_rate,misc_receipt.fin_entity,"
+ " misc_receipt.site_code,bank.bank_name,bank.acct_code__bc,bank.cctr_code__bc," + " misc_receipt.site_code,bank.bank_name,bank.acct_code__bc,bank.cctr_code__bc,"
...@@ -976,7 +1017,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -976,7 +1017,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
pstmt.setString(1,rcptcode); pstmt.setString(1,rcptcode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
System.out.println("inside the DB name next"); // System.out.println("inside the DB name next");
refNo = checkNull(rs.getString("ref_no")); refNo = checkNull(rs.getString("ref_no"));
refDate = rs.getTimestamp("ref_date"); refDate = rs.getTimestamp("ref_date");
netAmt = rs.getDouble("net_amt"); netAmt = rs.getDouble("net_amt");
...@@ -990,7 +1031,9 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -990,7 +1031,9 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
bankAccCodeBc = checkNull(rs.getString("acct_code__bc")); bankAccCodeBc = checkNull(rs.getString("acct_code__bc"));
bankcctrCodebc = checkNull(rs.getString("cctr_code__bc")); bankcctrCodebc = checkNull(rs.getString("cctr_code__bc"));
rcpSundryCode = checkNull(rs.getString("sundry_code__for")); rcpSundryCode = checkNull(rs.getString("sundry_code__for"));
//System.out.println("SUNDRY CODE FOR CUST CODE:"+rcpSundryCode);
fnSundryName = checkNull(rs.getString("sundry_name")); fnSundryName = checkNull(rs.getString("sundry_name"));
//System.out.println("SUNDRY name FOR CUST CODE:"+fnSundryName);
crTerm = checkNull(rs.getString("cr_term")); crTerm = checkNull(rs.getString("cr_term"));
siteDesr = checkNull(rs.getString("descr")); siteDesr = checkNull(rs.getString("descr"));
} }
...@@ -998,10 +1041,10 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -998,10 +1041,10 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println(" end of inside the DB name next"); //System.out.println(" end of inside the DB name next");
if (finEntity != null && finEntity.trim().length() > 0) if (finEntity != null && finEntity.trim().length() > 0)
{ {
System.out.println("ist ansi check for finEntity..if started"); //System.out.println("ist ansi check for finEntity..if started");
sql = "select curr_code from finent where FIN_ENTITY = ? "; sql = "select curr_code from finent where FIN_ENTITY = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity); pstmt.setString(1, finEntity);
...@@ -1018,7 +1061,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -1018,7 +1061,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
} }
else else
{ {
System.out.println("if started for ansi inside ansi in else"); //System.out.println("if started for ansi inside ansi in else");
sql="select misc_receipt.ref_no,misc_receipt.ref_date, " + sql="select misc_receipt.ref_no,misc_receipt.ref_date, " +
" misc_receipt.net_amt,misc_receipt.bank_code," + " misc_receipt.net_amt,misc_receipt.bank_code," +
" misc_receipt.rcp_mode,misc_receipt.curr_code," + " misc_receipt.rcp_mode,misc_receipt.curr_code," +
...@@ -1030,7 +1073,6 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -1030,7 +1073,6 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
" from misc_receipt, misc_rcpdet,bank,customer,site" + " from misc_receipt, misc_rcpdet,bank,customer,site" +
" where misc_receipt.tran_id = misc_rcpdet.tran_id and " + " where misc_receipt.tran_id = misc_rcpdet.tran_id and " +
" misc_receipt.bank_code = bank.bank_code and " + " misc_receipt.bank_code = bank.bank_code and " +
" misc_rcpdet.sundry_code = customer.cust_code (+) and " +
" misc_receipt.site_code = site.site_code and " + " misc_receipt.site_code = site.site_code and " +
" misc_receipt.tran_id = ? and " + " misc_receipt.tran_id = ? and " +
" misc_rcpdet.line_no = 1"; " misc_rcpdet.line_no = 1";
...@@ -1053,7 +1095,9 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -1053,7 +1095,9 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
bankAccCodeBc = checkNull(rs.getString("acct_code__bc")); bankAccCodeBc = checkNull(rs.getString("acct_code__bc"));
bankcctrCodebc = checkNull(rs.getString("cctr_code__bc")); bankcctrCodebc = checkNull(rs.getString("cctr_code__bc"));
rcpSundryCode = checkNull (rs.getString("sundry_code")); rcpSundryCode = checkNull (rs.getString("sundry_code"));
//System.out.println("sundtry code in receipt"+rcpSundryCode);
fnSundryName = checkNull(rs.getString("sundry_name")); fnSundryName = checkNull(rs.getString("sundry_name"));
//System.out.println("sundtry name in receipt"+fnSundryName);
crTerm = checkNull(rs.getString("cr_term")); crTerm = checkNull(rs.getString("cr_term"));
siteDesr = checkNull(rs.getString("descr")); siteDesr = checkNull(rs.getString("descr"));
} }
...@@ -1061,11 +1105,13 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -1061,11 +1105,13 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
//System.out.println("sundtry curr code in receipt"+currCode);
if( currentColumn.trim().equalsIgnoreCase( "fin_entity" ) ) if( currentColumn.trim().equalsIgnoreCase( "fin_entity" ) )
{ {
System.out.println("if for fin entity started in ansi inside ansi"); //System.out.println("if for fin entity started in ansi inside ansi"+finEntity);
finEntity = checkNull(genericUtility.getColumnValue("FIN_ENTITY", dom)); finEntity = checkNull(genericUtility.getColumnValue("FIN_ENTITY", dom));
System.out.println("finentity>>>>>>>>>>>>"+finEntity); // System.out.println("finentity>>>>>>>>>>>>"+finEntity);
sql = "select curr_code from finent where FIN_ENTITY = ?"; sql = "select curr_code from finent where FIN_ENTITY = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity); pstmt.setString(1, finEntity);
...@@ -1079,13 +1125,15 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -1079,13 +1125,15 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
// System.out.println("fin entity curr code in receipt"+currCode);
} }
if (finparamcrterm == null && finparamcrterm.trim().length() == 0) if (finparamcrterm == null && finparamcrterm.trim().length() == 0)
{ {
finparmCrTerm = crTerm; finparmCrTerm = crTerm;
} }
System.out.println(" aapend the value"); //System.out.println(" aapend the value");
valueXmlString.append("<ref_no>").append("<![CDATA[" + refNo + "]]>").append("</ref_no>"); valueXmlString.append("<ref_no>").append("<![CDATA[" + refNo + "]]>").append("</ref_no>");
if(refDate!=null) if(refDate!=null)
{ {
...@@ -1093,7 +1141,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -1093,7 +1141,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
} }
valueXmlString.append("<net_amt>").append("<![CDATA[" + netAmt + "]]>").append("</net_amt>"); valueXmlString.append("<net_amt>").append("<![CDATA[" + netAmt + "]]>").append("</net_amt>");
valueXmlString.append("<cust_code>").append("<![CDATA[" + rcpSundryCode + "]]>").append("</cust_code>"); valueXmlString.append("<cust_code>").append("<![CDATA[" + rcpSundryCode + "]]>").append("</cust_code>");
System.out.println("cust code"+custCode); // System.out.println(rcpSundryCode+" cust code"+fnSundryName+" sundry namae");
valueXmlString.append("<cust_name>").append("<![CDATA[" + fnSundryName + "]]>").append("</cust_name>"); valueXmlString.append("<cust_name>").append("<![CDATA[" + fnSundryName + "]]>").append("</cust_name>");
valueXmlString.append("<cr_term>").append("<![CDATA[" + crTerm + "]]>").append("</cr_term>"); valueXmlString.append("<cr_term>").append("<![CDATA[" + crTerm + "]]>").append("</cr_term>");
valueXmlString.append("<rcp_mode>").append("<![CDATA[" + rcpMode + "]]>").append("</rcp_mode>"); valueXmlString.append("<rcp_mode>").append("<![CDATA[" + rcpMode + "]]>").append("</rcp_mode>");
...@@ -1110,10 +1158,15 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -1110,10 +1158,15 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
valueXmlString.append("<cr_term>").append("<![CDATA[" + finparmCrTerm + "]]>").append("</cr_term>"); valueXmlString.append("<cr_term>").append("<![CDATA[" + finparmCrTerm + "]]>").append("</cr_term>");
valueXmlString.append("<cr_term__old>").append("<![CDATA[" + crTermOld + "]]>").append("</cr_term__old>"); valueXmlString.append("<cr_term__old>").append("<![CDATA[" + crTermOld + "]]>").append("</cr_term__old>");
valueXmlString.append("<crterm_descr>").append("<![CDATA[" + crTermDesr + "]]>").append("</crterm_descr>"); valueXmlString.append("<crterm_descr>").append("<![CDATA[" + crTermDesr + "]]>").append("</crterm_descr>");
valueXmlString.append("<curr_code__bc>").append("<![CDATA[" + currCodeBc + "]]>").append("</curr_code__bc>"); //commentde by monika 15 nov 2019 as value currcodebc is taking from receipt--= currcodebc
//valueXmlString.append("<curr_code__bc>").append("<![CDATA[" + currCodeBc + "]]>").append("</curr_code__bc>");
// System.out.println("currency code set in misc couch"+currCode);
valueXmlString.append("<curr_code__bc>").append("<![CDATA[" + currCode + "]]>").append("</curr_code__bc>");
valueXmlString.append("<acct_code__bc>").append("<![CDATA[" + bankAccCodeBc + "]]>").append("</acct_code__bc>"); valueXmlString.append("<acct_code__bc>").append("<![CDATA[" + bankAccCodeBc + "]]>").append("</acct_code__bc>");
valueXmlString.append("<cctr_code__bc>").append("<![CDATA[" + bankcctrCodebc + "]]>").append("</cctr_code__bc>"); valueXmlString.append("<cctr_code__bc>").append("<![CDATA[" + bankcctrCodebc + "]]>").append("</cctr_code__bc>");
setNodeValue(dom, "curr_code__bc", currCodeBc); // setNodeValue(dom, "curr_code__bc", currCodeBc);
setNodeValue(dom, "curr_code__bc", currCode);
reStr = itemChanged(dom, dom1, objContext, "curr_code__bc", editFlag, xtraParams); reStr = itemChanged(dom, dom1, objContext, "curr_code__bc", editFlag, xtraParams);
pos = reStr.indexOf("<Detail1>"); pos = reStr.indexOf("<Detail1>");
reStr = reStr.substring(pos + 9); reStr = reStr.substring(pos + 9);
...@@ -1127,7 +1180,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -1127,7 +1180,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
else if ("curr_code__bc".equalsIgnoreCase(currentColumn.trim())) else if ("curr_code__bc".equalsIgnoreCase(currentColumn.trim()))
{ {
currCodeBc = checkNull(genericUtility.getColumnValue("curr_code__bc", dom)); currCodeBc = checkNull(genericUtility.getColumnValue("curr_code__bc", dom));
System.out.println("curr_code__bc" + currCodeBc); // System.out.println("curr_code__bc in item change" + currCodeBc);
sql = "select std_exrt from currency where curr_code = ?"; sql = "select std_exrt from currency where curr_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currCodeBc); pstmt.setString(1, currCodeBc);
...@@ -1136,11 +1189,13 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour ...@@ -1136,11 +1189,13 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
{ {
stdExrted = checkNull(rs.getString("std_exrt")); stdExrted = checkNull(rs.getString("std_exrt"));
} }
// System.out.println("std exch_rate" + stdExrted);
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
valueXmlString.append("<exch_rate>").append("<![CDATA[" + stdExrted + "]]>").append("</exch_rate>"); // valueXmlString.append("<exch_rate>").append("<![CDATA[" + stdExrted + "]]>").append("</exch_rate>");
finEntity = checkNull(genericUtility.getColumnValue("fin_entity", dom)); finEntity = checkNull(genericUtility.getColumnValue("fin_entity", dom));
sql = "select curr_code from finent where fin_entity = ?"; sql = "select curr_code from finent where fin_entity = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
......
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