Commit 2cd9cf25 authored by arane's avatar arane

Issue regarding Receipt Dishonour

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@216586 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5b714a6a
......@@ -141,10 +141,10 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
//System.out.println("inside try currcolumn val["+childNodeName+"]");
System.out.println("inside try currcolumn val["+childNodeName+"]");
if (childNodeName.equalsIgnoreCase("cust_code"))
{
//System.out.println("cust_code wfValData");
System.out.println("cust_code wfValData");
custCode = this.genericUtility.getColumnValue("cust_code", dom);
// System.out.println("cust_code in validation"+custCode);
tranSeries = this.genericUtility.getColumnValue("tran_ser", dom);
......@@ -781,9 +781,12 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
String bankAccCodeBc="", bankcctrCodebc=" ";
String customerCustName, finparamcrterm, receiptNo;
String sql = null, rcptcode;
String remarkTakenFrom="";//Added by Anagha Rane 20-01-2020
String varName = "", varValue= "";
String crLimitVarName = "", crLimitVarValue = "";
try
{
//System.out.println("inside the try itemChanged block"+currentColumn);
System.out.println("inside the try itemChanged block"+currentColumn);
dateFormat1 = new SimpleDateFormat(genericUtility.getApplDateFormat());
conn = getConnection();
conn.setAutoCommit(false);
......@@ -813,7 +816,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
rcpMode = genericUtility.getColumnValue("rcp_mode_t", dom);
//System.out.println("first receipt mode ------>" + rcpMode);
System.out.println("first receipt mode ------>" + rcpMode);
do
{
childNode = childNodeList.item(ctr);
......@@ -844,7 +847,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
}
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));
sql = "select cust_name from customer where cust_code = ?";
......@@ -870,16 +873,16 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
}
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);
System.out.println("finparmcrterm>>>>"+finparamcrterm);//Added by Anagha Rane 17-01-2020
tranSer = checkNull(genericUtility.getColumnValue("tran_ser", dom));
if ("R".equalsIgnoreCase(tranSer))
{
//System.out.println("inside the if R Receipt number and tran series itmchange"+tranSer);
System.out.println("inside the if R Receipt number and tran series itmchange"+tranSer);
rcptcode = genericUtility.getColumnValue("receipt_no", dom);
//System.out.println("inside the if R Receipt number and tran series itmchange"+rcptcode);
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, "
+ " receipt.bank_code,receipt.site_code,receipt.fin_entity,receipt.curr_code,receipt.rcp_mode,receipt.acct_code__cf, "
......@@ -896,21 +899,21 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
if (rs.next())
{
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"));
refDate = rs.getTimestamp("ref_date");
//System.out.println("ref_date::::>>"+refDate);
System.out.println("ref_date::::>>"+refDate);
netAmt = rs.getDouble("net_amt");
advAmt = rs.getDouble("adv_amt");
billAmt = rs.getInt("bill_amt");
bankCode = checkNull(rs.getString("bank_code"));
siteCode = checkNull(rs.getString("site_code"));
finEntity = checkNull(rs.getString("fin_entity"));
//System.out.println("curr code in dishrnr"+finEntity);
System.out.println("curr code in dishrnr"+finEntity);
currCode = checkNull(rs.getString("curr_code"));
//System.out.println("curr code in dishrnr"+currCode);
System.out.println("curr code in dishrnr"+currCode);
rcpMode = checkNull(rs.getString("rcp_mode"));
accCodeCf = checkNull(rs.getString("acct_code__cf"));
......@@ -930,7 +933,6 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
rs = null;
pstmt.close();
pstmt = null;
String remarkTakenFrom="";//Added by Anagha Rane 20-01-2020
if ("NULLFOUND".equalsIgnoreCase(finparamcrterm) || finparamcrterm == null)
{
......@@ -940,13 +942,18 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
//valueXmlString.append("<cr_term>").append("<![CDATA[" + finparmCrTerm + "]]>").append("</cr_term>");
valueXmlString.append("<cr_term>").append("<![CDATA[" + finparamcrterm + "]]>").append("</cr_term>");//Changed by Anagha Rane 20-01-2020 defining correct variable
remarkTakenFrom="customer";//Changed by Anagha Rane 20-01-2020
varName= "";
varValue= finparamcrterm;
}else{
remarkTakenFrom="finparm";//Changed by Anagha Rane 20-01-2020
varName= "DISHONOUR_CR_TERM";
varValue= finparamcrterm;
}
//System.out.println("inside the if finparamcrterm"+crTerm);
System.out.println("inside the if finparamcrterm"+crTerm);
System.out.println("inside the if finparamcrterm"+finparamcrterm);
//System.out.println("custCode----------->>>>>>>>>>>>>"+custCode);
System.out.println("custCode----------->>>>>>>>>>>>>"+custCode);
sql = "select descr from crterm where cr_term = ?";
pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, crTerm);
......@@ -969,6 +976,11 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
{
creditLimit = Double.parseDouble(ls_cr_limit);
crLimitTakenFrom="Finparm";//Changed by Anagha Rane 20-01-2020
crLimitVarName ="CR_LIMIT_ON_DISHNR";
crLimitVarValue = ls_cr_limit;
}else{
crLimitVarName ="";
crLimitVarValue = ls_cr_limit;
}
System.out.println("creditlimit>>>>"+creditLimit);
String tname="",colName="",sundryType="C";
......@@ -1016,7 +1028,8 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
}
//end of the code added by ajit on date 22-may-2017
String remarks1 = "Credit term (" + finparamcrterm + " ) is taken from "+remarkTakenFrom+" and Credit limit (" + ls_cr_limit + ") is taken from " + tname;//Changed by Anagha Rane 17-01-2020
String remarks1 = "Credit term (" + finparamcrterm + " ) is taken from "+remarkTakenFrom+" where var_value is ["+varValue+"] & var_name is ["+varName+"] "
+ "\n and Credit limit (" + ls_cr_limit + ") is taken from finparm where var_value is ["+crLimitVarValue+"] & var_name is ["+crLimitVarName+"]" ;//Changed by Anagha Rane 17-01-2020
System.out.println("remarks: "+remarks1);//Changed by Anagha Rane 17-01-2020
//Added by Anagha Rane 17-01-2020 End
......@@ -1056,7 +1069,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
valueXmlString.append("<cr_term>").append("<![CDATA[" + finparamcrterm + "]]>").append("</cr_term>");
valueXmlString.append("<cr_term__remark>").append("<![CDATA[" + remarks1 + "]]>").append("</cr_term__remark>");//Added by Anagha Rane 17-01-2020
System.out.println("crterm in xml"+finparamcrterm);
System.out.println("crterm in xml"+remarks1);
//valueXmlString.append("<cr_term__old>").append("<![CDATA[" + crTermOld + "]]>").append("</cr_term__old>");
valueXmlString.append("<cr_term__old>").append("<![CDATA[" + crTerm + "]]>").append("</cr_term__old>");
System.out.println("crterm in old xml"+crTerm);
......@@ -1098,14 +1111,14 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
}//end of receipt
else
{
//System.out.println("inside the else receipt_no");
System.out.println("inside the else receipt_no");
rcptcode = genericUtility.getColumnValue("receipt_no", dom);
// System.out.println(" receipt_no"+rcpNo);
// System.out.println("recp length = "+ rcpNo.trim().length());
if(rcptcode!=null)
{
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.setString(1, rcptcode);
rs = pstmt.executeQuery();
......@@ -1123,7 +1136,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
if((siteCodeFor!=null && siteCodeFor.length() > 0 )&&( !siteCode.trim().equalsIgnoreCase(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, "
+ " 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,"
......@@ -1153,9 +1166,9 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
bankAccCodeBc = checkNull(rs.getString("acct_code__bc"));
bankcctrCodebc = checkNull(rs.getString("cctr_code__bc"));
rcpSundryCode = checkNull(rs.getString("sundry_code__for"));
//System.out.println("SUNDRY CODE FOR CUST CODE:"+rcpSundryCode);
System.out.println("SUNDRY CODE FOR CUST CODE:"+rcpSundryCode);
fnSundryName = checkNull(rs.getString("sundry_name"));
//System.out.println("SUNDRY name FOR CUST CODE:"+fnSundryName);
System.out.println("SUNDRY name FOR CUST CODE:"+fnSundryName);
crTerm = checkNull(rs.getString("cr_term"));
siteDesr = checkNull(rs.getString("descr"));
}
......@@ -1163,10 +1176,10 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
rs = null;
pstmt.close();
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)
{
//System.out.println("ist ansi check for finEntity..if started");
System.out.println("ist ansi check for finEntity..if started");
sql = "select curr_code,descr from finent where FIN_ENTITY = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
......@@ -1185,7 +1198,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
}
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, " +
" misc_receipt.net_amt,misc_receipt.bank_code," +
" misc_receipt.rcp_mode,misc_receipt.curr_code," +
......@@ -1219,9 +1232,9 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
bankAccCodeBc = checkNull(rs.getString("acct_code__bc"));
bankcctrCodebc = checkNull(rs.getString("cctr_code__bc"));
rcpSundryCode = checkNull (rs.getString("sundry_code"));
//System.out.println("sundtry code in receipt"+rcpSundryCode);
System.out.println("sundtry code in receipt"+rcpSundryCode);
fnSundryName = checkNull(rs.getString("sundry_name"));
//System.out.println("sundtry name in receipt"+fnSundryName);
System.out.println("sundtry name in receipt"+fnSundryName);
crTerm = checkNull(rs.getString("cr_term"));
siteDesr = checkNull(rs.getString("descr"));
}
......@@ -1229,11 +1242,11 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
rs = null;
pstmt.close();
pstmt = null;
//System.out.println("sundtry curr code in receipt"+currCode);
System.out.println("sundtry curr code in receipt"+currCode);
if( currentColumn.trim().equalsIgnoreCase( "fin_entity" ) )
{
//System.out.println("if for fin entity started in ansi inside ansi"+finEntity);
System.out.println("if for fin entity started in ansi inside ansi"+finEntity);
finEntity = checkNull(genericUtility.getColumnValue("FIN_ENTITY", dom));
// System.out.println("finentity>>>>>>>>>>>>"+finEntity);
sql = "select curr_code,descr from finent where FIN_ENTITY = ?";
......@@ -1259,7 +1272,7 @@ public class ReceiptDishonourIC extends ValidatorEJB implements ReceiptDishonour
finparmCrTerm = crTerm;
}
//System.out.println(" aapend the value");
System.out.println(" aapend the value");
valueXmlString.append("<ref_no>").append("<![CDATA[" + refNo + "]]>").append("</ref_no>");
if(refDate!=null)
{
......
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