Commit b95c3627 authored by msalla's avatar msalla

In Bank receipt if user adds the charges in 4th screen and keep the flag...

In Bank receipt if user adds the charges in 4th screen and keep the flag effect to Y then accounting effect is not posting properly

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@207438 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e9747b4d
...@@ -84,7 +84,7 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa ...@@ -84,7 +84,7 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa
try try
{ {
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
// GenericUtility genericUtility = GenericUtility.getInstance(); // GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
dom = genericUtility.parseString(domString); dom = genericUtility.parseString(domString);
...@@ -309,7 +309,9 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa ...@@ -309,7 +309,9 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa
//sql="select chq_amt - ((case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end) + tax_amt) from receipt WHERE tran_id = ? " ; //sql="select chq_amt - ((case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end) + tax_amt) from receipt WHERE tran_id = ? " ;
//changes done-monika-26-july-2019-as tax_amt is already added //changes done-monika-26-july-2019-as tax_amt is already added
sql="select chq_amt - ((case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end)) from receipt WHERE tran_id = ? " ; // sql="select chq_amt - ((case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end)) from receipt WHERE tran_id = ? " ;
//CHANGES BY MONIKA 14 SEPT 2019 for accounting effect
sql="select chq_amt -((case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when fin_chg is null then 0 else fin_chg end)) from receipt WHERE tran_id = ? " ;
//end //end
//sql="select chq_amt - ((case when bill_amt is null then 0 else bill_amt end) + (case when advadj_amt is null then 0 else advadj_amt end) + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end) + tax_amt) from receipt WHERE tran_id = ? " ; //Added advadjamtount in formulla by manoj dtd 27/06/2016 //sql="select chq_amt - ((case when bill_amt is null then 0 else bill_amt end) + (case when advadj_amt is null then 0 else advadj_amt end) + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end) + tax_amt) from receipt WHERE tran_id = ? " ; //Added advadjamtount in formulla by manoj dtd 27/06/2016
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -340,16 +342,15 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa ...@@ -340,16 +342,15 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa
} }
// end 29/05/14 manoharan // end 29/05/14 manoharan
// 30/06/14 manoharan not to deduct dbamt // 30/06/14 manoharan not to deduct dbamt
//Changes and Commented by Ajay on 23/01/2018:START //Changes and Commented by Ajay on 23/01/2018:START
//Changes and Commented-monika-26-july-2019 //Changes and Commented-monika-26-july-2019
//sql="UPDATE receipt SET adv_amt = chq_amt - ((case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end)+ tax_amt) WHERE tran_id= ? " ; //sql="UPDATE receipt SET adv_amt = chq_amt - ((case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end)+ tax_amt) WHERE tran_id= ? " ;
//changes done-monika s-26-july-2019-as tax_amt is already added //changes done-monika s-26-july-2019-as tax_amt is already added
sql="UPDATE receipt SET adv_amt = chq_amt - ((case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end)) WHERE tran_id= ? " ; //sql="UPDATE receipt SET adv_amt = chq_amt - ((case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? - (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end)) WHERE tran_id= ? " ;
//changes done-Monika s-14-sept-2019- for account effect
sql="UPDATE receipt SET adv_amt = chq_amt - ((case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when fin_chg is null then 0 else fin_chg end)) WHERE tran_id= ? " ;
//end //end
//sql="UPDATE receipt SET adv_amt = chq_amt - ((case when bill_amt is null then 0 else bill_amt end) +(case when advadj_amt is null then 0 else advadj_amt end) + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end) + tax_amt) WHERE tran_id = ? " ;//Added advadjamtount in formulla by manoj dtd 27/06/2016
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,bdAmt ); pstmt.setDouble(1,bdAmt );
...@@ -371,6 +372,9 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa ...@@ -371,6 +372,9 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa
diffAmtExchTotal = diffAmtExchDet + diffAmtExchAdv + diffAmtExchEpc; diffAmtExchTotal = diffAmtExchDet + diffAmtExchAdv + diffAmtExchEpc;
sql="select ((case when adv_amt is null then 0 else adv_amt end)+ (case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end) + tax_amt) net_amt from receipt WHERE tran_id = ? " ; sql="select ((case when adv_amt is null then 0 else adv_amt end)+ (case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end) + tax_amt) net_amt from receipt WHERE tran_id = ? " ;
//sql="select ((case when adv_amt is null then 0 else adv_amt end)+ (case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end) + tax_amt) net_amt from receipt WHERE tran_id = ? " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setDouble(1,bdAmt ); //pstmt.setDouble(1,bdAmt );
...@@ -384,9 +388,10 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa ...@@ -384,9 +388,10 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
//System.out.println("netAMOUNT ["+netAmt+"]" );
netAmt = netAmt - bdAmt; netAmt = netAmt - bdAmt;
netAmtBc = netAmt * exchRateHdr; netAmtBc = netAmt * exchRateHdr;
//System.out.println("netAMOUNT ["+netAmt+"] netAMOUNT ["+netAmtBc +"]");
/* /*
sql="UPDATE receipt SET DIFF_AMT__EXCH = ? + ? + ?, net_amt = ((case when adv_amt is null then 0 else adv_amt end)+ (case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end) + tax_amt) , " sql="UPDATE receipt SET DIFF_AMT__EXCH = ? + ? + ?, net_amt = ((case when adv_amt is null then 0 else adv_amt end)+ (case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end) - ? + (case when oth_amt is null then 0 else oth_amt end) + (case when fin_chg is null then 0 else fin_chg end) + tax_amt) , "
......
...@@ -424,7 +424,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo ...@@ -424,7 +424,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
double amtRev = 0.0; double amtRev = 0.0;
double badAmt = 0.0; double badAmt = 0.0;
double totBc = 0.0,taxAmt=0.0; double totBc = 0.0,taxAmt=0.0;
double chq = 0.0; double chq = 0.0,othAmt=0.0;
int i = 0; int i = 0;
int cnt = 0 ; int cnt = 0 ;
int maxline = 0; int maxline = 0;
...@@ -2076,7 +2076,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo ...@@ -2076,7 +2076,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
//changes made-by-monika-30-may-2019 //changes made-by-monika-30-may-2019
chq = ((double) Double.parseDouble( "" + RcpHdrMap.get("chq_amt")) ); chq = ((double) Double.parseDouble( "" + RcpHdrMap.get("chq_amt")) );
//end //end
//addded by monika-27 july-2019 //addded by monika-27 july-2019 for tax amt
taxAmt=((double) Double.parseDouble( "" + RcpHdrMap.get("tax_amt")) ); taxAmt=((double) Double.parseDouble( "" + RcpHdrMap.get("tax_amt")) );
//end //end
// if EPC adjusted in same currency then // if EPC adjusted in same currency then
...@@ -2092,7 +2092,11 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo ...@@ -2092,7 +2092,11 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
//if(Math.abs(chq - total) > 1) //if(Math.abs(chq - total) > 1)
//changes by monika-27 july-2019 //changes by monika-27 july-2019
System.out.println("chq and ["+chq+"] total ["+total + "] diff [" + Math.abs(chq - (total -taxAmt) ) +"]"); System.out.println("chq and ["+chq+"] total ["+total + "] diff [" + Math.abs(chq - (total -taxAmt) ) +"]");
if(Math.abs(chq - (total - taxAmt)) > 1)//end //if(Math.abs(chq - (total - taxAmt)) > 1)
//added by monika on 14 sept 2019 for accounting effect--
othAmt=((double) Double.parseDouble( "" + RcpHdrMap.get("oth_amt")));
// System.out.println("chq and ["+chq+"] total ["+total + "] other_amount ]"+othAmt+" ] diff [" + Math.abs(chq - (total -taxAmt)+othAmt ) +"]");
if(Math.abs(chq - (total - taxAmt)+othAmt) > 1)//end
{ {
errString = itmDBAccessEJB.getErrorString("","VTRCPT8","","",conn); errString = itmDBAccessEJB.getErrorString("","VTRCPT8","","",conn);
conn.rollback(); conn.rollback();
......
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