2
0
mirror of https://github.com/frappe/books.git synced 2024-11-15 01:44:04 +00:00
books/models/baseModels/PricingRuleItem/PricingRuleItem.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
420 B
TypeScript
Raw Normal View History

2024-01-30 12:55:16 +00:00
import { Doc } from 'fyo/model/doc';
import { FormulaMap } from 'fyo/model/types';
import { ModelNameEnum } from 'models/types';
export class PricingRuleItem extends Doc {
item?: string;
unit?: string;
formulas: FormulaMap = {
unit: {
formula: () => {
if (!this.item) {
return;
}
return this.fyo.getValue(ModelNameEnum.Item, this.item, 'unit');
},
},
};
}