From 669b5a3c6dad2970001a655c6f3813a15138b9ed Mon Sep 17 00:00:00 2001 From: Akash Shah Date: Sat, 29 Sep 2018 21:36:01 -0400 Subject: [PATCH] added some files --- .../invoice-payment.component.ts | 4 ++ .../src/app/invoice/invoice.component.html | 62 +++++++++---------- .../src/app/invoice/invoice.component.ts | 6 +- .../sales-order/sales-order.component.html | 6 +- .../app/sales-order/sales-order.component.ts | 3 +- 5 files changed, 44 insertions(+), 37 deletions(-) diff --git a/AstuteClient2/src/app/invoice-payment/invoice-payment.component.ts b/AstuteClient2/src/app/invoice-payment/invoice-payment.component.ts index 9d5b8c1..240107e 100644 --- a/AstuteClient2/src/app/invoice-payment/invoice-payment.component.ts +++ b/AstuteClient2/src/app/invoice-payment/invoice-payment.component.ts @@ -1,5 +1,6 @@ import {Component, OnInit, ViewChild} from '@angular/core'; import {AstuteClientService} from '../services/astute-client-service'; +import {formatCurrency} from "@angular/common"; @Component({ selector: 'app-invoice-payment', @@ -108,6 +109,9 @@ export class InvoicePaymentComponent implements OnInit { }); this.rowData = this.astuteClientService.getInvoicePayments(); + this.rowData.forEach((row) => { + row.invoiceAmount = formatCurrency(row.invoiceAmount, 'en-US', '$', "USD"); + }); this.astuteClientService.getInvoicePayments().then((data) => { this.invoicePaymentData = data; }); diff --git a/AstuteClient2/src/app/invoice/invoice.component.html b/AstuteClient2/src/app/invoice/invoice.component.html index 8fbc40f..424a2ba 100644 --- a/AstuteClient2/src/app/invoice/invoice.component.html +++ b/AstuteClient2/src/app/invoice/invoice.component.html @@ -189,15 +189,15 @@ - + + - +

{{getPerc(qty.value, inDet.remainingQty)}}%

@@ -268,31 +268,31 @@ Original Contract Amount - -
{{selectedPO.contractAmt}}
+ +
{{selectedPO.contractAmt | currency}}
  -   +   Net Changes by Change Orders - -
0
+ +
{{0 | currency}}
  -   +   Total Contract Amount -
{{selectedPO.contractAmt}}
+
{{selectedPO.contractAmt | currency}}
+     -   Previously Billed -
{{selectedPO.previouslyBilledAmount}}
+
{{selectedPO.previouslyBilledAmount | currency}}
+     -   @@ -302,7 +302,7 @@ Balance to be Billed -
{{selectedPO.contractAmt - selectedPO.previouslyBilledAmount - selectedBillAmt}}
+
{{(selectedPO.contractAmt - selectedPO.previouslyBilledAmount - selectedBillAmt) | currency}}
@@ -316,7 +316,7 @@ Total due this invoice - {{selectedBillAmt}} + {{selectedBillAmt | currency}} @@ -480,8 +480,8 @@ - + + - Original Contract Amount - -
{{chosenPo.contractAmt}}
+ Original Contract Amount + +
{{chosenPo.contractAmt | currency}}
-   -   +   +   Net Changes by Change Orders - -
0
- +
{{0 | currency}}
+     -   Total Contract Amount -
{{chosenPo.contractAmt}}
+
{{chosenPo.contractAmt | currency}}
+     -   Previously Billed -
{{chosenPo.previouslyBilledAmount}}
+
{{chosenPo.previouslyBilledAmount | currency}}
+     -   @@ -563,7 +561,7 @@ Balance to be Billed -
{{chosenPo.contractAmt - chosenPo.previouslyBilledAmount - newBillAmt}}
+
{{(chosenPo.contractAmt - chosenPo.previouslyBilledAmount - newBillAmt) | currency}}
@@ -577,7 +575,7 @@ Total due this invoice - {{newBillAmt}} + {{newBillAmt | currency}} diff --git a/AstuteClient2/src/app/invoice/invoice.component.ts b/AstuteClient2/src/app/invoice/invoice.component.ts index ceb28b0..5a586e9 100644 --- a/AstuteClient2/src/app/invoice/invoice.component.ts +++ b/AstuteClient2/src/app/invoice/invoice.component.ts @@ -1,5 +1,6 @@ import {Component, OnInit, ViewChild} from '@angular/core'; import {AstuteClientService} from '../services/astute-client-service'; +import {formatCurrency} from "@angular/common"; declare var $: any; @@ -143,6 +144,9 @@ export class InvoiceComponent implements OnInit { refreshData() { this.astuteClientService.getInvoices().then((data) => { this.source = data; + this.source.forEach((row) => { + row.billAmt = formatCurrency(row.billAmt, 'en-US', '$', 'USD'); + }); }); this.astuteClientService.getCustomers().then((data) => { @@ -227,7 +231,7 @@ export class InvoiceComponent implements OnInit { if (selectedNodes.length) { this.chosenInv = selectedNodes.map(node => node.data)[0]; // console.log (this.chosenInv); - this.selectedBillAmt = +this.chosenInv.billAmt; + this.selectedBillAmt = +(this.chosenInv.billAmt.replace(',', '').replace('$', '')); this.astuteClientService.getPODetail(this.chosenInv.poNum).then((poDetails) => { if (poDetails) { this.selectedPODetails = poDetails; diff --git a/AstuteClient2/src/app/sales-order/sales-order.component.html b/AstuteClient2/src/app/sales-order/sales-order.component.html index 4fb7de2..185bb4b 100644 --- a/AstuteClient2/src/app/sales-order/sales-order.component.html +++ b/AstuteClient2/src/app/sales-order/sales-order.component.html @@ -162,7 +162,7 @@