Fixed defects.

This commit is contained in:
gopi17701 2019-01-14 16:17:06 -05:00
parent 7c2b9943ba
commit 2330b5ae02
3 changed files with 54 additions and 23 deletions

View File

@ -48,7 +48,7 @@
</div>
<div class="col-2">
<!--<button class="btn btn-light" style="width: 100%" (click)="assignActity()" [disabled]="!chosenInv">-->
<button class="btn btn-light" style="width: 100%" (click)="assignActity()" disabled>
<button class="btn btn-light" style="width: 100%" (click)="assignActity()">
Print
</button>
</div>
@ -93,8 +93,8 @@
<!--add1, add2, billToDept, city, customerId, customerName, email, fax, phone, state, zip, ziplast4-->
<tr>
<td colspan="2">
<p *ngIf="customerSelec.value >= 0" class="p-0 m-0 mt-2">
To, {{customers[customerSelec.value].billToDept}}
<p *ngIf="chosenInv.customerId >= 0" class="p-0 m-0 mt-2">
To, {{customers[chosenInv.customerId].billToDept}}
</p>
</td>
<td></td>
@ -107,8 +107,8 @@
</tr>
<tr>
<td colspan="2">
<p *ngIf="customerSelec.value >= 0" class="p-0 m-0 mt-2">
{{customers[customerSelec.value].add1}} {{customers[customerSelec.value].add2}}
<p *ngIf="chosenInv.customerId >= 0" class="p-0 m-0 mt-2">
{{customers[chosenInv.customerId].add1}} {{customers[chosenInv.customerId].add2}}
</p>
</td>
<td></td>
@ -121,8 +121,9 @@
</tr>
<tr>
<td colspan="2">
<p *ngIf="customerSelec.value >= 0" class="p-0 m-0 mt-2">
{{customers[customerSelec.value].city}} {{customers[customerSelec.value].state}} {{customers[customerSelec.value].zip}}-{{customers[customerSelec.value].ziplast4}}
<p *ngIf="chosenInv.customerId >= 0" class="p-0 m-0 mt-2">
<!--{{customers[customerSelec.value].city}} {{customers[customerSelec.value].state}} {{customers[customerSelec.value].zip}}-{{customers[customerSelec.value].ziplast4}}-->
{{customers[chosenInv.customerId].city}} {{customers[chosenInv.customerId].state}} {{customers[chosenInv.customerId].zip}}{{(customers[chosenInv.customerId].ziplast4 == 0) ? '':'-' + customers[chosenInv.customerId].ziplast4}}
</p>
</td>
<td></td>
@ -458,11 +459,8 @@
<tr>
<td colspan="2">
<p *ngIf="customerSelec.value >= 0" class="p-0 m-0 mt-2">
{{customers[customerSelec.value].city}} {{customers[customerSelec.value].state}} {{customers[customerSelec.value].zip}}
{{customers[customerSelec.value].city}} {{customers[customerSelec.value].state}} {{customers[customerSelec.value].zip}}{{(customers[customerSelec.value].ziplast4 == 0) ? '':'-' + customers[customerSelec.value].ziplast4}}
</p>
<!--<p *ngIf="customers[customerSelec.value].ziplast4 !== 0" class="p-0 m-0 mt-2">-->
<!-- - {{customers[customerSelec.value].ziplast4}}-->
<!--</p>-->
</td>
<td></td>
<td>

View File

@ -144,6 +144,7 @@ export class InvoiceComponent implements OnInit {
refreshData() {
this.astuteClientService.getInvoices().then((data) => {
this.source = data;
console.log(data);
this.source.forEach((row) => {
row.billAmt = formatCurrency(row.billAmt, 'en-US', '$', 'USD');
});

View File

@ -64,12 +64,12 @@ DELIMITER ;
-- Dumping structure for procedure astute.create_po
DELIMITER //
CREATE DEFINER=`root`@`localhost` PROCEDURE `create_po`(PONum varchar(40), contractNum varchar(20), PODate date, contractAmt double(10,2), customerid varchar(20), astute_project_num_in varchar(20), title_in varchar(200))
CREATE DEFINER=`root`@`localhost` PROCEDURE `create_po`(PONum varchar(40), contractNum varchar(20), PODate date, contractAmt double(10,2), customerid varchar(20), astute_project_num_in varchar(20), title_in varchar(200), notes_in varchar(200))
BEGIN
DECLARE next_po_id int(11);
SELECT count(*) + 1 INTO next_po_id FROM PO WHERE customer_id = customerid;
INSERT INTO PO (po_id, PO_num, contract_num, PO_date, contract_amt, customer_id,astute_project_num, title )
VALUES (next_po_id, PONum, contractNum, PODate, contractAmt, customerId,astute_project_num_in, title_in);
INSERT INTO PO (po_id, PO_num, contract_num, PO_date, contract_amt, customer_id,astute_project_num, title, notes )
VALUES (next_po_id, PONum, contractNum, PODate, contractAmt, customerId,astute_project_num_in, title_in, notes_in);
END//
DELIMITER ;
@ -96,16 +96,40 @@ CREATE TABLE IF NOT EXISTS `customer` (
`email` varchar(50) DEFAULT NULL,
`phone` varchar(20) DEFAULT NULL,
`fax` varchar(20) DEFAULT NULL,
`phext` int(6) DEFAULT NULL,
PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.customer: ~1 rows (approximately)
-- 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`) VALUES
('MDOT', 'Maryland Department of Transportation', 'Billing Department', '123123 Test Drive', '104', 'Germantown', 'MD', 20874, 0, 'Test@MDOT.gov', '(123) 123-1233', '(121) 231-233'),
('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');
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);
/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
-- Dumping structure for function astute.delete_custmer
DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `delete_custmer`(customer_id_in varchar(20)) RETURNS varchar(40) CHARSET utf8
BEGIN
DECLARE po_count int;
SELECT count(*)
INTO po_count
FROM po
WHERE customer_id = customer_id_in;
IF po_count > 0 THEN
RETURN 'ERROR - Customer with Sales orders can not be deleted';
END IF;
delete from customer where customer_id = customer_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
@ -432,6 +456,7 @@ CREATE TABLE IF NOT EXISTS `po` (
`po_id` int(11) NOT NULL,
`title` varchar(200) DEFAULT NULL,
`inv_seq` int(3) NOT NULL DEFAULT '0',
`notes` varchar(200) DEFAULT NULL,
PRIMARY KEY (`PO_num`),
KEY `ind_pomaster_contractno` (`contract_num`),
KEY `ind_pomaster_podate` (`PO_date`),
@ -441,10 +466,10 @@ CREATE TABLE IF NOT EXISTS `po` (
-- Dumping data for table astute.po: ~3 rows (approximately)
/*!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`) VALUES
('ABC-123', 'ABC-123', '2018-09-23', 27000.00, 'VDOT', 'ABC-123', 2, 'ABC-123', 3),
('MDOT-123', 'MDOT-123 ContractNo', '2019-01-08', 58500.00, 'MDOT', 'MDOT-123 ProjNo', 1, 'MDOT-123 SO Title', 1),
('VDOT-54321', 'VDOT-54321', '2018-09-22', 10000.00, 'VDOT', 'VDOTProj', 1, 'Supervisor', 1);
INSERT INTO `po` (`PO_num`, `contract_num`, `PO_date`, `contract_amt`, `customer_id`, `astute_project_num`, `po_id`, `title`, `inv_seq`, `notes`) VALUES
('ABC-123', 'ABC-123', '2018-09-23', 27000.00, 'VDOT', 'ABC-123', 2, 'ABC-123', 3, NULL),
('MDOT-123', 'MDOT-123 ContractNo', '2019-01-08', 58500.00, 'MDOT', 'MDOT-123 ProjNo', 1, 'MDOT-123 SO Title', 1, NULL),
('VDOT-54321', 'VDOT-54321', '2018-09-22', 10000.00, 'VDOT', 'VDOTProj', 1, 'Supervisor', 1, NULL);
/*!40000 ALTER TABLE `po` ENABLE KEYS */;
-- Dumping structure for table astute.po_detail
@ -509,23 +534,30 @@ 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: ~16 rows (approximately)
-- Dumping data for table astute.session: ~23 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),
('2b4382383bd143f9b995c4321fa6d1ac', 1, NULL, NULL),
('3492c28027db4033987a62d80714b8d0', 1, NULL, NULL),
('37ac54b5cf5241b080b019d23c151fd8', 1, NULL, NULL),
('46d91a474f4544a2ab60002f799383a7', 1, NULL, NULL),
('4f48b60481ab4729a26b809c077fc7c0', 1, NULL, NULL),
('5df808bb502044ccb6e9da1bce0c63d4', 2, NULL, NULL),
('66ed2bccbaf34b1e96b2b81393996cf9', 1, NULL, NULL),
('84237645fad54f5aa4d1ae4e24dcefc6', 1, NULL, NULL),
('8f8991185a174b87adb7d0b1b40c1475', 1, NULL, NULL),
('9273d151dabf4bc38e65cb1a568f9504', 1, NULL, NULL),
('92cd1d01085c4ead892a1c7c137631dd', 1, NULL, NULL),
('9c0a7444f67f4de5a789014413445458', 1, NULL, NULL),
('abeefc05fe8e48e5bac7ffab65c85ca6', 1, NULL, NULL),
('b356aab1dbe84d4f9eea9c1cd965c9a4', 1, NULL, NULL),
('b9e4507fcc8f487eaf3eb3a9f3b378ed', 1, NULL, NULL),
('d6387d93d84341fc91a0c4a5cbf266db', 1, NULL, NULL),
('d98f7e0c9a934afaa89f0f0545c1c81c', 1, NULL, NULL),
('dcb4b261f925464bb69ff685c1c6134d', 1, NULL, NULL),
('e77c5380fa3041a2a22c311198337d4a', 1, NULL, NULL),
('f6546dbfa5454a339f2093b2ac1f3b54', 1, NULL, NULL),
('fea623a6ff3148899214750707f4f52e', 1, NULL, NULL);
/*!40000 ALTER TABLE `session` ENABLE KEYS */;