calculate sum of the amount use below logic
this.TotalAmount= res.reduce((total, current) => total +
(current.Quantity * current.UnitPrice), 0);
i have two arrays need to loop those and and description.
intad of getting data usign joins i have using below logic to add description ot items list
if(this.lstGlcode.length >0){
res.forEach(y=>{
let gldesc=this.lstGlcode.find(x=>x.Id === y.GldescriptionId)
if(gldesc){
y.GlDescription=gldesc.Description;
}
})
}
No comments:
Post a Comment