Add files via upload

This commit is contained in:
gopi17701 2018-07-25 16:17:54 -04:00 committed by GitHub
parent 73227e0aaa
commit 5dfae5c73c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ DELIMITER ;
DELIMITER //
CREATE DEFINER=`root`@`localhost` PROCEDURE `create_invoice`(invNo varchar(20),invDate date,PONo varchar(20),paymentStatus int,billAmt double,specialNotes varchar(500), certClause Varchar(500), invoiceStatus int)
BEGIN
INSERT INTO invoice (inv_no,inv_date,PO_num,pmt_status,bill_amt,special_notes,certifcation,inv_status)
INSERT INTO invoice (inv_no,inv_date,PO_num,pmt_status,bill_amt,special_notes,certification,inv_status)
VALUES (invNo, invDate, PONo, paymentStatus, billAmt, specialNotes, certClause, invoiceStatus);
END//
DELIMITER ;
@ -66,8 +66,10 @@ DELIMITER ;
DELIMITER //
CREATE DEFINER=`root`@`localhost` PROCEDURE `create_po`(PONum varchar(40), contractNum varchar(20), PODate date, contractAmt double(10,2), customerid int, astute_project_num_in varchar(20))
BEGIN
INSERT INTO PO (PO_num, contract_num, PO_date, contract_amt, customer_id,astute_project_num)
VALUES (PONum, contractNum, PODate, contractAmt, customerId,astute_project_num_in);
DECLARE next_po_id int(11);
SELECT MAX(po_id) + 1 INTO next_po_id FROM PO;
INSERT INTO PO (po_id, PO_num, contract_num, PO_date, contract_amt, customer_id,astute_project_num)
VALUES (next_po_id, PONum, contractNum, PODate, contractAmt, customerId,astute_project_num_in);
END//
DELIMITER ;
@ -170,15 +172,15 @@ BEGIN
FROM customer
WHERE customer_id = customer_id_in;
SELECT count(*)
SELECT po_id
INTO po_count
FROM po
WHERE customer_id = customer_id_in;
WHERE PO_num = po_num_in;
SELECT count(*)
INTO inv_count
FROM invoice
WHERE invoice.PO_num in (SELECT po_num FROM po WHERE po.customer_id = customer_id_in);
WHERE invoice.PO_num = po_num_in;
SELECT concat(customer_code, '-',LPAD(po_count, 2, '0'), '_',date_format(now(),'%y'), date_format(now(),'%m'), '_', LPAD(inv_count, 2, '0')) INTO inv_number;
RETURN inv_number;
@ -233,7 +235,7 @@ CREATE TABLE IF NOT EXISTS `invoice` (
CONSTRAINT `fk_InvMaster_POnum` FOREIGN KEY (`PO_num`) REFERENCES `po` (`PO_num`)
) 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 */;
INSERT INTO `invoice` (`inv_no`, `inv_date`, `PO_num`, `bill_amt`, `special_notes`, `certification`, `inv_status`, `pmt_status`) VALUES
('123', '2018-01-01', 'EP2649247', 5000, 'asdf', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned.', 1, 1),
@ -360,6 +362,7 @@ CREATE TABLE IF NOT EXISTS `po` (
`contract_amt` double(10,2) DEFAULT NULL,
`customer_id` int(11) NOT NULL,
`astute_project_num` varchar(20) DEFAULT NULL,
`po_id` int(11) NOT NULL,
PRIMARY KEY (`PO_num`),
KEY `ind_pomaster_contractno` (`contract_num`),
KEY `ind_pomaster_podate` (`PO_date`),
@ -369,11 +372,11 @@ CREATE TABLE IF NOT EXISTS `po` (
-- 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`, `astute_project_num`) VALUES
('EP2649247', 'test123', NULL, 5000.00, 1, 'adf'),
('test12', 'test', NULL, 60000.00, 1, NULL),
('test3', 'test', NULL, 60000.00, 1, NULL),
('test5', 'test', NULL, 60000.00, 1, NULL);
INSERT INTO `po` (`PO_num`, `contract_num`, `PO_date`, `contract_amt`, `customer_id`, `astute_project_num`, `po_id`) VALUES
('EP2649247', 'test123', '2018-07-10', 5000.00, 1, 'adf', 1),
('test12', 'test', '2018-07-11', 60000.00, 1, NULL, 2),
('test3', 'test', '2018-07-12', 60000.00, 1, NULL, 3),
('test5', 'test', '2018-07-13', 60000.00, 1, NULL, 4);
/*!40000 ALTER TABLE `po` ENABLE KEYS */;
-- Dumping structure for table astute.po_detail