export type OrderType = F_PURCHASE_ORDER_TRANSACTION_TYPE; export type SourceOption = 'supplier' | 'warehouse' | 'restaurant'; export declare function optionForSource(type: OrderType, internal?: string | null): SourceOption; export interface TemplateEntry { template: FdoPurchaseOrderTemplate; type: OrderType; supplierId: string; supplier: FdoPurchaseOrderSupplier; invalidReason?: string; } export interface ChangeOrderSourcePreset { type?: OrderType; supplierId?: string; supplierName?: string; } export interface CreateOrderChoice { templateId?: string; supplier?: FdoPurchaseOrderSupplier; } export declare function templateRequiredKind(ctx: { premium: boolean; ruleOn: boolean; vendorRuleOn?: boolean; currentLocationType: string; supplierInternal?: string | null; isLocationSupplier?: boolean; hasTemplate: boolean; }): 'warehouse' | 'vendor' | null; export declare function isTemplateRequired(ctx: Parameters[0]): boolean; /** * Same visibility rules as `getTemplateId()` in use-transfer-template-actions.ts: * hide templates sourced from the current location or restricted to other locations, * and grey out (rather than hide) the invalid ones. Invalid entries sort last. */ export declare function buildTemplateEntries(templates: FdoPurchaseOrderTemplate[], currentLocationId: string, getInvalidReason: (template: FdoPurchaseOrderTemplate) => string | undefined): TemplateEntry[]; export declare function entryKind(entry: TemplateEntry): SourceOption; export interface SourceGroup { source: FdoPurchaseOrderSupplier; kind: SourceOption; templates: TemplateEntry[]; } /** Sources that have at least one template, each with its templates. */ export declare function groupTemplatesBySource(entries: TemplateEntry[]): SourceGroup[];