import type { SupplierCostAllocationInput, SupplierCostAllocationRecord, SupplierInvoiceLineInput, SupplierInvoiceLineRecord, SupplierInvoiceStatus } from "../../index.js"; import type { AsyncComboboxOption } from "../async-combobox.js"; import type { SupplierInvoiceExtraction } from "../supplier-invoice-form-dialog.js"; export type SupplierInvoiceTargetSearch = (targetType: "departure" | "product" | "booking" | "traveler", query: string) => Promise; export declare const STATUS_VARIANT: Record; export declare const TARGET_TYPES: readonly ["departure", "product", "booking", "traveler", "unattributed"]; export type TargetType = (typeof TARGET_TYPES)[number]; /** * Target types that support search-and-select; others fall back to a text id. * Departure search is product-centric (search a product → pick its dated slot), * wired by the host. Travelers have no global search, so they stay raw-id. */ export declare const SEARCHABLE_TARGETS: Set<"booking" | "unattributed" | "departure" | "product" | "traveler">; export declare const LINE_CATEGORY_NONE = "__none__"; export declare const PAYMENT_METHODS: readonly ["bank_transfer", "credit_card", "cash", "cheque", "other"]; export declare function toCents(major: string): number; export declare function parseNonNegativeCents(major: string): number | null; export declare function parseOptionalNonNegativeCents(major: string): number | null; export declare function targetIdFor(targetType: TargetType, targetId: string): Partial; export declare function allocationToInput(a: SupplierCostAllocationRecord): SupplierCostAllocationInput; export declare function lineToInput(line: SupplierInvoiceLineRecord): SupplierInvoiceLineInput; export interface SupplierInvoiceAttachmentUpload { storageKey: string; mimeType?: string | null; fileSize?: number | null; } export interface SupplierInvoiceDetailPageProps { id: string; className?: string; /** Breadcrumb root link + post-delete navigation back to the list. */ onBack?: () => void; /** Operator wires this to open the document download endpoint. */ onDownloadDocument?: () => void; /** * Upload a file's bytes to durable storage (R2) and return its location. * The template owns the upload endpoint (e.g. `/api/v1/admin/uploads`). When * omitted, the attachment upload control is hidden. */ uploadFile?: (file: File) => Promise; /** Operator wires this to open an attachment's download endpoint. */ onDownloadAttachment?: (attachmentId: string) => void; /** * Resolve searchable options for an allocation target (departure / product / * booking). When provided, those targets use a search-and-select combobox in * the allocation dialog instead of a raw id field. */ searchTargets?: SupplierInvoiceTargetSearch; /** * List a product's departures for the two-step departure picker (pick product, * then departure). When provided alongside `searchTargets`, departure * allocation uses product → departure selects instead of a flat list. */ listDeparturesForProduct?: (productId: string, query: string) => Promise; /** Optional invoice-extraction extension point for the edit dialog. */ extractFromFile?: (file: File) => Promise; /** Search suppliers for the edit dialog's supplier picker. */ searchSuppliers?: (query: string) => Promise; /** Create a supplier inline from the edit dialog's supplier picker. */ createSupplier?: (name: string) => Promise; } export declare function formatFileSize(bytes: number | null): string; export declare function Field({ label, value }: { label: string; value: string; }): import("react").JSX.Element;