Added custom serializer to Decimal for all Models to output as number and not string.

This should mitigate all hacks earlier and reverted the earlier hacks.
This commit is contained in:
2023-08-16 22:29:22 +05:30
parent c26f433182
commit b1ca758e9d
35 changed files with 142 additions and 154 deletions

View File

@ -193,10 +193,10 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
this.voucher.inventories.push(
new Inventory({
quantity,
rate: +this.batch.rate,
tax: +this.batch.tax,
discount: +this.batch.discount,
amount: quantity * +this.batch.rate * (1 + +this.batch.tax) * (1 - +this.batch.discount),
rate: this.batch.rate,
tax: this.batch.tax,
discount: this.batch.discount,
amount: quantity * this.batch.rate * (1 + this.batch.tax) * (1 - this.batch.discount),
batch: this.batch,
}),
);

View File

@ -95,13 +95,13 @@ export class LedgerComponent implements OnInit, AfterViewInit {
this.running = 0;
this.info.body.forEach((item) => {
if (item.type !== 'Opening Balance') {
this.debit += +item.debit;
this.credit += +item.credit;
this.debit += item.debit;
this.credit += item.credit;
if (item.posted) {
this.running += +item.debit - +item.credit;
this.running += item.debit - item.credit;
}
} else {
this.running += +item.debit - +item.credit;
this.running += item.debit - item.credit;
}
item.running = this.running;
});