diff --git a/AstuteSystem/sql/astute.sql b/AstuteSystem/sql/astute.sql index cabdc01..887665e 100644 --- a/AstuteSystem/sql/astute.sql +++ b/AstuteSystem/sql/astute.sql @@ -55,10 +55,10 @@ DELIMITER ; -- Dumping structure for procedure astute.create_invoice_detail DELIMITER // -CREATE DEFINER=`root`@`localhost` PROCEDURE `create_invoice_detail`(invoiceNum varchar(20), lineItemNum int, POLineItemNum varchar(20), serviceTypeId int, description varchar(500), percentCompletion double, hours double, amount double) +CREATE DEFINER=`root`@`localhost` PROCEDURE `create_invoice_detail`(invoiceNum varchar(20), lineItemNum int, POLineItemNum varchar(20), serviceTypeId int, description varchar(500), qty_in double, fee_in double) BEGIN -INSERT INTO INVOICE_DETAIL (inv_num, line_item_num, PO_line_item_num, service_type_id, description, percent_completion, hours,amt) -VALUES (invoiceNum, lineItemNum, POLineItemNum, serviceTypeId, description, percentCompletion, hours, amount); +INSERT INTO INVOICE_DETAIL (inv_num, line_item_num, PO_line_item_num, service_type_id, description, qty, fee) +VALUES (invoiceNum, lineItemNum, POLineItemNum, serviceTypeId, description, qty_in, fee_in); END// DELIMITER ; @@ -73,10 +73,10 @@ DELIMITER ; -- Dumping structure for procedure astute.create_po_detail DELIMITER // -CREATE DEFINER=`root`@`localhost` PROCEDURE `create_po_detail`(PONum varchar(40), lineItemNo int, servicedesc varchar(500), feetypeid int(11), quantity double, servicetypeid int(1)) +CREATE DEFINER=`root`@`localhost` PROCEDURE `create_po_detail`(PONum varchar(40), lineItemNo int, servicedesc varchar(500), feetypeid int(11), quantity double, fee_in double, servicetypeid int(1)) BEGIN -INSERT INTO PO_DETAIL (PO_num,line_item_no,service_desc,fee_type_id,qty,service_type_id) -VALUES (POnum,lineitemno,servicedesc,feetypeid,quantity,servicetypeid); +INSERT INTO PO_DETAIL (PO_num,line_item_no,service_desc,fee_type_id,qty,fee,service_type_id) +VALUES (POnum,lineitemno,servicedesc,feetypeid,quantity,fee_in, servicetypeid); END// DELIMITER ; @@ -216,9 +216,8 @@ CREATE TABLE IF NOT EXISTS `invoice_detail` ( `PO_line_item_num` int(11) DEFAULT NULL, `service_type_id` int(11) DEFAULT NULL, `description` varchar(500) DEFAULT NULL, - `percent_completion` double DEFAULT NULL, - `hours` double DEFAULT NULL, - `amt` double DEFAULT NULL, + `qty` double DEFAULT NULL, + `fee` double DEFAULT NULL, `fee_type_id` int(11) DEFAULT NULL, PRIMARY KEY (`inv_num`,`line_item_num`), KEY `fk_InvDetail_FeeType` (`fee_type_id`), @@ -228,14 +227,14 @@ CREATE TABLE IF NOT EXISTS `invoice_detail` ( -- Dumping data for table astute.invoice_detail: ~7 rows (approximately) /*!40000 ALTER TABLE `invoice_detail` DISABLE KEYS */; -INSERT INTO `invoice_detail` (`inv_num`, `line_item_num`, `PO_line_item_num`, `service_type_id`, `description`, `percent_completion`, `hours`, `amt`, `fee_type_id`) VALUES - ('123', 1, NULL, 1, 'tese', 100, 34543, 345435, 1), - ('NVCC-01_1712_21', 1, 1, NULL, 'test', NULL, NULL, 14953, 1), - ('NVCC-01_1712_21', 2, 3, NULL, 'Additional Services: Third Party Utility Verification', NULL, NULL, 1500, 1), - ('NVCC-01_1712_21', 3, 3, NULL, 'Additional Services: Field Investigatoin Travel', NULL, NULL, 321, 1), - ('NVCC-01_1712_21', 4, 4, NULL, 'Reimbursable Expense: Printing and parking', NULL, NULL, 80, 1), - ('NVCC-01_1712_21', 10, 1, 0, 'Design Phase Service _Prelimanary', 0, 0, 14953, 1), - ('NVCC-01_1712_21', 11, 1, 0, 'Design Phase Service _Prelimanary', 0, 0, 14953, 1); +INSERT INTO `invoice_detail` (`inv_num`, `line_item_num`, `PO_line_item_num`, `service_type_id`, `description`, `qty`, `fee`, `fee_type_id`) VALUES + ('123', 1, NULL, 1, 'tese', 34543, 345435, 1), + ('NVCC-01_1712_21', 1, 1, NULL, 'test', NULL, 14953, 1), + ('NVCC-01_1712_21', 2, 3, NULL, 'Additional Services: Third Party Utility Verification', NULL, 1500, 1), + ('NVCC-01_1712_21', 3, 3, NULL, 'Additional Services: Field Investigatoin Travel', NULL, 321, 1), + ('NVCC-01_1712_21', 4, 4, NULL, 'Reimbursable Expense: Printing and parking', NULL, 80, 1), + ('NVCC-01_1712_21', 10, 1, 0, 'Design Phase Service _Prelimanary', 0, 14953, 1), + ('NVCC-01_1712_21', 11, 1, 0, 'Design Phase Service _Prelimanary', 0, 14953, 1); /*!40000 ALTER TABLE `invoice_detail` ENABLE KEYS */; -- Dumping structure for table astute.invoice_notes @@ -257,6 +256,7 @@ CREATE TABLE IF NOT EXISTS `invoice_payment` ( `invoice_amount` double NOT NULL, `payment_date` date NOT NULL, `invoice_payment_id` int(11) NOT NULL AUTO_INCREMENT, + `description` varchar(50) DEFAULT NULL, PRIMARY KEY (`invoice_payment_id`), KEY `fk_inv_pmt_inv_no` (`inv_no`), KEY `fk_pinv_pmt_type` (`invoice_payment_type`), @@ -320,6 +320,7 @@ CREATE TABLE IF NOT EXISTS `po` ( `PO_date` date DEFAULT NULL, `contract_amt` double(10,2) DEFAULT NULL, `customer_id` int(11) NOT NULL, + `astute_project_num` varchar(20) DEFAULT NULL, PRIMARY KEY (`PO_num`), KEY `ind_pomaster_contractno` (`contract_num`), KEY `ind_pomaster_podate` (`PO_date`), @@ -327,12 +328,13 @@ CREATE TABLE IF NOT EXISTS `po` ( CONSTRAINT `po_customer_id` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table astute.po: ~3 rows (approximately) +-- Dumping data for table astute.po: ~4 rows (approximately) /*!40000 ALTER TABLE `po` DISABLE KEYS */; -INSERT INTO `po` (`PO_num`, `contract_num`, `PO_date`, `contract_amt`, `customer_id`) VALUES - ('EP2649247', 'TEST123', '2017-10-13', 30000.00, 1), - ('test12', 'test', NULL, 60000.00, 1), - ('test3', 'test', NULL, 60000.00, 1); +INSERT INTO `po` (`PO_num`, `contract_num`, `PO_date`, `contract_amt`, `customer_id`, `astute_project_num`) VALUES + ('EP2649247', 'TEST123', '2017-10-13', 30000.00, 1, NULL), + ('test12', 'test', NULL, 60000.00, 1, NULL), + ('test3', 'test', NULL, 60000.00, 1, NULL), + ('test5', 'test', NULL, 60000.00, 1, NULL); /*!40000 ALTER TABLE `po` ENABLE KEYS */; -- Dumping structure for table astute.po_detail @@ -343,8 +345,7 @@ CREATE TABLE IF NOT EXISTS `po_detail` ( `fee_type_id` int(11) DEFAULT '1' COMMENT '1-fixed fee, 2-hourly', `qty` double DEFAULT NULL, `service_type_id` int(1) DEFAULT '1' COMMENT '1-studies, 2-supplemental service, 3-out of pocket, 4-reimbursement, 5-', - `schedule` varchar(20) DEFAULT NULL, - `deliver_by` date DEFAULT NULL, + `fee` double DEFAULT NULL, PRIMARY KEY (`PO_num`,`line_item_no`), KEY `fk_PODetail_ServType` (`service_type_id`), CONSTRAINT `fk_PODetail_POnum` FOREIGN KEY (`PO_num`) REFERENCES `po` (`PO_num`), @@ -353,13 +354,13 @@ CREATE TABLE IF NOT EXISTS `po_detail` ( -- Dumping data for table astute.po_detail: ~6 rows (approximately) /*!40000 ALTER TABLE `po_detail` DISABLE KEYS */; -INSERT INTO `po_detail` (`PO_num`, `line_item_no`, `service_desc`, `fee_type_id`, `qty`, `service_type_id`, `schedule`, `deliver_by`) VALUES - ('EP2649247', 1, 'test', 2, 38073, 1, NULL, NULL), - ('EP2649247', 2, 'test', 2, 16345, 1, NULL, NULL), - ('EP2649247', 3, 'test', 2, 4642, 2, NULL, NULL), - ('EP2649247', 4, 'test', 2, 880, 4, NULL, NULL), - ('EP2649247', 6, 'test', 2, 456, 1, 'dfgr', NULL), - ('EP2649247', 16, 'test', 1, 1555, 1, NULL, NULL); +INSERT INTO `po_detail` (`PO_num`, `line_item_no`, `service_desc`, `fee_type_id`, `qty`, `service_type_id`, `fee`) VALUES + ('EP2649247', 1, 'test', 2, 38073, 1, NULL), + ('EP2649247', 2, 'test', 2, 16345, 1, NULL), + ('EP2649247', 3, 'test', 2, 4642, 2, NULL), + ('EP2649247', 4, 'test', 2, 880, 4, NULL), + ('EP2649247', 6, 'test', 2, 456, 1, NULL), + ('EP2649247', 16, 'test', 1, 1555, 1, NULL); /*!40000 ALTER TABLE `po_detail` ENABLE KEYS */; -- Dumping structure for table astute.service_type