mirror of
https://github.com/frappe/books.git
synced 2024-12-23 11:29:03 +00:00
591e7b3163
- fix model exports - add a README for models base
19 lines
476 B
TypeScript
19 lines
476 B
TypeScript
import Doc from 'frappe/model/doc';
|
|
import { FormulaMap } from 'frappe/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);
|
|
},
|
|
};
|
|
}
|