diff --git a/AstuteClient2/src/app/customer/customer.component.html b/AstuteClient2/src/app/customer/customer.component.html index bc32c09..1367394 100644 --- a/AstuteClient2/src/app/customer/customer.component.html +++ b/AstuteClient2/src/app/customer/customer.component.html @@ -302,7 +302,7 @@
-
+
+
+
+ +
+
+ +
+
- - -
-
- - + + +
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AstuteClient2/src/app/invoice-payment/invoice-payment.component.ts b/AstuteClient2/src/app/invoice-payment/invoice-payment.component.ts index a791af5..3638784 100644 --- a/AstuteClient2/src/app/invoice-payment/invoice-payment.component.ts +++ b/AstuteClient2/src/app/invoice-payment/invoice-payment.component.ts @@ -109,7 +109,7 @@ export class InvoicePaymentComponent implements OnInit { this.astuteClientService.getSumittedInvoices().then((data) => { this.invoices = data; }); - this.astuteClientService.getInvoiceTypes().then((data) => { + this.astuteClientService.getInvoicePaymentTypes().then((data) => { this.paymentTypes = data; }); diff --git a/AstuteClient2/src/app/invoice/invoice.component.html b/AstuteClient2/src/app/invoice/invoice.component.html index 4b92dd8..c3e4260 100644 --- a/AstuteClient2/src/app/invoice/invoice.component.html +++ b/AstuteClient2/src/app/invoice/invoice.component.html @@ -659,7 +659,7 @@
diff --git a/AstuteClient2/src/app/invoice/invoice.component.ts b/AstuteClient2/src/app/invoice/invoice.component.ts index 414a0b2..4da1c7c 100644 --- a/AstuteClient2/src/app/invoice/invoice.component.ts +++ b/AstuteClient2/src/app/invoice/invoice.component.ts @@ -43,7 +43,7 @@ export class InvoiceComponent implements OnInit { {headerName: '#', field: 'lineItemNum'}, {headerName: 'PO Detail', field: 'poDetailName'}, {headerName: 'Description', field: 'desc', editable: true, cellEditor: 'agLargeTextCellEditor'}, - {headerName: 'Fee Type', field: 'feeTypeName'}, + {headerName: 'Fee Type', field: 'rateTypeName'}, {headerName: 'Service Type', field: 'serviceTypeName'}, {headerName: 'Qty or Hours', field: 'qty', editable: true}, {headerName: '(/Remaining)', field: 'remainingQty'}, @@ -67,7 +67,6 @@ export class InvoiceComponent implements OnInit { allPODetails = []; newInDetails = []; - newBillAmt = 0; selectedInDetails; selectedPO; @@ -192,6 +191,7 @@ export class InvoiceComponent implements OnInit { } }); } + refreshDetailsOfSelected() { this.setSelectedRow(null); } @@ -216,11 +216,13 @@ export class InvoiceComponent implements OnInit { } updateDetailRow(event) { const eventData = event.data; - console.log(eventData); - this.astuteClientService.updateInvoiceDetail(eventData.invoiceNumber, eventData.lineItemNum, eventData).then((data) => { + // console.log(eventData); + this.astuteClientService.updateInvoiceDetail(eventData.invoiceNum, eventData.lineItemNum, eventData).then((data) => { if (!data) { this.refreshDetailsOfSelected(); alert('Detail Updating Failed, Check Input Fields'); + } else { + this.updateSelectedBillAmt(); } }, (reason) => { alert('Update Detail failed: ' + reason); @@ -235,6 +237,7 @@ export class InvoiceComponent implements OnInit { this.selectedPODetails = this.allPODetails.filter((detail) => { return (detail.ponum === this.chosenInv.poNum); }); + this.selectedInDetails = null; this.selectedInDetails = this.astuteClientService.getInvoiceDetail(this.chosenInv.invoiceNumber).then((data) => { if (data) { data.forEach((invDetail) => { @@ -253,6 +256,7 @@ export class InvoiceComponent implements OnInit { invDetail.poDetailName = this.selectedPODetails[invDetail.poLineItemNum - 1].serviceDesc; } }); + this.updateSelectedBillAmt(); return data; } else { alert('get Inv detail failed!'); @@ -308,14 +312,17 @@ export class InvoiceComponent implements OnInit { this.newInDetails.forEach((d) => { tot += +d.qty * +d.fee; }); - this.newBillAmt = tot; + // this.newBillAmt = tot; } updateSelectedBillAmt() { - // let tot = 0; - // this.selectedInDetails.forEach((d) => { - // tot += +d.qty * +d.fee; - // }); - // this.selectedBillAmt = tot; + this.selectedBillAmt = 0; + if (this.selectedInDetails) { + this.selectedInDetails.then((data) => { + data.forEach((d) => { + this.selectedBillAmt += +d.qty * +d.fee; + }); + }); + } } @@ -532,6 +539,7 @@ export class InvoiceComponent implements OnInit { // creates empty line item detail addEmptyDetail(poLineItemNum) { + console.log(this.chosenInv.invoiceNumber); const emptyData = { desc: '', fee: 0, diff --git a/AstuteClient2/src/app/sales-order/sales-order.component.html b/AstuteClient2/src/app/sales-order/sales-order.component.html index 92de56c..598dc4c 100644 --- a/AstuteClient2/src/app/sales-order/sales-order.component.html +++ b/AstuteClient2/src/app/sales-order/sales-order.component.html @@ -4,9 +4,9 @@
--> - + @@ -414,19 +414,15 @@ (rowDataChanged)="resizeColumns($event)" rowSelection="single" > +

-
+

Total Cost: {{contractAmount | currency}}

- - diff --git a/AstuteClient2/src/app/sales-order/sales-order.component.ts b/AstuteClient2/src/app/sales-order/sales-order.component.ts index 03ce765..962ca39 100644 --- a/AstuteClient2/src/app/sales-order/sales-order.component.ts +++ b/AstuteClient2/src/app/sales-order/sales-order.component.ts @@ -117,14 +117,7 @@ export class SalesOrderComponent implements OnInit { row.serviceTypeName = this.serviceNames[row.serviceTypeId - 1]; row.rateTypeName = this.rateNames[row.feeTypeId - 1]; }); - // console.log(this.selectedPODetail); this.updateContractAmt(); - // if (this.gridColumnApi) { - // this.gridColumnApi.autoSizeAllColumns(); - // } - // if (this.detailColumnApi) { - // this.detailColumnApi.autoSizeAllColumns(); - // } return data; } else { alert('Get SO detail failed!'); @@ -163,6 +156,8 @@ export class SalesOrderComponent implements OnInit { if (!data) { alert('SO Detail updating failed, check input fields'); this.refreshDetailsOfSelected(); + } else { + this.updateContractAmt(); } }, (reason) => { alert('Update SO Detail failed: ' + reason); diff --git a/AstuteClient2/src/app/services/astute-client-service.ts b/AstuteClient2/src/app/services/astute-client-service.ts index 493b5e2..5adf34c 100644 --- a/AstuteClient2/src/app/services/astute-client-service.ts +++ b/AstuteClient2/src/app/services/astute-client-service.ts @@ -24,6 +24,7 @@ export class AstuteClientService { // **************************************** AUTH Service methods public login(username: string, password: string): Promise { + console.log('*** In login()'); const data = { 'username': username, 'password': password @@ -47,6 +48,7 @@ export class AstuteClientService { }); } public logout() { + console.log('*** In logout()'); return this.http .post(`${this.authUrl}/logout${this.sessionString}`, {}) .toPromise() @@ -57,10 +59,12 @@ export class AstuteClientService { }); } public getSessionId(): string { + console.log('*** In getSessionId()'); console.log(localStorage.getItem('SESSION_ID')); return localStorage.getItem('SESSION_ID'); } public getSessionUser(): string { + console.log('*** In getSessionUser()'); console.log(localStorage.getItem('SESSION_USER')); return localStorage.getItem('SESSION_USER'); } @@ -69,7 +73,6 @@ export class AstuteClientService { public getCustomers(): Promise { console.log('*** In getCustomers()'); const url = `${this.customerUrl}${this.sessionString}`; - console.log(url); return this.http.get(url) .toPromise() .then(response => { @@ -118,7 +121,6 @@ export class AstuteClientService { public getCustomerContacts(customerId): Promise { console.log('*** In getCustomerContacts()'); const url = `${this.customerContactUrl}?customerId=${customerId}&sessionId=${localStorage.getItem('SESSION_ID')}`; - console.log(url); return this.http.get(url) .toPromise() .then(response => { @@ -160,9 +162,8 @@ export class AstuteClientService { }); } public getPODetail(ponum): Promise { - console.log('*** In getPODetails()'); + console.log('*** In getPODetail()'); const url = `${this.PODetailUrl}?PONum=${ponum}&sessionId=${localStorage.getItem('SESSION_ID')}`; - console.log(url); return this.http.get(url) .toPromise() .then(response => { @@ -214,7 +215,7 @@ export class AstuteClientService { .then(response => response['entity']); } public getRateTypes(): Promise { - console.log('*** In getPOs()'); + console.log('*** In getRateTypes()'); const url = `${this.POUrl}/feeTypes${this.sessionString}`; return this.http.get(url) .toPromise() @@ -336,9 +337,9 @@ export class AstuteClientService { return response['entity']; }); } - public getInvoiceTypes(): Promise { + public getInvoicePaymentTypes(): Promise { + console.log('*** In getInvoicePaymentTypes()'); const url = `${this.invoicePaymentUrl}/paymentTypes${this.sessionString}`; - console.log('*** In getInvoiceTypes() ... calling ' + url); return this.http.get(url) .toPromise() .then(response => { @@ -374,9 +375,8 @@ export class AstuteClientService { // **************************************** Service Type methods public getServiceTypes(): Promise { - console.log('*** In getPOServiceTypes()'); + console.log('*** In getServiceTypes()'); const url = `${this.serviceTypeUrl}${this.sessionString}`; - // console.log(url); return this.http.get(url) .toPromise() .then(response => {