dolfindevelopers

Purchase order detail

ComponentPayablesSDK + UI

Blocks for one purchase order: header (PO number, net total, supplier, status, Close and Cancel), details card, lines with ordered and matched quantities, matched bills and linked delivery notes, plus PurchaseOrderDetail composing them with loading and error states.

Component: A piece you place inside your own screens: a table, a form, a card or a dialog. You decide the layout around it. Pages vs components

Choose your integration

Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.

Loading preview…

Installation

Needs the Dolfin registry token. The CLI copies the source into your app.

Terminal
bunx --bun shadcn@4.23.0 add @dolfin/ap-purchase-order-detail

Also installs: button, table, ap-purchase-order-parts, base-data-table, base-money, base-page, base-states, ui-ap-purchase-order-detail.

Usage

screen.tsx
import { PurchaseOrderDetail } from "@/components/dolfin/ap/purchase-order-detail";

// Place it anywhere inside your <DolfinProvider>.
<PurchaseOrderDetail />

Renders inside DolfinProvider (set it up once). By default it loads its own data through the SDK. Supplied-data examples show how to override that behavior.

API reference

PropTypeDescription
purchaseOrderIdstringFetches the order, its supplier, matched bills and linked delivery notes, and wires Close and Cancel.
purchaseOrder{ id?: string; organisationId?: string; supplierId?: null | string; externalRef?: null | string; poNumber: string; currency: string; status?…The order to show. Passing it (or `loading` / `error`) fetches nothing; null reads "not found".
supplier{ id?: string; organisationId?: string; name: string; email?: null | string; phone?: null | string; website?: null | string; taxNumber?: nul…
matchedBillsreadonly { billId: string; matchGroupId: string; matchGroupStatus: components["schemas"]["MatchGroupStatus"]; invoiceNumber?: null | string;…
matchedBillCurrenciesReadonly<Record<string, string>>Each matched bill's currency by bill id.
deliveryNotesreadonly { id?: string; organisationId?: string; supplierId?: null | string; externalRef?: null | string; dnNumber: string; purchaseOrderId?…
loadingboolean
errorError
onRetry() => void
onClose() => voidShows Close in the header while the order is open.
onCancel() => voidShows Cancel in the header while the order is open.
pendingActionOrderTransitionThe transition running now: its button shows progress, and both wait.
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Before Close and Cancel in the header; a function receives the loaded order (e.g. to open it for editing).
beforestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Above the header (a back link).
hideDeliveryNotesbooleanHide the linked delivery notes card.
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.orders

Or edit the installed file directly: it is your code. See theming for colours and fonts.

Hooks

The SDK hooks this component uses. Use them directly from @dolfinai/react to build your own version.

useDolfinLocaleuseLinkedDeliveryNotesuseMessagesusePurchaseOrderusePurchaseOrderActionsuseSupplier

Files

Written to your app by the install command:

  • components/dolfin/ap/purchase-order-detail.tsx 395 lines
  • components/dolfin/ap/purchase-order-linked-notes.tsx 82 lines