fixed a bug

This commit is contained in:
Gopi Katwala 2019-06-19 21:57:09 -04:00
parent 3ba902bfe4
commit 716a69ba82
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ DECLARE detailCount int;
SELECT COUNT(line_item_num) INTO detailCount FROM invoice_detail where inv_num = invoiceNum;
if lineItemNum is null or lineItemNum = 0 then
if detailCount > 0 then
select max(lineItemNum)+1 into maxlineItemNo from invoice_detail where inv_num = invoiceNum;
select max(line_Item_Num)+1 into maxlineItemNo from invoice_detail where inv_num = invoiceNum;
else
set maxlineItemNo = 1;
end if;

View File

@ -278,7 +278,7 @@ public class SqlDAO extends DAO {
public void deletePO(String PONum) throws AstuteException {
try {
String sql = "DELETE FROM PO SET final = 1 WHERE PO_Num = '" + PONum + "' AND final = 0";
String sql = "DELETE FROM PO WHERE PO_Num = '" + PONum + "' AND final = 0";
System.out.println(sql);
Statement stmt = conn.createStatement();
stmt.executeUpdate(sql);