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
4b6ec46c78
commit
244c8fd18d
|
@ -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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user