loadTransaction(transactionNo: string) {
this.gateInService.gettrucktransaction(transactionNo).subscribe((res: any) => {
if (res) {
console.log(res);
this.enableSizeValidation = false;
this.allDetails = res;
// this.dataSourceGateInSummary = res["truckItems"];
console.log (this.dataSourceGateInSummary.data)
this.validateSize();
let filterData = res.invoiceDetails.filter(i => i.sellingAmount != 0)
//handle later
let count =0;
for (let i = 0; i < filterData.length; i++) {
if(filterData[i].chargeCode==="GATE-E")
{
count++
if(count >1){
filterData.splice(i,1);
}
}
}
this.dataSourcePaymentDetails = filterData;
console.log(this.dataSourcePaymentDetails);
// this.dataSourcePaymentDetails.filter(i=>i.sellingAmount !=0)
this.sellingAmount = res["sellingAmount"];
this.vatAmount = res["vatAmount"];
this.nettAmount = res["nettAmount"];
this.whTaxAmount = res["whTaxAmount"];
this.invoiceNo = res["invoiceNo"];
this.sumOfMovements = res["truckItems"].length;
}
});
}
No comments:
Post a Comment