Commit 16ff13ff authored by tmahadi's avatar tmahadi

bug fix of auto advance adjustment by azhar


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104117 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f791040c
......@@ -348,6 +348,7 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost
System.out.println("total amount temp:: " + totAmtTemp);
if(adjAmtAbs > 0){
sql = "Insert into misc_vouchadv(tran_id,ref_ser,ref_no,adj_amt,tot_amt,line_no) values(?,?,?,?,?,?)";// TODO insert
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tran_id);
......@@ -357,14 +358,14 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost
pstmt.setDouble(5, totAmtPay);
pstmt.setInt(6, lineNo);
pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}
lineNo++;
totAmtTemp -= adjAmtAbs;
if (pstmt != null) {
pstmt.close();
pstmt = null;
}
}
}
......@@ -374,10 +375,8 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost
} finally {
try {
if (conn != null) {
conn.close();
conn = null;
}
if (rs != null) {
rs.close();
rs = null;
......@@ -405,7 +404,7 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost
try {
sql = "select nvl(sum(a.tot_amt),0) from misc_voucher v, misc_vouchadv a where v.tran_id = a.tran_id and v.confirmed = 'N' "
sql = "select nvl(sum(a.adj_amt),0) from misc_voucher v, misc_vouchadv a where v.tran_id = a.tran_id and v.confirmed = 'N' "
+ "and v.sundry_code = ? and v.site_code = ? and v.sundry_type = ? and a.ref_no = ? and a.ref_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sundryCode);
......@@ -423,7 +422,7 @@ public class MiscVoucherPostSave extends ValidatorEJB implements MiscVoucherPost
closeResources(pstmt, rs);
sql = "select nvl(sum(a.tot_amt),0) from voucher v, vouchadv a where v.tran_id = a.tran_id and v.confirmed = 'N' "
sql = "select nvl(sum(a.adj_amt),0) from voucher v, vouchadv a where v.tran_id = a.tran_id and v.confirmed = 'N' "
+ "and v.supp_code = ? and v.site_code = ? and a.ref_no = ? and a.ref_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sundryCode);
......
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