mirror of
https://github.com/frappe/books.git
synced 2025-01-08 01:14:39 +00:00
feat: calculate total tax amount
This commit is contained in:
parent
087daf97ed
commit
d07e424315
@ -395,6 +395,13 @@ export abstract class Invoice extends Transactional {
|
||||
return taxArr;
|
||||
}
|
||||
|
||||
async getTotalTax() {
|
||||
const taxArr = await this.getTaxSummary();
|
||||
return taxArr
|
||||
.map(({ amount }) => amount)
|
||||
.reduce((a, b) => a.add(b), this.fyo.pesa(0));
|
||||
}
|
||||
|
||||
async getTax(tax: string) {
|
||||
if (!this._taxes[tax]) {
|
||||
this._taxes[tax] = await this.fyo.doc.getDoc('Tax', tax);
|
||||
|
Loading…
Reference in New Issue
Block a user