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 @@
-
+
+
+
+
+
+
+
+
-
-
-
-
-
- Choose a Customer First!
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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