2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 11:29:00 +00:00
books/models/baseModels/TaxSummary/TaxSummary.ts
18alantom de7e5ba807 refactor: rename 'frappe' to 'fyo' outside src
- cause now most of it is different from what it was
2022-05-23 16:18:22 +05:30

19 lines
470 B
TypeScript

import Doc from 'fyo/model/doc';
import { FormulaMap } from 'fyo/model/types';
import Money from 'pesa/dist/types/src/money';
export class TaxSummary extends Doc {
account?: string;
rate?: number;
amount?: Money;
baseAmount?: Money;
formulas: FormulaMap = {
baseAmount: async () => {
const amount = this.amount as Money;
const exchangeRate = (this.parentdoc?.exchangeRate ?? 1) as number;
return amount.mul(exchangeRate);
},
};
}