import { type SupplierInvoiceRecord, type SupplierInvoiceStatus } from "../index.js"; import { type AsyncComboboxOption } from "./async-combobox.js"; /** * Header fields an extractor may return to prefill the form. All optional — * the operator only overrides the fields it could resolve; the user confirms * before saving. */ export interface SupplierInvoiceExtraction { supplierInvoiceNo?: string | null; supplierId?: string | null; status?: SupplierInvoiceStatus | null; currency?: string | null; issueDate?: string | null; dueDate?: string | null; internalRef?: string | null; notes?: string | null; } export interface SupplierInvoiceFormDialogProps { open: boolean; onOpenChange: (open: boolean) => void; /** Present → edit mode; absent → create mode. */ invoice?: SupplierInvoiceRecord; onSaved?: (id: string) => void; /** * Extension point: extract header fields from an uploaded invoice file * (AI/OCR/whatever the deployment wires). When provided, an upload control * appears that prefills the form for the user to confirm. Omit it (the * default) and no extraction UI is shown. */ extractFromFile?: (file: File) => Promise; /** * Search the suppliers module for the supplier picker. The selected option's * value is stored as the invoice's `supplierId` (a loose text reference — no * cross-module FK). When omitted, a plain text input is shown instead. */ searchSuppliers?: (query: string) => Promise; /** * Create a supplier inline from the picker. Receives the typed name, returns * the new option (whose value becomes the stored `supplierId`). Only offered * when both this and `searchSuppliers` are provided. */ createSupplier?: (name: string) => Promise; /** * Search the products module for the create dialog's product picker. When * provided (create mode only), the operator can attribute the invoice to a * product — and, with `listDeparturesForProduct`, to one of its departures. * On save this emits a whole-invoice cost allocation seeded from the total. */ searchProducts?: (query: string) => Promise; /** * List a product's departures for the create dialog's two-step picker (pick * product, then departure). Only used alongside `searchProducts`. */ listDeparturesForProduct?: (productId: string, query: string) => Promise; } export declare function SupplierInvoiceFormDialog({ open, onOpenChange, invoice, onSaved, extractFromFile, searchSuppliers, createSupplier, searchProducts, listDeparturesForProduct, }: SupplierInvoiceFormDialogProps): import("react").JSX.Element;