mirror of
https://github.com/frappe/books.git
synced 2025-01-09 09:50:27 +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;
|
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) {
|
async getTax(tax: string) {
|
||||||
if (!this._taxes[tax]) {
|
if (!this._taxes[tax]) {
|
||||||
this._taxes[tax] = await this.fyo.doc.getDoc('Tax', tax);
|
this._taxes[tax] = await this.fyo.doc.getDoc('Tax', tax);
|
||||||
|
Loading…
Reference in New Issue
Block a user