* fixed the issue with submit invoice - added a new column - submitted_invoice_date_time

* Fixed deletePoDetail Method
* Fixed deleteInvoiceDetail method
This commit is contained in:
Gopi Katwala 2019-07-17 08:05:27 -04:00
parent 7ba346e60a
commit 6492092cbc
2 changed files with 9 additions and 6 deletions

View File

@ -422,7 +422,7 @@ END;
DELIMITER ; DELIMITER ;
-- Dumping structure for table astute.invoice -- Dumping structure for table astute.invoice
CREATE TABLE IF NOT EXISTS `invoice` ( CREATE TABLE `invoice` (
`inv_no` varchar(20) NOT NULL, `inv_no` varchar(20) NOT NULL,
`inv_date` date NOT NULL, `inv_date` date NOT NULL,
`PO_num` varchar(40) NOT NULL, `PO_num` varchar(40) NOT NULL,
@ -431,11 +431,13 @@ CREATE TABLE IF NOT EXISTS `invoice` (
`certification` varchar(500) DEFAULT 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned.', `certification` varchar(500) DEFAULT 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned.',
`inv_status` int(2) DEFAULT '1', `inv_status` int(2) DEFAULT '1',
`pmt_status` int(11) NOT NULL DEFAULT '1', `pmt_status` int(11) NOT NULL DEFAULT '1',
`submitted_date_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`inv_no`), PRIMARY KEY (`inv_no`),
KEY `fk_InvMaster_POnum` (`PO_num`), KEY `fk_InvMaster_POnum` (`PO_num`),
CONSTRAINT `fk_InvMaster_POnum` FOREIGN KEY (`PO_num`) REFERENCES `po` (`PO_num`) CONSTRAINT `fk_InvMaster_POnum` FOREIGN KEY (`PO_num`) REFERENCES `po` (`PO_num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.invoice: ~3 rows (approximately) -- Dumping data for table astute.invoice: ~3 rows (approximately)
/*!40000 ALTER TABLE `invoice` DISABLE KEYS */; /*!40000 ALTER TABLE `invoice` DISABLE KEYS */;
INSERT INTO `invoice` (`inv_no`, `inv_date`, `PO_num`, `bill_amt`, `special_notes`, `certification`, `inv_status`, `pmt_status`) VALUES INSERT INTO `invoice` (`inv_no`, `inv_date`, `PO_num`, `bill_amt`, `special_notes`, `certification`, `inv_status`, `pmt_status`) VALUES

View File

@ -243,7 +243,7 @@ public class SqlDAO extends DAO {
public void deletePODetail(String POnum, int lineItemNo) throws AstuteException { public void deletePODetail(String POnum, int lineItemNo) throws AstuteException {
try { try {
if (!isPOFinalized(POnum)) { if (isPOFinalized(POnum)) {
throw new AstuteException(0, "PO " + POnum + " is already finalyzed and can not be changed."); throw new AstuteException(0, "PO " + POnum + " is already finalyzed and can not be changed.");
} }
if (POnum == null || POnum.isEmpty() || lineItemNo <= 0) { if (POnum == null || POnum.isEmpty() || lineItemNo <= 0) {
@ -255,7 +255,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(POnum,null, lineItemNo); // updateRemainingQty(POnum,null, lineItemNo);
updateContractAmount(POnum); updateContractAmount(POnum);
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
@ -718,7 +718,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("",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());
@ -735,10 +735,11 @@ public class SqlDAO extends DAO {
} else { } else {
whereClause = " WHERE UPPER(inv_num) = '" + invoiceNum.toUpperCase() + "' AND line_item_num = " + lineItemNum; whereClause = " WHERE UPPER(inv_num) = '" + invoiceNum.toUpperCase() + "' AND line_item_num = " + lineItemNum;
} }
sql += whereClause;
System.out.println(sql); System.out.println(sql);
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
stmt.executeUpdate(sql); stmt.executeUpdate(sql);
updateAllRemainingQuantities(invoiceNum); // updateAllRemainingQuantities(invoiceNum);
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
throw new AstuteException(DB_ERROR,e.getMessage()); throw new AstuteException(DB_ERROR,e.getMessage());
@ -788,7 +789,7 @@ public class SqlDAO extends DAO {
stmt.executeUpdate(); stmt.executeUpdate();
System.out.println("invoiceNum is " + invoiceNum); System.out.println("invoiceNum is " + invoiceNum);
System.out.println("POLineItemNum is " + POLineItemNum); System.out.println("POLineItemNum is " + POLineItemNum);
updateRemainingQty(null,invoiceNum, POLineItemNum); // updateRemainingQty(null,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());