Fixed defects.

This commit is contained in:
gopi17701 2019-05-05 21:48:38 -04:00
parent 4427570291
commit e13a64736f

View File

@ -34,12 +34,15 @@ CREATE TABLE IF NOT EXISTS `change_order` (
-- Dumping structure for function astute.create_customer_contact_fun
DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `create_customer_contact_fun`(customer_id varchar(20), contact_id int, name varchar(100), title varchar(50), work_phone int, work_phone_ext int, mobile int, fax int, email varchar(100), address varchar(500)) RETURNS varchar(20) CHARSET utf8
CREATE DEFINER=`root`@`localhost` FUNCTION `create_customer_contact_fun`(customer_id_in varchar(20), name varchar(100), title varchar(50), work_phone int, work_phone_ext int, mobile int, fax int, email varchar(100), address varchar(500)) RETURNS varchar(20) CHARSET utf8
BEGIN
DECLARE last_inserted_id varchar(20);
DECLARE new_contact_id int;
SELECT max(contact_id)+1 into new_contact_id FROM customer_contact where customer_id = customer_id_in;
INSERT INTO astute.customer_contact
(customer_id, contact_id, name, title, work_phone, work_phone_ext, mobile, fax, email, address)
VALUES ('customer_id', contact_id, 'name', 'title', work_phone, work_phone_ext, mobile, fax, 'email', 'address');
VALUES (customer_id_in, new_contact_id, name, title, work_phone, work_phone_ext, mobile, fax, email, address);
SELECT LAST_INSERT_ID() into last_inserted_id;
return last_inserted_id;
END//
@ -116,8 +119,8 @@ CREATE TABLE IF NOT EXISTS `customer` (
-- Dumping data for table astute.customer: ~2 rows (approximately)
/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
INSERT INTO `customer` (`customer_id`, `customer_name`, `bill_to_dept`, `add1`, `add2`, `city`, `state`, `zip`, `zip_last_4`, `email`, `phone`, `fax`, `phext`) VALUES
('MDOT', 'Maryland Department of Transportation', 'Billing Department', '123123 Test Drive', '104', 'Germantown', 'MD', 20874, 3452, 'Test@MDOT.gov', '(123) 123-1233', '(121) 231-233', 0),
('VDOT', 'Virginia Depart of Transportation', 'Billing Department', '13134 Saturn Drive', 'Unit 100', 'McLean', 'VA', 22043, 0, 'Billing@vdot.gov', '(703) 122-1234', '(703) 122-1212', NULL);
('MDOT', 'Maryland Department of Transportation', 'Billing Department', '123123 Test Drive', '104', 'Germantown', 'MD', 20874, 3452, 'Test@MDOT.gov', '(123) 123-1233', '(121) 231-2323', 0),
('VDOT', 'Virginia Depart of Transportation', 'Billing Department', '13134 Saturn Drive', 'Unit 100', 'McLean', 'VA', 22043, 0, 'Billing@vdot.gov', '(703) 122-1234', '(703) 122-12', 0);
/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
-- Dumping structure for table astute.customer_contact
@ -135,7 +138,7 @@ CREATE TABLE IF NOT EXISTS `customer_contact` (
PRIMARY KEY (`customer_id`,`contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.customer_contact: ~0 rows (approximately)
-- Dumping data for table astute.customer_contact: ~2 rows (approximately)
/*!40000 ALTER TABLE `customer_contact` DISABLE KEYS */;
INSERT INTO `customer_contact` (`customer_id`, `contact_id`, `name`, `title`, `work_phone`, `work_phone_ext`, `mobile`, `fax`, `email`, `address`) VALUES
('MDOT', 1, 'John Shaw', 'Manager', 1231231233, 1233, 1232343455, 234123344, 'Test@Test.com', '123 Test Drive'),
@ -174,6 +177,15 @@ BEGIN
END//
DELIMITER ;
-- Dumping structure for function astute.delete_customer_contact
DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `delete_customer_contact`(customer_id_in varchar(20), contact_id_in int) RETURNS varchar(20) CHARSET utf8
BEGIN
delete from customer_contact where customer_id = customer_id_in and contact_id = contact_id_in;
RETURN 'Success';
END//
DELIMITER ;
-- Dumping structure for function astute.delete_invoice
DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `delete_invoice`(inv_no_in varchar(20)) RETURNS varchar(40) CHARSET utf8
@ -383,7 +395,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: ~5 rows (approximately)
-- Dumping data for table astute.invoice: ~3 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
('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),
@ -457,7 +469,7 @@ CREATE TABLE IF NOT EXISTS `invoice_payment` (
CONSTRAINT `fk_pinv_pmt_type` FOREIGN KEY (`invoice_payment_type`) REFERENCES `payment_type` (`payment_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
-- Dumping data for table astute.invoice_payment: ~3 rows (approximately)
-- Dumping data for table astute.invoice_payment: ~2 rows (approximately)
/*!40000 ALTER TABLE `invoice_payment` DISABLE KEYS */;
INSERT INTO `invoice_payment` (`inv_no`, `invoice_payment_type`, `invoice_amount`, `payment_date`, `invoice_payment_id`, `check_no`, `void_payment_status`, `transaction_no`) VALUES
('VDO-02_0107_2', 2, 5000, '2019-01-09', 13, '123123', 0, '456456'),
@ -512,7 +524,7 @@ CREATE TABLE IF NOT EXISTS `payment_type` (
PRIMARY KEY (`payment_type_id`)
) 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 */;
INSERT INTO `payment_type` (`payment_type_id`, `payment_type_name`) VALUES
(1, 'Credit Card'),
@ -546,7 +558,7 @@ CREATE TABLE IF NOT EXISTS `po` (
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, 0),
('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, 0);
('VDOT-54321', 'VDOT-54321', '2018-09-22', 10000.00, 'VDOT', 'VDOTProj', 1, 'Supervisor', 1, NULL, 1);
/*!40000 ALTER TABLE `po` ENABLE KEYS */;
-- Dumping structure for table astute.po_detail
@ -611,35 +623,48 @@ CREATE TABLE IF NOT EXISTS `session` (
CONSTRAINT `fk_session_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.session: ~28 rows (approximately)
-- Dumping data for table astute.session: ~40 rows (approximately)
/*!40000 ALTER TABLE `session` DISABLE KEYS */;
INSERT INTO `session` (`session_id`, `user_id`, `session_start_date`, `session_end_date`) VALUES
('042ef08346f84d52b98a22dab48c7b1c', 1, NULL, NULL),
('058cdb87447645da9ec265e566af834c', 1, NULL, NULL),
('0aa7153e26444ba186254a55169d3ead', 1, NULL, NULL),
('12c9003cf85145b9a352a0472d062858', 1, NULL, NULL),
('2781b188aada4751828d9b7369f8c1a0', 1, NULL, NULL),
('2b4382383bd143f9b995c4321fa6d1ac', 1, NULL, NULL),
('3492c28027db4033987a62d80714b8d0', 1, NULL, NULL),
('3779d52b38ea42898e268ad0f151ae64', 1, NULL, NULL),
('37ac54b5cf5241b080b019d23c151fd8', 1, NULL, NULL),
('46d91a474f4544a2ab60002f799383a7', 1, NULL, NULL),
('4aaceb013ea24e07a527b125945cf939', 1, NULL, NULL),
('4f48b60481ab4729a26b809c077fc7c0', 1, NULL, NULL),
('4f5da5716384478e9c8f7771a0747ebe', 1, NULL, NULL),
('50ba05a7d0f3451badd529b7f02cd4c5', 1, NULL, NULL),
('5df808bb502044ccb6e9da1bce0c63d4', 2, NULL, NULL),
('66ed2bccbaf34b1e96b2b81393996cf9', 1, NULL, NULL),
('687e971f46884e968b234c9b47aa8629', 1, NULL, NULL),
('7a73642eb2ce493f8580599a532cd8e9', 1, NULL, NULL),
('84237645fad54f5aa4d1ae4e24dcefc6', 1, NULL, NULL),
('8f8991185a174b87adb7d0b1b40c1475', 1, NULL, NULL),
('9273d151dabf4bc38e65cb1a568f9504', 1, NULL, NULL),
('92cd1d01085c4ead892a1c7c137631dd', 1, NULL, NULL),
('950dfd7addb34ac8930cbaa11a8aee26', 1, NULL, NULL),
('9c0a7444f67f4de5a789014413445458', 1, NULL, NULL),
('a067451faf5f401680562bb291295629', 1, NULL, NULL),
('abeefc05fe8e48e5bac7ffab65c85ca6', 1, NULL, NULL),
('aeda56d19a7d4fbfa9176b63e14ff4b2', 1, NULL, NULL),
('b356aab1dbe84d4f9eea9c1cd965c9a4', 1, NULL, NULL),
('b77de6ef2b4b4e0487689c689f246ab5', 1, NULL, NULL),
('b9e4507fcc8f487eaf3eb3a9f3b378ed', 1, NULL, NULL),
('c977d55928a145048078b3e9d874a607', 1, NULL, NULL),
('c9bbb1118e5a4dd5b2c873db6ccdcc55', 1, NULL, NULL),
('d14cb15f91454c3ba3bbfda60444bb05', 1, NULL, NULL),
('d6387d93d84341fc91a0c4a5cbf266db', 1, NULL, NULL),
('d98f7e0c9a934afaa89f0f0545c1c81c', 1, NULL, NULL),
('dcb4b261f925464bb69ff685c1c6134d', 1, NULL, NULL),
('e77c5380fa3041a2a22c311198337d4a', 1, NULL, NULL),
('eb943e0991d445919b2ab62248c31494', 1, NULL, NULL),
('f514f61058be4ec18c5fbb80a9908ea0', 1, NULL, NULL),
('f6546dbfa5454a339f2093b2ac1f3b54', 1, NULL, NULL),
('fea623a6ff3148899214750707f4f52e', 1, NULL, NULL);
/*!40000 ALTER TABLE `session` ENABLE KEYS */;