Commit f241511e authored by msharma's avatar msharma

Cross update corrected by Manoj dtd 11/04/2016 for discount amount, tax amount and bank chanrges


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101175 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 73acc317
...@@ -51,8 +51,8 @@ public class MiscPayPostSave extends ValidatorEJB implements MiscPayPostSaveLoca ...@@ -51,8 +51,8 @@ public class MiscPayPostSave extends ValidatorEJB implements MiscPayPostSaveLoca
String sql = null; String sql = null;
String currCode = ""; String currCode = "";
double exchRate = 0, netAmt =0, diffAmtExch = 0 ; double exchRate = 0, netAmt =0, diffAmtExch = 0,taxAmt=0,bankCharges=0,discAmt=0 ;
int cnt=0; int cnt=0;
try try
{ {
...@@ -62,7 +62,7 @@ public class MiscPayPostSave extends ValidatorEJB implements MiscPayPostSaveLoca ...@@ -62,7 +62,7 @@ public class MiscPayPostSave extends ValidatorEJB implements MiscPayPostSaveLoca
dom = genericUtility.parseString(domString); dom = genericUtility.parseString(domString);
tranId = genericUtility.getColumnValue("tran_id",dom); tranId = genericUtility.getColumnValue("tran_id",dom);
//Cross update corrected by Manoj dtd 11/04/2016 for discount amount, tax amount and bank chanrges
sql="select curr_code,exch_rate from misc_payment WHERE tran_id = ? " ; sql="select curr_code,exch_rate from misc_payment WHERE tran_id = ? " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId ); pstmt.setString(1,tranId );
...@@ -87,6 +87,13 @@ public class MiscPayPostSave extends ValidatorEJB implements MiscPayPostSaveLoca ...@@ -87,6 +87,13 @@ public class MiscPayPostSave extends ValidatorEJB implements MiscPayPostSaveLoca
cnt = pstmt.executeUpdate(); cnt = pstmt.executeUpdate();
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql="update misc_paydet set net_pay_amt=pay_amt+tax_amt-discount_amt where tran_id=?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,tranId);
pstmt.executeUpdate();
pstmt.close();
pstmt=null;
sql="UPDATE misc_paydet set diff_amt__exch = (pay_amt * exch_rate__vouch) - (pay_amt * exch_rate) " sql="UPDATE misc_paydet set diff_amt__exch = (pay_amt * exch_rate__vouch) - (pay_amt * exch_rate) "
+" WHERE tran_id = ? " +" WHERE tran_id = ? "
...@@ -98,7 +105,7 @@ public class MiscPayPostSave extends ValidatorEJB implements MiscPayPostSaveLoca ...@@ -98,7 +105,7 @@ public class MiscPayPostSave extends ValidatorEJB implements MiscPayPostSaveLoca
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql="select sum( (PAY_AMT + TAX_AMT + DISCOUNT_AMT )*(EXCH_RATE / ? ) ), sum(diff_amt__exch) from misc_paydet WHERE tran_id = ? " ; sql="select sum( (PAY_AMT + TAX_AMT - DISCOUNT_AMT )*(EXCH_RATE / ? ) ), sum(diff_amt__exch),sum(tax_amt),sum(bank_charges),sum(discount_amt) from misc_paydet WHERE tran_id = ? " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,exchRate ); pstmt.setDouble(1,exchRate );
pstmt.setString(2,tranId ); pstmt.setString(2,tranId );
...@@ -107,19 +114,26 @@ public class MiscPayPostSave extends ValidatorEJB implements MiscPayPostSaveLoca ...@@ -107,19 +114,26 @@ public class MiscPayPostSave extends ValidatorEJB implements MiscPayPostSaveLoca
{ {
netAmt = rs.getDouble(1); netAmt = rs.getDouble(1);
diffAmtExch = rs.getDouble(2); diffAmtExch = rs.getDouble(2);
taxAmt=rs.getDouble(3);
bankCharges=rs.getDouble(4);
discAmt=rs.getDouble(5);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql="UPDATE misc_payment set net_amt = ?, diff_amt__exch = ?, net_amt__bc = ? * exch_rate " sql="UPDATE misc_payment set net_amt = ?, diff_amt__exch = ?, net_amt__bc = ? * exch_rate,"
+ "tax_amt=?,bank_charges=?,discount_amt=? "
+" WHERE tran_id = ? "; +" WHERE tran_id = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,netAmt ); pstmt.setDouble(1,netAmt );
pstmt.setDouble(2,diffAmtExch ); pstmt.setDouble(2,diffAmtExch );
pstmt.setDouble(3,netAmt ); pstmt.setDouble(3,netAmt );
pstmt.setString(4,tranId ); pstmt.setDouble(4,taxAmt );
pstmt.setDouble(5,bankCharges );
pstmt.setDouble(6,discAmt );
pstmt.setString(7,tranId );
cnt = pstmt.executeUpdate(); cnt = pstmt.executeUpdate();
pstmt.close(); pstmt.close();
pstmt = null; pstmt = 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