Commit 14bc9e70 authored by tmahadi's avatar tmahadi

changes committed in head by azhar


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104221 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cc2bb4a3
...@@ -285,6 +285,7 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost ...@@ -285,6 +285,7 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost
String sql = "", varValue = "",tranId = "", refSer = "", refNo = ""; String sql = "", varValue = "",tranId = "", refSer = "", refNo = "";
double totAmtPayAbs = 0.0, adjAmtPayAbs = 0.0, adjAmt = 0.0, totAmtTemp = 0.0; double totAmtPayAbs = 0.0, adjAmtPayAbs = 0.0, adjAmt = 0.0, totAmtTemp = 0.0;
double totAmtPay = 0.0, adjAmtPay = 0.0, adjAmtAbs = 0.0; double totAmtPay = 0.0, adjAmtPay = 0.0, adjAmtAbs = 0.0;
String currCodePay = "", acctCode = "",cctrCode = "", exchRate = "";
int lineNo = 1; int lineNo = 1;
try { try {
...@@ -308,7 +309,7 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost ...@@ -308,7 +309,7 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost
System.out.println("var value ::: " + varValue); System.out.println("var value ::: " + varValue);
sql = "select tran_id,tran_ser,ref_no,tot_amt,adj_amt from misc_payables where site_code = ? and sundry_type = ? and sundry_code = ? " + sql = "select tran_id,tran_ser,ref_no,tot_amt,adj_amt,curr_code,acct_code,cctr_code,exch_rate from misc_payables where site_code = ? and sundry_type = ? and sundry_code = ? " +
"and tot_amt <> adj_amt and tot_amt < 0 and acct_code in ("+ varValue + ") order by tran_date"; "and tot_amt <> adj_amt and tot_amt < 0 and acct_code in ("+ varValue + ") order by tran_date";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode); pstmt.setString(1, siteCode);
...@@ -324,8 +325,12 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost ...@@ -324,8 +325,12 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost
adjAmtPay = rs.getDouble("adj_amt"); adjAmtPay = rs.getDouble("adj_amt");
totAmtPayAbs = Math.abs(rs.getDouble("tot_amt")); totAmtPayAbs = Math.abs(rs.getDouble("tot_amt"));
adjAmtPayAbs = Math.abs(rs.getDouble("adj_amt")); adjAmtPayAbs = Math.abs(rs.getDouble("adj_amt"));
currCodePay = checkNullAndTrim(rs.getString("curr_code"));
acctCode = checkNullAndTrim(rs.getString("acct_code"));
cctrCode = checkNullAndTrim(rs.getString("cctr_code"));
exchRate = checkNullAndTrim(rs.getString("exch_rate"));
System.out.println("tran id :: " + tranId + " tran ser::: " + refSer + "ref no::: " + refNo + " ::tot amt " + totAmtPayAbs + "::adj amt pay:: " + adjAmtPayAbs); System.out.println("tran id :: " + tranId + " tran ser::: " + refSer + "ref no::: " + refNo + " ::tot amt " + totAmtPayAbs + "::adj amt pay:: " + adjAmtPayAbs + ":::curr code::" + currCodePay + "::acct code::" + acctCode);
if (totAmtTemp > 0) { if (totAmtTemp > 0) {
adjAmt = totAmtPay - adjAmtPay - getUnconfirmedVouchValue(refNo, siteCode, sundryCode, sundryType, refSer, conn); adjAmt = totAmtPay - adjAmtPay - getUnconfirmedVouchValue(refNo, siteCode, sundryCode, sundryType, refSer, conn);
...@@ -349,7 +354,7 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost ...@@ -349,7 +354,7 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost
System.out.println("total amount temp:: " + totAmtTemp); System.out.println("total amount temp:: " + totAmtTemp);
if(adjAmtAbs > 0){ if(adjAmtAbs > 0){
sql = "Insert into misc_vouchadv(tran_id,ref_ser,ref_no,adj_amt,tot_amt,line_no) values(?,?,?,?,?,?)";// TODO insert sql = "Insert into misc_vouchadv(tran_id,ref_ser,ref_no,adj_amt,tot_amt,line_no,curr_code,acct_code,cctr_code,exch_rate__vouch) values(?,?,?,?,?,?,?,?,?,?)";// TODO insert
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tran_id); pstmt.setString(1, tran_id);
pstmt.setString(2, refSer); pstmt.setString(2, refSer);
...@@ -357,6 +362,10 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost ...@@ -357,6 +362,10 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost
pstmt.setDouble(4, adjAmt); pstmt.setDouble(4, adjAmt);
pstmt.setDouble(5, totAmtPay); pstmt.setDouble(5, totAmtPay);
pstmt.setInt(6, lineNo); pstmt.setInt(6, lineNo);
pstmt.setString(7, currCodePay);
pstmt.setString(8, acctCode);
pstmt.setString(9, cctrCode);
pstmt.setString(10, exchRate);
pstmt.executeUpdate(); 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