Bug fixes

This commit is contained in:
gopi17701 2019-01-15 16:44:19 -05:00
parent c8043cbd82
commit fc50520d67

View File

@ -325,10 +325,11 @@ CREATE TABLE IF NOT EXISTS `invoice` (
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: ~4 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
('MDO-01_0108_1', '2019-01-08', 'MDOT-123', 30250, 'Test', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 3, 1), ('MDO-01_0108_1', '2019-01-08', 'MDOT-123', 30250, 'Test', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 3, 1),
('MDO-01_DRAFT_157', '2019-01-15', 'MDOT-123', 2500, 'Trest', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 1, 1),
('VDO-02_0107_2', '2019-01-07', 'ABC-123', 1450, 'Test', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 3, 1), ('VDO-02_0107_2', '2019-01-07', 'ABC-123', 1450, 'Test', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 3, 1),
('VDO-02_0108_3', '2019-01-08', 'ABC-123', 5250, 'Test', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 2, 1); ('VDO-02_0108_3', '2019-01-08', 'ABC-123', 5250, 'Test', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 2, 1);
/*!40000 ALTER TABLE `invoice` ENABLE KEYS */; /*!40000 ALTER TABLE `invoice` ENABLE KEYS */;
@ -349,7 +350,7 @@ CREATE TABLE IF NOT EXISTS `invoice_detail` (
CONSTRAINT `fk_InvDetail_InvNum` FOREIGN KEY (`inv_num`) REFERENCES `invoice` (`inv_no`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `fk_InvDetail_InvNum` FOREIGN KEY (`inv_num`) REFERENCES `invoice` (`inv_no`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.invoice_detail: ~10 rows (approximately) -- Dumping data for table astute.invoice_detail: ~12 rows (approximately)
/*!40000 ALTER TABLE `invoice_detail` DISABLE KEYS */; /*!40000 ALTER TABLE `invoice_detail` DISABLE KEYS */;
INSERT INTO `invoice_detail` (`inv_num`, `line_item_num`, `PO_line_item_num`, `service_type_id`, `description`, `qty`, `fee`, `fee_type_id`) VALUES INSERT INTO `invoice_detail` (`inv_num`, `line_item_num`, `PO_line_item_num`, `service_type_id`, `description`, `qty`, `fee`, `fee_type_id`) VALUES
('MDO-01_0108_1', 1, 1, 2, 'Design', 0.5, 2500, 1), ('MDO-01_0108_1', 1, 1, 2, 'Design', 0.5, 2500, 1),
@ -358,6 +359,7 @@ INSERT INTO `invoice_detail` (`inv_num`, `line_item_num`, `PO_line_item_num`, `s
('MDO-01_0108_1', 4, 4, 4, 'Cost Estimation', 50, 250, 2), ('MDO-01_0108_1', 4, 4, 4, 'Cost Estimation', 50, 250, 2),
('MDO-01_0108_1', 5, 5, 5, 'Forensic Investigation', 0.5, 5000, 1), ('MDO-01_0108_1', 5, 5, 5, 'Forensic Investigation', 0.5, 5000, 1),
('MDO-01_0108_1', 6, -1, 1, 'Out of Pocket Expenses - gas', 50, 20, 1), ('MDO-01_0108_1', 6, -1, 1, 'Out of Pocket Expenses - gas', 50, 20, 1),
('MDO-01_DRAFT_157', 1, 1, 2, 'Design', 1, 2500, 1),
('VDO-02_0107_2', 1, 1, 2, 'Design', 0.25, 5000, 1), ('VDO-02_0107_2', 1, 1, 2, 'Design', 0.25, 5000, 1),
('VDO-02_0107_2', 2, -1, 1, 'Out of Pocket Expenses', 20, 10, 1), ('VDO-02_0107_2', 2, -1, 1, 'Out of Pocket Expenses', 20, 10, 1),
('VDO-02_0108_3', 1, 1, 2, 'Design', 0.25, 5000, 1), ('VDO-02_0108_3', 1, 1, 2, 'Design', 0.25, 5000, 1),
@ -392,7 +394,7 @@ CREATE TABLE IF NOT EXISTS `invoice_payment` (
CONSTRAINT `fk_pinv_pmt_type` FOREIGN KEY (`invoice_payment_type`) REFERENCES `payment_type` (`payment_type_id`) CONSTRAINT `fk_pinv_pmt_type` FOREIGN KEY (`invoice_payment_type`) REFERENCES `payment_type` (`payment_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
-- Dumping data for table astute.invoice_payment: ~1 rows (approximately) -- Dumping data for table astute.invoice_payment: ~0 rows (approximately)
/*!40000 ALTER TABLE `invoice_payment` DISABLE KEYS */; /*!40000 ALTER TABLE `invoice_payment` DISABLE KEYS */;
INSERT INTO `invoice_payment` (`inv_no`, `invoice_payment_type`, `invoice_amount`, `payment_date`, `invoice_payment_id`, `check_transaction_no`, `void_payment_status`) VALUES INSERT INTO `invoice_payment` (`inv_no`, `invoice_payment_type`, `invoice_amount`, `payment_date`, `invoice_payment_id`, `check_transaction_no`, `void_payment_status`) VALUES
('VDO-02_0107_2', 2, 5000, '2019-01-09', 13, '123456', 0), ('VDO-02_0107_2', 2, 5000, '2019-01-09', 13, '123456', 0),
@ -414,6 +416,16 @@ INSERT INTO `invoice_status` (`inv_status_id`, `inv_status_desc`) VALUES
(3, 'Void'); (3, 'Void');
/*!40000 ALTER TABLE `invoice_status` ENABLE KEYS */; /*!40000 ALTER TABLE `invoice_status` ENABLE KEYS */;
-- Dumping structure for function astute.isAnyInvInDraft
DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `isAnyInvInDraft`(PO_num_in varchar(20)) RETURNS int(11)
BEGIN
declare isInvInDraft int;
SELECT count(*) into isInvInDraft from invoice where po_num = PO_num_in and inv_status = 1;
return isInvInDraft;
END//
DELIMITER ;
-- Dumping structure for table astute.payment_status -- Dumping structure for table astute.payment_status
CREATE TABLE IF NOT EXISTS `payment_status` ( CREATE TABLE IF NOT EXISTS `payment_status` (
`payment_status_id` int(11) NOT NULL, `payment_status_id` int(11) NOT NULL,
@ -436,7 +448,7 @@ CREATE TABLE IF NOT EXISTS `payment_type` (
PRIMARY KEY (`payment_type_id`) PRIMARY KEY (`payment_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.payment_type: ~4 rows (approximately) -- Dumping data for table astute.payment_type: ~3 rows (approximately)
/*!40000 ALTER TABLE `payment_type` DISABLE KEYS */; /*!40000 ALTER TABLE `payment_type` DISABLE KEYS */;
INSERT INTO `payment_type` (`payment_type_id`, `payment_type_name`) VALUES INSERT INTO `payment_type` (`payment_type_id`, `payment_type_name`) VALUES
(1, 'Credit Card'), (1, 'Credit Card'),
@ -457,6 +469,7 @@ CREATE TABLE IF NOT EXISTS `po` (
`title` varchar(200) DEFAULT NULL, `title` varchar(200) DEFAULT NULL,
`inv_seq` int(3) NOT NULL DEFAULT '0', `inv_seq` int(3) NOT NULL DEFAULT '0',
`notes` varchar(200) DEFAULT NULL, `notes` varchar(200) DEFAULT NULL,
`final` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`PO_num`), PRIMARY KEY (`PO_num`),
KEY `ind_pomaster_contractno` (`contract_num`), KEY `ind_pomaster_contractno` (`contract_num`),
KEY `ind_pomaster_podate` (`PO_date`), KEY `ind_pomaster_podate` (`PO_date`),
@ -466,10 +479,10 @@ CREATE TABLE IF NOT EXISTS `po` (
-- Dumping data for table astute.po: ~3 rows (approximately) -- Dumping data for table astute.po: ~3 rows (approximately)
/*!40000 ALTER TABLE `po` DISABLE KEYS */; /*!40000 ALTER TABLE `po` DISABLE KEYS */;
INSERT INTO `po` (`PO_num`, `contract_num`, `PO_date`, `contract_amt`, `customer_id`, `astute_project_num`, `po_id`, `title`, `inv_seq`, `notes`) VALUES INSERT INTO `po` (`PO_num`, `contract_num`, `PO_date`, `contract_amt`, `customer_id`, `astute_project_num`, `po_id`, `title`, `inv_seq`, `notes`, `final`) VALUES
('ABC-123', 'ABC-123', '2018-09-23', 27000.00, 'VDOT', 'ABC-123', 2, 'ABC-123', 3, NULL), ('ABC-123', 'ABC-123', '2018-09-23', 27000.00, 'VDOT', 'ABC-123', 2, 'ABC-123', 3, NULL, 0),
('MDOT-123', 'MDOT-123 ContractNo', '2019-01-08', 58500.00, 'MDOT', 'MDOT-123 ProjNo', 1, 'MDOT-123 SO Title', 1, NULL), ('MDOT-123', 'MDOT-123 ContractNo', '2019-01-08', 58500.00, 'MDOT', 'MDOT-123 ProjNo', 1, 'MDOT-123 SO Title', 1, NULL, 0),
('VDOT-54321', 'VDOT-54321', '2018-09-22', 10000.00, 'VDOT', 'VDOTProj', 1, 'Supervisor', 1, NULL); ('VDOT-54321', 'VDOT-54321', '2018-09-22', 10000.00, 'VDOT', 'VDOTProj', 1, 'Supervisor', 1, NULL, 0);
/*!40000 ALTER TABLE `po` ENABLE KEYS */; /*!40000 ALTER TABLE `po` ENABLE KEYS */;
-- Dumping structure for table astute.po_detail -- Dumping structure for table astute.po_detail
@ -494,7 +507,7 @@ INSERT INTO `po_detail` (`PO_num`, `line_item_no`, `service_desc`, `fee_type_id`
('ABC-123', 1, 'Design', 1, 1, 2, 5000, 0.75), ('ABC-123', 1, 'Design', 1, 1, 2, 5000, 0.75),
('ABC-123', 2, 'Out of Expense', 1, 100, 6, 20, 100), ('ABC-123', 2, 'Out of Expense', 1, 100, 6, 20, 100),
('ABC-123', 3, 'Study', 1, 1000, 1, 20, 800), ('ABC-123', 3, 'Study', 1, 1000, 1, 20, 800),
('MDOT-123', 1, 'Design', 1, 1, 2, 2500, 1), ('MDOT-123', 1, 'Design', 1, 1, 2, 2500, 0),
('MDOT-123', 2, 'Study', 2, 10, 1, 100, 10), ('MDOT-123', 2, 'Study', 2, 10, 1, 100, 10),
('MDOT-123', 3, 'Peer Review', 2, 100, 3, 250, 100), ('MDOT-123', 3, 'Peer Review', 2, 100, 3, 250, 100),
('MDOT-123', 4, 'Cost Estimation', 2, 100, 4, 250, 100), ('MDOT-123', 4, 'Cost Estimation', 2, 100, 4, 250, 100),
@ -534,7 +547,7 @@ CREATE TABLE IF NOT EXISTS `session` (
CONSTRAINT `fk_session_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) CONSTRAINT `fk_session_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.session: ~23 rows (approximately) -- Dumping data for table astute.session: ~22 rows (approximately)
/*!40000 ALTER TABLE `session` DISABLE KEYS */; /*!40000 ALTER TABLE `session` DISABLE KEYS */;
INSERT INTO `session` (`session_id`, `user_id`, `session_start_date`, `session_end_date`) VALUES INSERT INTO `session` (`session_id`, `user_id`, `session_start_date`, `session_end_date`) VALUES
('042ef08346f84d52b98a22dab48c7b1c', 1, NULL, NULL), ('042ef08346f84d52b98a22dab48c7b1c', 1, NULL, NULL),
@ -551,6 +564,7 @@ INSERT INTO `session` (`session_id`, `user_id`, `session_start_date`, `session_e
('9273d151dabf4bc38e65cb1a568f9504', 1, NULL, NULL), ('9273d151dabf4bc38e65cb1a568f9504', 1, NULL, NULL),
('92cd1d01085c4ead892a1c7c137631dd', 1, NULL, NULL), ('92cd1d01085c4ead892a1c7c137631dd', 1, NULL, NULL),
('9c0a7444f67f4de5a789014413445458', 1, NULL, NULL), ('9c0a7444f67f4de5a789014413445458', 1, NULL, NULL),
('a067451faf5f401680562bb291295629', 1, NULL, NULL),
('abeefc05fe8e48e5bac7ffab65c85ca6', 1, NULL, NULL), ('abeefc05fe8e48e5bac7ffab65c85ca6', 1, NULL, NULL),
('b356aab1dbe84d4f9eea9c1cd965c9a4', 1, NULL, NULL), ('b356aab1dbe84d4f9eea9c1cd965c9a4', 1, NULL, NULL),
('b9e4507fcc8f487eaf3eb3a9f3b378ed', 1, NULL, NULL), ('b9e4507fcc8f487eaf3eb3a9f3b378ed', 1, NULL, NULL),