2
0
mirror of https://github.com/frappe/books.git synced 2025-01-23 15:18:24 +00:00
books/models/inventory/InventorySettings.ts

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

47 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-11-18 14:14:29 +05:30
import { Doc } from 'fyo/model/doc';
import { FiltersMap, ReadOnlyMap } from 'fyo/model/types';
2022-11-18 14:14:29 +05:30
import { AccountTypeEnum } from 'models/baseModels/Account/types';
import { ValuationMethod } from './types';
2022-11-18 14:14:29 +05:30
export class InventorySettings extends Doc {
2022-11-21 12:45:57 +05:30
defaultLocation?: string;
2022-11-18 14:14:29 +05:30
stockInHand?: string;
valuationMethod?: ValuationMethod;
stockReceivedButNotBilled?: string;
costOfGoodsSold?: string;
2023-01-16 11:01:12 +05:30
enableBarcodes?: boolean;
enableBatches?: boolean;
2023-05-04 16:15:12 +05:30
enableSerialNumber?: boolean;
enableUomConversions?: boolean;
2022-11-18 14:14:29 +05:30
static filters: FiltersMap = {
stockInHand: () => ({
isGroup: false,
accountType: AccountTypeEnum.Stock,
}),
stockReceivedButNotBilled: () => ({
isGroup: false,
accountType: AccountTypeEnum['Stock Received But Not Billed'],
}),
costOfGoodsSold: () => ({
isGroup: false,
accountType: AccountTypeEnum['Cost of Goods Sold'],
}),
2022-11-18 14:14:29 +05:30
};
readOnly: ReadOnlyMap = {
enableBarcodes: () => {
return !!this.enableBarcodes;
},
enableBatches: () => {
return !!this.enableBatches;
},
2023-05-04 16:15:12 +05:30
enableSerialNumber: () => {
return !!this.enableSerialNumber;
2023-04-25 12:37:29 +05:30
},
enableUomConversions: () => {
return !!this.enableUomConversions;
},
};
2022-11-18 14:14:29 +05:30
}