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
2025-01-03 14:57:05 +05:30

37 lines
1.0 KiB
TypeScript

import { Doc } from 'fyo/model/doc';
import { FiltersMap, HiddenMap } from 'fyo/model/types';
import {
AccountRootTypeEnum,
AccountTypeEnum,
} from 'models/baseModels/Account/types';
export class POSSettings extends Doc {
isShiftOpen?: boolean;
inventory?: string;
cashAccount?: string;
writeOffAccount?: string;
weightEnabledBarcode?: boolean;
checkDigits?: number;
itemCodeDigits?: number;
itemWeightDigits?: number;
posUI?: 'Classic' | 'Modern';
submitInvoice?: string;
static filters: FiltersMap = {
cashAccount: () => ({
rootType: AccountRootTypeEnum.Asset,
accountType: AccountTypeEnum.Cash,
isGroup: false,
}),
};
hidden: HiddenMap = {
weightEnabledBarcode: () =>
!this.fyo.singles.InventorySettings?.enableBarcodes,
checkDigits: () => !this.fyo.singles.InventorySettings?.enableBarcodes,
itemCodeDigits: () => !this.fyo.singles.InventorySettings?.enableBarcodes,
itemWeightDigits: () => !this.fyo.singles.InventorySettings?.enableBarcodes,
};
}