From c6272762daf6b1f50801474ae0433db9b4727d8c Mon Sep 17 00:00:00 2001 From: tanshu Date: Thu, 28 Jun 2018 16:38:27 +0530 Subject: [PATCH] Fix: Product Ledger was taking into account unposted entries and also the footer was not displaying the totals --- .../product-ledger.component.html | 14 +++++++------- .../product-ledger.component.ts | 19 ++----------------- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/overlord/src/app/product-ledger/product-ledger.component.html b/overlord/src/app/product-ledger/product-ledger.component.html index a71afa2d..f61912ee 100644 --- a/overlord/src/app/product-ledger/product-ledger.component.html +++ b/overlord/src/app/product-ledger/product-ledger.component.html @@ -66,46 +66,46 @@ Debit Quantity {{row.debitQuantity | number:'1.2-2'}} - {{info.debitQuantity | number:'1.2-2'}} + {{debitQuantity | number:'1.2-2'}} Amount {{row.debitAmount | currency:'INR'}} - {{info.debitAmount | currency:'INR'}} + {{debitAmount | currency:'INR'}} Credit {{row.creditQuantity | number:'1.2-2'}} - {{info.creditQuantity | number:'1.2-2'}} + {{creditQuantity | number:'1.2-2'}} Credit {{row.creditAmount | currency:'INR'}} - {{info.creditAmount | currency:'INR'}} + {{creditAmount | currency:'INR'}} Running {{row.runningQuantity | number:'1.2-2'}} - {{info.runningQuantity | number:'1.2-2'}} + {{runningQuantity | number:'1.2-2'}} Running {{row.runningAmount | currency:'INR'}} - {{info.runningAmount | currency:'INR'}} + {{runningAmount | currency:'INR'}} - diff --git a/overlord/src/app/product-ledger/product-ledger.component.ts b/overlord/src/app/product-ledger/product-ledger.component.ts index 0656bd35..99c29c8b 100644 --- a/overlord/src/app/product-ledger/product-ledger.component.ts +++ b/overlord/src/app/product-ledger/product-ledger.component.ts @@ -88,14 +88,9 @@ export class ProductLedgerComponent implements OnInit { this.debitAmount += item.debitAmount; this.creditQuantity += item.creditQuantity; this.creditAmount += item.creditAmount; - if (item.posted) { - this.runningQuantity += item.debitQuantity - item.creditQuantity; - this.runningAmount += item.debitAmount - item.creditAmount; - } - } else { - this.runningQuantity += item.debitQuantity - item.creditQuantity; - this.runningAmount += item.debitAmount - item.creditAmount; } + this.runningQuantity += item.debitQuantity - item.creditQuantity; + this.runningAmount += item.debitAmount - item.creditAmount; item.runningQuantity = this.runningQuantity; item.runningAmount = this.runningAmount; }); @@ -109,16 +104,6 @@ export class ProductLedgerComponent implements OnInit { this.selectedRowId = id; } - getRowClass(id: string, posted: boolean): string { - if (this.selectedRowId === id) { - return 'selected'; - } else if (!posted) { - return 'unposted'; - } else { - return ''; - } - } - show() { const l = this.prepareSubmit(); this.router.navigate(['ProductLedger', l.product.id], {