mirror of
https://github.com/dyiop/astute.git
synced 2025-04-06 21:30:20 -04:00
Add files via upload
This commit is contained in:
parent
c086c53ea7
commit
7613f1a0ce
|
@ -404,22 +404,23 @@ public class SqlDAO extends DAO {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double updateRemainingQty(String poNum, String inv_no, int lineItemNo) throws AstuteException {
|
public Double updateRemainingQty(String poNum, String inv_no, int lineItemNo) throws AstuteException {
|
||||||
|
Double remainingQty;
|
||||||
try {
|
try {
|
||||||
Double remainingQty;
|
System.out.println("Calling update_remaining_qty DB procedure");
|
||||||
System.out.println("Calling update_remaining_qty_fun DB function");
|
|
||||||
System.out.println("poNum is " + poNum);
|
System.out.println("poNum is " + poNum);
|
||||||
CallableStatement stmt = conn.prepareCall("{? = call update_remaining_qty_fun(?,?,?)}");
|
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(2, poNum);
|
||||||
stmt.setString(3, inv_no);
|
stmt.setString(3, inv_no);
|
||||||
stmt.setInt(4, lineItemNo);
|
stmt.setInt(4, lineItemNo);
|
||||||
stmt.execute();
|
stmt.executeUpdate();
|
||||||
remainingQty = stmt.getDouble(1);
|
remainingQty = stmt.getDouble(1);
|
||||||
return remainingQty;
|
System.out.println("remaining qty is updated to " + remainingQty);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new AstuteException(DB_ERROR,e.getMessage());
|
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 {
|
public void updateInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee, int feeTypeId)throws AstuteException {
|
||||||
try {
|
try {
|
||||||
|
@ -445,7 +446,7 @@ public class SqlDAO extends DAO {
|
||||||
System.out.println(sql);
|
System.out.println(sql);
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
stmt.executeUpdate(sql);
|
stmt.executeUpdate(sql);
|
||||||
updateRemainingQty(null,invoiceNum, POLineItemNum);
|
updateRemainingQty("",invoiceNum, POLineItemNum);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new AstuteException(DB_ERROR,e.getMessage());
|
throw new AstuteException(DB_ERROR,e.getMessage());
|
||||||
|
@ -492,6 +493,8 @@ public class SqlDAO extends DAO {
|
||||||
stmt.setDouble(7, fee);
|
stmt.setDouble(7, fee);
|
||||||
stmt.setInt(8, feeTypeId);
|
stmt.setInt(8, feeTypeId);
|
||||||
stmt.executeUpdate();
|
stmt.executeUpdate();
|
||||||
|
System.out.println("invoiceNum is " + invoiceNum);
|
||||||
|
System.out.println("POLineItemNum is " + POLineItemNum);
|
||||||
updateRemainingQty(null,invoiceNum, POLineItemNum);
|
updateRemainingQty(null,invoiceNum, POLineItemNum);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user