2
0
mirror of https://github.com/frappe/books.git synced 2025-01-10 18:24:40 +00:00
books/models/inventory/Point of Sale/POSSettings.ts

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

36 lines
1011 B
TypeScript
Raw Normal View History

2023-09-05 12:03:42 +00:00
import { Doc } from 'fyo/model/doc';
2024-12-26 09:42:15 +00:00
import { FiltersMap, HiddenMap } from 'fyo/model/types';
2023-09-05 12:03:42 +00:00
import {
AccountRootTypeEnum,
AccountTypeEnum,
} from 'models/baseModels/Account/types';
export class POSSettings extends Doc {
2024-12-24 16:47:40 +00:00
isShiftOpen?: boolean;
2023-09-05 12:03:42 +00:00
inventory?: string;
cashAccount?: string;
writeOffAccount?: string;
2024-12-26 09:42:15 +00:00
weightEnabledBarcode?: boolean;
checkDigits?: number;
2024-12-26 13:24:19 +00:00
itemCodeDigits?: number;
itemWeightDigits?: number;
2024-12-26 09:42:15 +00:00
posUI?: 'Classic' | 'Modern';
2023-09-05 12:03:42 +00:00
static filters: FiltersMap = {
cashAccount: () => ({
rootType: AccountRootTypeEnum.Asset,
accountType: AccountTypeEnum.Cash,
isGroup: false,
2023-09-05 12:03:42 +00:00
}),
};
2024-12-26 09:42:15 +00:00
hidden: HiddenMap = {
weightEnabledBarcode: () =>
!this.fyo.singles.InventorySettings?.enableBarcodes,
checkDigits: () => !this.fyo.singles.InventorySettings?.enableBarcodes,
2024-12-26 13:24:19 +00:00
itemCodeDigits: () => !this.fyo.singles.InventorySettings?.enableBarcodes,
itemWeightDigits: () => !this.fyo.singles.InventorySettings?.enableBarcodes,
2024-12-26 09:42:15 +00:00
};
2023-09-05 12:03:42 +00:00
}