2022-04-24 12:18:44 +05:30
|
|
|
import { Doc } from 'fyo/model/doc';
|
2022-04-19 11:29:36 +05:30
|
|
|
import { FormulaMap } from 'fyo/model/types';
|
2022-05-23 11:00:54 +05:30
|
|
|
import { Money } from 'pesa';
|
2022-04-11 15:11:49 +05:30
|
|
|
|
|
|
|
export class TaxSummary extends Doc {
|
2022-04-14 14:52:45 +05:30
|
|
|
account?: string;
|
|
|
|
rate?: number;
|
|
|
|
amount?: Money;
|
|
|
|
baseAmount?: Money;
|
|
|
|
|
2022-04-11 15:11:49 +05:30
|
|
|
formulas: FormulaMap = {
|
2022-04-29 18:30:24 +05:30
|
|
|
baseAmount: {
|
|
|
|
formula: async () => {
|
|
|
|
const amount = this.amount as Money;
|
|
|
|
const exchangeRate = (this.parentdoc?.exchangeRate ?? 1) as number;
|
|
|
|
return amount.mul(exchangeRate);
|
|
|
|
},
|
|
|
|
dependsOn: ['amount'],
|
2022-04-11 15:11:49 +05:30
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|