Commit ce159f34 authored by msalla's avatar msalla

Gimatex: Bill discounting net amount BC.

point: the sum of all amount in account detail screen is not matching with net amount bc field of header.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@213590 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 11c3bc74
...@@ -63,7 +63,7 @@ public class BillDiscountingPostSave extends ValidatorEJB implements BillDiscou ...@@ -63,7 +63,7 @@ public class BillDiscountingPostSave extends ValidatorEJB implements BillDiscou
String acctFins = ""; String acctFins = "";
double amtdet=0,amtBcDet=0,totnetAmtBc=0,amtBc=0,amountBchdr=0,totnetAmt=0,amountbcDet=0,amtHdr=0,netAmtdet=0,amtdetepc=0,amountBC=0,netAmtBcdet=0,exchrateIntHdr=0,amountBcdet=0, intAmtdet=0,exchrateIntdet=0,diffAmtExchDet = 0, diffAmtExchAdv = 0, diffAmtExchEpc = 0, newAdvAmt = 0,epcAdjAmount=0; double amtdet=0,amtBcDet=0,totnetAmtBc=0,amtBc=0,amountBchdr=0,totnetAmt=0,amountbcDet=0,amtHdr=0,netAmtdet=0,amtdetepc=0,amountBC=0,netAmtBcdet=0,exchrateIntHdr=0,amountBcdet=0, intAmtdet=0,exchrateIntdet=0,diffAmtExchDet = 0, diffAmtExchAdv = 0, diffAmtExchEpc = 0, newAdvAmt = 0,epcAdjAmount=0;
double billAmtDet = 0,totAmtBc=0,amthdrepc=0,netAmtBcHdr=0,netAmtBcEpcdet=0,intAmtHdr=0, advAmtHdr = 0, adjAmtAdv = 0, bdAmt =0, advAmtRact = 0, othAmt = 0.0,exchRateHdr = 0.0, taxAmt = 0,amount = 0.0,othAmttemp =0.0; double billAmtDet = 0,totAmtBc=0,amthdrepc=0,netAmtBcHdr=0,netAmtBcEpcdet=0,intAmtHdr=0, advAmtHdr = 0, adjAmtAdv = 0, bdAmt =0, advAmtRact = 0, othAmt = 0.0,exchRateHdr = 0.0, taxAmt = 0,amount = 0.0,othAmttemp =0.0;
double amtBcEpcdet=0,amtepcdet=0,diffexchepcdet=0,netAmtDet=0,totamtbc=0; double amtBcEpcdet=0,intNetAMt=0,amtepcdet=0,diffexchepcdet=0,netAmtDet=0,totamtbc=0 ,totamountBcdet=0,totamtAcctBc=0;
double amtAcct=0,netamountBcdet=0,exchrateAcct=0,netAmtAcct=0,cnt=0,totNetAmt=0,totNetAmtBc=0,amtdetbd=0; double amtAcct=0,netamountBcdet=0,exchrateAcct=0,netAmtAcct=0,cnt=0,totNetAmt=0,totNetAmtBc=0,amtdetbd=0;
FinCommon finCommon = null; FinCommon finCommon = null;
...@@ -118,19 +118,20 @@ public class BillDiscountingPostSave extends ValidatorEJB implements BillDiscou ...@@ -118,19 +118,20 @@ public class BillDiscountingPostSave extends ValidatorEJB implements BillDiscou
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
intNetAMt=amtdet-intAmtdet;//added on 16 dec 19--monika-to set int_rest difference
amountBcdet=amtdet*exchRateHdr; //System.out.println( "amount with exchrate ["+intNetAMt+"]");
totamountBcdet=intNetAMt*exchRateHdr;
sql="update export_fundet set amount__bc=? where tran_id=? " ;//end sql="update export_fundet set amount__bc=? where tran_id=? " ;//end
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,amountBcdet ); pstmt.setDouble(1,totamountBcdet );
pstmt.setString(2,tranId ); pstmt.setString(2,tranId );
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
//System.out.println("amount bc det["+amountBcdet); //System.out.println("amount bc det["+totamountBcdet);
//select from export_fundadj //select from export_fundadj
sql="select sum(amount__bc),sum(amount),sum(diff_amt__exch) from export_fundadj where tran_id = ? "; sql="select sum(amount__bc),sum(amount),sum(diff_amt__exch) from export_fundadj where tran_id = ? ";
...@@ -152,7 +153,8 @@ public class BillDiscountingPostSave extends ValidatorEJB implements BillDiscou ...@@ -152,7 +153,8 @@ public class BillDiscountingPostSave extends ValidatorEJB implements BillDiscou
pstmt = null; pstmt = null;
//update //update
sql="update export_fundet set amount__bc=? where tran_id=? " ;//end // sql="update export_fundet set amount__bc=? where tran_id=? " ;//end wrong update in det
sql="update export_fundadj set amount__bc=? where tran_id=? " ;//end
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,amtBcEpcdet ); pstmt.setDouble(1,amtBcEpcdet );
pstmt.setString(2,tranId ); pstmt.setString(2,tranId );
...@@ -160,30 +162,32 @@ public class BillDiscountingPostSave extends ValidatorEJB implements BillDiscou ...@@ -160,30 +162,32 @@ public class BillDiscountingPostSave extends ValidatorEJB implements BillDiscou
//System.out.println("amount bc det["+amtBcEpcdet); //System.out.println("amount bc det["+amtBcEpcdet);
//select from export_fundacct //select from export_fundacct
sql="select (amount),exch_rate from export_fundacct where tran_id=?"; // sql="select (amount),exch_rate from export_fundacct where tran_id=?";
sql="select sum(amount*exch_rate)as amount from export_fundacct where tran_id=?";//added to be find total acct detail 16 dec 2019
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId); pstmt.setString(1,tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
amtAcct = rs.getDouble("amount"); totamtAcctBc = rs.getDouble("amount");
exchrateAcct= rs.getDouble("exch_rate");
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
// totamtAcctBc=amtAcct*exchrateAcct;
//System.out.println("total amount bc in account"+totamtAcctBc);
//UPDATE EXPORT _FUND //UPDATE EXPORT _FUND
// System.out.println(" totNetAmtBc det--"+amountBcdet+(amtBcEpcdet)+amtAcct+"WITH INT---["+amountBcdet+(amtBcEpcdet)+amtAcct+intAmtdet+"WITH-VE EPC--["+amountBcdet+(amtBcEpcdet)+amtAcct+intAmtdet); //System.out.println(" totNetAmtBc det--"+amountBcdet+(amtBcEpcdet)+amtAcct+"WITH INT---["+amountBcdet+(amtBcEpcdet)+amtAcct+intAmtdet+"WITH-VE EPC--["+amountBcdet+(amtBcEpcdet)+amtAcct+intAmtdet);
// netAmtDet=amtdet+amtepcdet; // netAmtDet=amtdet+amtepcdet;
totamtbc=amountBcdet+amtBcEpcdet;//TO SET AMOUNT BC-AMTDET*EXCH+AMT // totamtbc=amountBcdet+amtBcEpcdet;//TO SET AMOUNT BC-AMTDET*EXCH+AMT
netamountBcdet=amountBcdet-(intAmtdet*exchRateHdr);// amountBcdet=amountBcdet-(intAmtdet*exchRateHdr);//
totNetAmtBc=netamountBcdet+amtBcEpcdet+amtAcct; totNetAmtBc=totamountBcdet+amtBcEpcdet+totamtAcctBc;
totNetAmt=totNetAmtBc/exchRateHdr; totNetAmt=totNetAmtBc/exchRateHdr;
// System.out.println("AMOUNT ["+amtdetbd+" ] INTAMT ["+intAmtdet+"AMOUNT BC ["+totamtbc+" ] NETAMOUNT BCDET["+netamountBcdet+" ]TOTAL NET AMT BC ["+totNetAmtBc+" ] NET AMOT["+totNetAmt); //System.out.println("AMOUNT ["+amtdetbd+" ] INTAMT ["+intAmtdet+"AMOUNT BC ["+totamtbc+" ] NETAMOUNT BCDET["+netamountBcdet+" ]TOTAL NET AMT BC ["+totNetAmtBc+" ] NET AMOT["+totNetAmt);
sql="update export_fund set amount=?,int_amt=?,amount__bc=?,diff_amt__exch=?,amount__epcadj=?,net_amt__bc=?,net_amt=? where tran_id=? " ;//end sql="update export_fund set amount=?,int_amt=?,amount__bc=?,diff_amt__exch=?,amount__epcadj=?,net_amt__bc=?,net_amt=? where tran_id=? " ;//end
...@@ -191,7 +195,7 @@ public class BillDiscountingPostSave extends ValidatorEJB implements BillDiscou ...@@ -191,7 +195,7 @@ public class BillDiscountingPostSave extends ValidatorEJB implements BillDiscou
pstmt.setDouble(1,amtdetbd ); pstmt.setDouble(1,amtdetbd );
pstmt.setDouble(2,intAmtdet ); pstmt.setDouble(2,intAmtdet );
pstmt.setDouble(3,totamtbc ); pstmt.setDouble(3,amountBcdet );
pstmt.setDouble(4,diffexchepcdet ); pstmt.setDouble(4,diffexchepcdet );
pstmt.setDouble(5,amtBcEpcdet ); pstmt.setDouble(5,amtBcEpcdet );
pstmt.setDouble(6,totNetAmtBc ); pstmt.setDouble(6,totNetAmtBc );
......
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