Add files via upload

This commit is contained in:
gopi17701 2018-09-08 22:47:36 -04:00 committed by GitHub
parent c086c53ea7
commit 7613f1a0ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -404,22 +404,23 @@ public class SqlDAO extends DAO {
}
public Double updateRemainingQty(String poNum, String inv_no, int lineItemNo) throws AstuteException {
Double remainingQty;
try {
Double remainingQty;
System.out.println("Calling update_remaining_qty_fun DB function");
System.out.println("Calling update_remaining_qty DB procedure");
System.out.println("poNum is " + poNum);
CallableStatement stmt = conn.prepareCall("{? = call update_remaining_qty_fun(?,?,?)}");
stmt.registerOutParameter(1, Types.DOUBLE);
stmt.registerOutParameter(1, Types.VARCHAR);
stmt.setString(2, poNum);
stmt.setString(3, inv_no);
stmt.setInt(4, lineItemNo);
stmt.execute();
stmt.executeUpdate();
remainingQty = stmt.getDouble(1);
return remainingQty;
System.out.println("remaining qty is updated to " + remainingQty);
} catch (SQLException e) {
e.printStackTrace();
throw new AstuteException(DB_ERROR,e.getMessage());
}
return remainingQty;
}
public void updateInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee, int feeTypeId)throws AstuteException {
try {
@ -445,7 +446,7 @@ public class SqlDAO extends DAO {
System.out.println(sql);
Statement stmt = conn.createStatement();
stmt.executeUpdate(sql);
updateRemainingQty(null,invoiceNum, POLineItemNum);
updateRemainingQty("",invoiceNum, POLineItemNum);
} catch (SQLException e) {
e.printStackTrace();
throw new AstuteException(DB_ERROR,e.getMessage());
@ -492,6 +493,8 @@ public class SqlDAO extends DAO {
stmt.setDouble(7, fee);
stmt.setInt(8, feeTypeId);
stmt.executeUpdate();
System.out.println("invoiceNum is " + invoiceNum);
System.out.println("POLineItemNum is " + POLineItemNum);
updateRemainingQty(null,invoiceNum, POLineItemNum);
} catch (SQLException e) {
e.printStackTrace();