made it remaining qty instead of remaining amt

This commit is contained in:
Akash Shah 2018-08-23 19:29:55 -04:00
parent 37e2b03121
commit f896706aac
2 changed files with 5 additions and 6 deletions

View File

@ -425,7 +425,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-success" <button type="button" class="btn btn-success"
(click)="addInvoice(inNumIn.value, poNumIn.value, coNumIn.value, pmtStatusIn.value, notesIn.value, certIn.value, 1, new)" (click)="addInvoice(inNumIn.value, poNumIn.value, coNumIn.value, pmtStatusIn.value, newBillAmt, notesIn.value, certIn.value, 1, new)"
[disabled]="!(inNumIn.value && poNumIn.value && pmtStatusIn.value && newBillAmt && notesIn.value && certIn.value)"> [disabled]="!(inNumIn.value && poNumIn.value && pmtStatusIn.value && newBillAmt && notesIn.value && certIn.value)">
Confirm Confirm
</button> </button>

View File

@ -182,23 +182,21 @@ export class InvoiceComponent implements OnInit {
updateNewBillAmt () { updateNewBillAmt () {
let tot = 0; let tot = 0;
this.newInDetails.forEach((d) => { this.newInDetails.forEach((d) => {
tot += parseInt(d.qty, 10) * parseInt(d.fee, 10); tot += +d.qty * +d.fee;
}); });
this.newBillAmt = tot; this.newBillAmt = tot;
} }
assignActity(): void { assignActity(): void {
window.open('/invoice-gen'); window.open('/invoice-gen');
$(
)
} }
getSelectedRows() { getSelectedRows() {
const selectedNodes = this.agGrid.api.getSelectedNodes(); const selectedNodes = this.agGrid.api.getSelectedNodes();
if (selectedNodes.length) { if (selectedNodes.length) {
this.chosenInv = selectedNodes.map(node => node.data)[0]; this.chosenInv = selectedNodes.map(node => node.data)[0];
this.astuteClientService.getPODetail(this.chosenInv.ponum).then((poDetails) => { // console.log (this.chosenInv);
this.astuteClientService.getPODetail(this.chosenInv.poNum).then((poDetails) => {
if (poDetails) { if (poDetails) {
this.selectedPODetails = poDetails; this.selectedPODetails = poDetails;
this.astuteClientService.getInvoiceDetail(this.chosenInv.invoiceNumber).then ((invoiceDetails) => { this.astuteClientService.getInvoiceDetail(this.chosenInv.invoiceNumber).then ((invoiceDetails) => {
@ -291,6 +289,7 @@ export class InvoiceComponent implements OnInit {
"pmtReceivedDate": this.formatDate(new Date()), "pmtReceivedDate": this.formatDate(new Date()),
'invoiceStatus': status 'invoiceStatus': status
}; };
console.log (invData);
this.astuteClientService.createInvoice(invData) this.astuteClientService.createInvoice(invData)
.catch((response) => { .catch((response) => {