2022-11-18 08:44:29 +00:00
|
|
|
import { Doc } from 'fyo/model/doc';
|
2023-02-27 13:14:50 +00:00
|
|
|
import { FiltersMap, ReadOnlyMap } from 'fyo/model/types';
|
2022-11-18 08:44:29 +00:00
|
|
|
import { AccountTypeEnum } from 'models/baseModels/Account/types';
|
|
|
|
|
|
|
|
export class InventorySettings extends Doc {
|
2022-11-21 07:15:57 +00:00
|
|
|
defaultLocation?: string;
|
2022-11-18 08:44:29 +00:00
|
|
|
stockInHand?: string;
|
2022-11-18 17:31:50 +00:00
|
|
|
stockReceivedButNotBilled?: string;
|
|
|
|
costOfGoodsSold?: string;
|
2023-01-16 05:31:12 +00:00
|
|
|
enableBarcodes?: boolean;
|
2023-02-27 13:14:50 +00:00
|
|
|
enableBatches?: boolean;
|
2023-05-04 10:45:12 +00:00
|
|
|
enableSerialNumber?: boolean;
|
2023-02-27 13:14:50 +00:00
|
|
|
enableUomConversions?: boolean;
|
2023-07-31 12:21:59 +00:00
|
|
|
enableStockReturns?: boolean;
|
2023-08-22 06:48:51 +00:00
|
|
|
enablePointOfSale?: boolean;
|
2022-11-18 08:44:29 +00:00
|
|
|
|
|
|
|
static filters: FiltersMap = {
|
|
|
|
stockInHand: () => ({
|
|
|
|
isGroup: false,
|
|
|
|
accountType: AccountTypeEnum.Stock,
|
|
|
|
}),
|
|
|
|
stockReceivedButNotBilled: () => ({
|
|
|
|
isGroup: false,
|
|
|
|
accountType: AccountTypeEnum['Stock Received But Not Billed'],
|
|
|
|
}),
|
2022-11-18 17:31:50 +00:00
|
|
|
costOfGoodsSold: () => ({
|
|
|
|
isGroup: false,
|
|
|
|
accountType: AccountTypeEnum['Cost of Goods Sold'],
|
|
|
|
}),
|
2022-11-18 08:44:29 +00:00
|
|
|
};
|
2023-02-27 13:14:50 +00:00
|
|
|
|
|
|
|
readOnly: ReadOnlyMap = {
|
|
|
|
enableBarcodes: () => {
|
|
|
|
return !!this.enableBarcodes;
|
|
|
|
},
|
|
|
|
enableBatches: () => {
|
|
|
|
return !!this.enableBatches;
|
|
|
|
},
|
2023-05-04 10:45:12 +00:00
|
|
|
enableSerialNumber: () => {
|
|
|
|
return !!this.enableSerialNumber;
|
2023-04-25 07:07:29 +00:00
|
|
|
},
|
2023-02-27 13:14:50 +00:00
|
|
|
enableUomConversions: () => {
|
|
|
|
return !!this.enableUomConversions;
|
|
|
|
},
|
2023-07-31 12:21:59 +00:00
|
|
|
enableStockReturns: () => {
|
|
|
|
return !!this.enableStockReturns;
|
|
|
|
},
|
2023-08-22 06:48:51 +00:00
|
|
|
enablePointOfSale: () => {
|
2023-12-04 09:12:57 +00:00
|
|
|
return !!this.fyo.singles.POSShift?.isShiftOpen;
|
2023-08-22 06:48:51 +00:00
|
|
|
},
|
2023-02-27 13:14:50 +00:00
|
|
|
};
|
2022-11-18 08:44:29 +00:00
|
|
|
}
|