Commit 5995b3a8 authored by msalla's avatar msalla

We created bank receipt and mention the contract number in header. But When...

We created bank receipt and mention the contract number in header. But When bank receipt is confirmed then balance amount of advance booking is not updating. 4) system should not allow to use advance booking if balance is not available 5) receipt dishnor is created for receipt where advance booking is used then amount used in receipt needs to be reversed from balance amount.(ponit no 610)

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@211879 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 76a2e7f3
......@@ -187,9 +187,9 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
Timestamp tranDt = null;
double rcpacctAmtdbl=0;
//Calendar currentDate = Calendar.getInstance();--by monika
//ADDED BY MONIKA 30 SEPT 2019
//ADDED BY MONIKA 30 SEPT 2019
String itemValue = "",lineNo = "",lineValue= "",updateFlag = "", invTrace = " ",rcpAdvBkingamount="";
String itemValue = "",lineNo = "",lineValue= "",updateFlag = "", invTrace = " ",rcppcreditamount="",rcpAdvBkingamount="";
int lineNoInt = 0,lineValueInt = 0;
//NodeList itemNodeList = null,lineNoList = null,detail2List = null,childDetilList = null;
......@@ -197,7 +197,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
NodeList itemNodeList = null,lineNoList = null,detail2List = null,childDetilList = null; //Variables added by Mahesh Saggam on 17-June-2019
Node itemNode = null,lineNoNode = null,detailNode = null,chidDetailNode = null; //Variables added by Mahesh Saggam on 17-June-2019
double rcpAdvBkingAmt=0.0,totAmtdet=0.0,diffvalue=0.0;//END
double rcpAdvBkingAmt=0.0,totAmtdet=0.0,diffvalue=0.0,rcpPkCreditAmt=0.0;//END
try
{
finCommon = new FinCommon();
......@@ -1842,6 +1842,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
valueXmlString.append("</Detail3>");
break;
case 4:
totAmtdet=0.0;
parentNodeList = dom.getElementsByTagName("Detail4");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
......@@ -2036,7 +2037,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{
amountBc = doublevalue(this.genericUtility.getColumnValue("amount__bc", dom));
amountBc = (amountBc+doublevalue(this.genericUtility.getColumnValue("diff_amt__exch", dom)));
chequeAmt = doublevalue(this.genericUtility.getColumnValue("cheque_amt", dom1));
chequeAmt = doublevalue(this.genericUtility.getColumnValue("cheque_amt", dom1));// commented by monika 12 nov
exchRate = doublevalue(this.genericUtility.getColumnValue("exch_rate", dom1));
if (chequeAmt == 10.0D)
{
......@@ -2047,7 +2048,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
exchRate = 1.0D;
}
chequeAmt *= exchRate;
for (crt = 1; crt <= parentNodeList.getLength(); crt++)
/*for (crt = 1; crt <= parentNodeList.getLength(); crt++)//ccommented by monika 12 nov19
{
amountBc += Math.abs(doublevalue(this.genericUtility.getColumnValue("amount__bc", dom)));
amountBc += doublevalue(this.genericUtility.getColumnValue("diff_amt__exch", dom));
......@@ -2058,13 +2059,62 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
amountBc += Math.abs(doublevalue(this.genericUtility.getColumnValue("amount__bc", dom)));
amountBc += doublevalue(this.genericUtility.getColumnValue("diff_amt__exch", dom));
}
if (chequeAmt - amountBc >= 0.0D)
*///added by monika 12 nov 2019
detail2List = dom2.getElementsByTagName("Detail4");
for(int t =0; t < detail2List.getLength(); t++ )
{
detailNode = detail2List.item(t);
childDetilList = detailNode.getChildNodes();
for(int p =0; p < childDetilList.getLength(); p++ )
{
chidDetailNode = childDetilList.item(p);
if(chidDetailNode.getNodeName().equalsIgnoreCase("attribute") )
{
//System.out.println("operation node found >>>>>" + chidDetailNode.getNodeName());
updateFlag = chidDetailNode.getAttributes().getNamedItem("updateFlag").getNodeValue();
// System.out.println("Update flag is......."+updateFlag);
}
if(chidDetailNode.getNodeName().equalsIgnoreCase("amount") )
{
//System.out.println("invoiceTrace node found >>>>>" + chidDetailNode.getNodeName());
if(chidDetailNode.getFirstChild() != null )
{
rcppcreditamount = chidDetailNode.getFirstChild().getNodeValue();
System.out.println("child rcpadvbking >>>>>" + rcppcreditamount);
if(rcppcreditamount != null && rcppcreditamount.trim().length() > 0)
{
rcpPkCreditAmt = Double.parseDouble(rcppcreditamount.trim());
}
else
{
rcpPkCreditAmt=0.0;
}
System.out.println("total rcpadvbking >>>>>" + rcpPkCreditAmt);
if(!updateFlag.equalsIgnoreCase("D"))
{
totAmtdet=totAmtdet+rcpPkCreditAmt;
}
System.out.println("total rcpadvbking >>>>>" + totAmtdet+" cheque amount--"+chequeAmt);
}
}
}
}
// if (chequeAmt - amountBc < 0.0D)
if (chequeAmt - totAmtdet < 0.0D)//end
continue;
errCode = "VTAMT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
......@@ -2235,6 +2285,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
break;
//added by monika-29-july-2019
case 6:
totAmtdet=0.0;
parentNodeList = dom.getElementsByTagName("Detail6");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
......@@ -2319,7 +2370,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
}
// System.out.println("diffvalue:::]]]"+balAmt+" CHEQUE AMOUNT:::]]]"+chequeAmt+" TOTAMT]]]]"+totAmtdet);
System.out.println("diffvalue:::]]]"+balAmt+" CHEQUE AMOUNT:::]]]"+chequeAmt+" TOTAMT]]]]"+totAmtdet);
rs.close();
......@@ -2340,7 +2391,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{
Amt = 0.0;
}
// System.out.println("amount is amount:::"+Amt);
System.out.println("amount is amount:::"+Amt);
rs.close();
rs = null;
pstmt.close();
......@@ -2358,8 +2409,13 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{
amountBc = doublevalue(this.genericUtility.getColumnValue("amount__bc", dom));
System.out.println("From dom amount Bc---->"+amountBc);
amountBc = (amountBc+doublevalue(this.genericUtility.getColumnValue("diff_amt__exch", dom)));
System.out.println("From difference exchrate amount Bc-->"+amountBc);
chaqueAmtStr = this.genericUtility.getColumnValue("cheque_amt", dom1);
exchRate = doublevalue(this.genericUtility.getColumnValue("exch_rate", dom1));
if(chaqueAmtStr != null && chaqueAmtStr.trim().length()>0)
{
......@@ -2377,33 +2433,85 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
chequeAmt = chequeAmt * exchRate;
}
for (crt = 1; crt <= parentNodeList.getLength(); crt++)
/*commented by monka 12 nov
* for (crt = 1; crt <= parentNodeList.getLength(); crt++)
{
amountBc += Math.abs(doublevalue(this.genericUtility.getColumnValue("amount__bc", dom)));
System.out.println("in For loop before adding exchrate-->"+amountBc);
amountBc += doublevalue(this.genericUtility.getColumnValue("diff_amt__exch", dom));
System.out.println("in For loop after adding exchrate-->"+amountBc);
}
System.out.println("outer for loop before adding exchrate-->"+amountBc);
if (crt > 0)
{
amountBc += Math.abs(doublevalue(this.genericUtility.getColumnValue("amount__bc", dom)));
System.out.println("in if loop before adding exchrate-->"+amountBc);
amountBc += doublevalue(this.genericUtility.getColumnValue("diff_amt__exch", dom));
System.out.println("in if loop before adding exchrate-->"+amountBc);
}
/*if (chequeAmt - amountBc < 0.0D)
System.out.println("outer if loop before adding exchrate-->"+amountBc);
*/
/* if (chequeAmt - amountBc < 0.0D)
{
errCode = "VTAMT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
//added by monika 12 nov 2019
detail2List = dom2.getElementsByTagName("Detail6");
for(int t =0; t < detail2List.getLength(); t++ )
{
detailNode = detail2List.item(t);
childDetilList = detailNode.getChildNodes();
for(int p =0; p < childDetilList.getLength(); p++ )
{
chidDetailNode = childDetilList.item(p);
if(chidDetailNode.getNodeName().equalsIgnoreCase("attribute") )
{
//System.out.println("operation node found >>>>>" + chidDetailNode.getNodeName());
updateFlag = chidDetailNode.getAttributes().getNamedItem("updateFlag").getNodeValue();
// System.out.println("Update flag is......."+updateFlag);
}
if (chequeAmt - amountBc < 0.0D)
if(chidDetailNode.getNodeName().equalsIgnoreCase("amount") )
{
//System.out.println("invoiceTrace node found >>>>>" + chidDetailNode.getNodeName());
if(chidDetailNode.getFirstChild() != null )
{
rcpAdvBkingamount = chidDetailNode.getFirstChild().getNodeValue();
System.out.println("child rcpadvbking >>>>>" + rcpAdvBkingamount);
if(rcpAdvBkingamount != null && rcpAdvBkingamount.trim().length() > 0)
{
rcpAdvBkingAmt = Double.parseDouble(rcpAdvBkingamount.trim());
}
else
{
rcpAdvBkingAmt=0.0;
}
if(!updateFlag.equalsIgnoreCase("D"))
{
totAmtdet=totAmtdet+rcpAdvBkingAmt;
}
System.out.println("total rcpadvbking >>>>>" + totAmtdet);
}
}
}
}
//if (chequeAmt - amountBc < 0.0D)
if(chequeAmt - totAmtdet < 0.0D)//end
{
errCode = "VTAMT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
......
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