2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 17:34:04 +00:00
books/models/inventory/InventorySettings.ts
18alantom 034d612d29 fix: remove valuation selection
- book COGS according to FIFO valuation on Shipment
2023-09-25 23:59:34 -07:00

49 lines
1.3 KiB
TypeScript

import { Doc } from 'fyo/model/doc';
import { FiltersMap, ReadOnlyMap } from 'fyo/model/types';
import { AccountTypeEnum } from 'models/baseModels/Account/types';
export class InventorySettings extends Doc {
defaultLocation?: string;
stockInHand?: string;
stockReceivedButNotBilled?: string;
costOfGoodsSold?: string;
enableBarcodes?: boolean;
enableBatches?: boolean;
enableSerialNumber?: boolean;
enableUomConversions?: boolean;
enableStockReturns?: boolean;
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'],
}),
};
readOnly: ReadOnlyMap = {
enableBarcodes: () => {
return !!this.enableBarcodes;
},
enableBatches: () => {
return !!this.enableBatches;
},
enableSerialNumber: () => {
return !!this.enableSerialNumber;
},
enableUomConversions: () => {
return !!this.enableUomConversions;
},
enableStockReturns: () => {
return !!this.enableStockReturns;
},
};
}