Add files via upload

This commit is contained in:
gopi17701 2018-09-23 16:20:56 -04:00 committed by GitHub
parent 4b6ec46c78
commit 244c8fd18d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,8 +107,8 @@ public class SqlDAO extends DAO {
Double qty = rs.getDouble(5); Double qty = rs.getDouble(5);
Double fee = rs.getDouble(6); Double fee = rs.getDouble(6);
int serviceTypeId = rs.getInt(7); int serviceTypeId = rs.getInt(7);
double remainingQty = rs.getInt(8); double remainingQty = rs.getDouble(8);
PODetail poDetail = new PODetail(poNum, lineItemNum, serviceDesc, feeTypeId, qty, fee, serviceTypeId, qty); PODetail poDetail = new PODetail(poNum, lineItemNum, serviceDesc, feeTypeId, qty, fee, serviceTypeId, remainingQty);
poDetails.add(poDetail); poDetails.add(poDetail);
} }
return poDetails; return poDetails;
@ -424,15 +424,22 @@ public class SqlDAO extends DAO {
} }
public void deleteInvoice(String invoiceNum) throws AstuteException { public void deleteInvoice(String invoiceNum) throws AstuteException {
try { String result = "";
System.out.println("deleting invoice " + invoiceNum); try {
CallableStatement stmt = conn.prepareCall("DELETE FROM INVOICE WHERE INV_NO = '"+ invoiceNum + "' AND inv_status = 1"); System.out.println("Calling delete_invoice DB function");
stmt.executeUpdate(); CallableStatement stmt = conn.prepareCall("{? = call delete_invoice(?)}");
updateAllRemainingQuantities(invoiceNum); stmt.registerOutParameter(1, Types.VARCHAR);
} catch (SQLException e) { stmt.setString(2, invoiceNum);
e.printStackTrace(); stmt.executeUpdate();
throw new AstuteException(DB_ERROR,e.getMessage()); result = stmt.getString(1);
} System.out.println(result);
if (!result.equals("SUCCESS")) {
throw new AstuteException(DB_ERROR,result);
}
} catch (SQLException e) {
e.printStackTrace();
throw new AstuteException(DB_ERROR,e.getMessage());
}
} }