Commit 4c28fe56 authored by pdas's avatar pdas

Made changes in calculation of other amount for receipt.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98513 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f54b4121
......@@ -75,9 +75,10 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa
String acctFin = "";
String acctFinS = "";
String bdFluctuationCf="";
String sql1 ="";
double rcpAmt=0,finChg=0, diffAmtExchDet = 0, diffAmtExchAdv = 0, diffAmtExchEpc = 0, newAdvAmt = 0;
double billAmtDet = 0, advAmtHdr = 0, adjAmtAdv = 0, bdAmt =0, advAmtRact = 0, othAmt =0,exchRateHdr = 0, taxAmt = 0;
double billAmtDet = 0, advAmtHdr = 0, adjAmtAdv = 0, bdAmt =0, advAmtRact = 0, othAmt = 0.0,exchRateHdr = 0.0, taxAmt = 0,amount = 0.0,othAmttemp =0.0;
int cnt=0;
try
{
......@@ -166,20 +167,30 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa
rs.close();
rs = null;
sql1 ="select (amount * exch_rate ) oth_amt from rcpacct WHERE tran_id = ? AND eff_bank <> 'N'";
pstmt = conn.prepareStatement(sql1);
sql="select sum( (case when eff_bank <> 'N' then amount else 0 end) * exch_rate / ? ) oth_amt from rcpacct WHERE tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,exchRateHdr);
pstmt.setString(2,tranId );
pstmt.setString(1,tranId );
rs = pstmt.executeQuery();
if (rs.next())
{
othAmt = rs.getDouble(1);
othAmttemp = rs.getDouble(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("Other Amount Temp before division>>>>" + othAmttemp);
if(othAmttemp != 0)
{
othAmt = (othAmttemp /exchRateHdr);
}
System.out.println("ExchangeRate hdr after division>>>>>" + exchRateHdr);
System.out.println("Other Amount after division>>>>>" + othAmt);
sql="UPDATE receipt SET oth_amt = ?, tax_amt = ? WHERE tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
......@@ -191,7 +202,7 @@ public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSa
pstmt.close();
pstmt = null;
System.out.println("Other Amount on update11111111>>>>>" + othAmt);
sql="select sum(adj_amt) from rcpadv WHERE tran_id = ? ";
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