Delivery note detail
Blocks for one delivery note: header (DN number, quantity received, supplier, status, Close and Cancel), details card linking its purchase order, lines with received and matched quantities and matched bills, plus DeliveryNoteDetail 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
Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.
Installation
Needs the Dolfin registry token. The CLI copies the source into your app.
bunx --bun shadcn@4.23.0 add @dolfin/ap-delivery-note-detailAlso installs: button, table, ap-purchase-order-parts, base-data-table, base-page, base-states, ui-ap-delivery-note-detail.
Usage
import { DeliveryNoteDetail } from "@/components/dolfin/ap/delivery-note-detail";
// Place it anywhere inside your <DolfinProvider>.
<DeliveryNoteDetail />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
| Prop | Type | Description |
|---|---|---|
deliveryNoteId | string | Fetches the note, its supplier, order and matched bills, and wires Close and Cancel. |
deliveryNote | { id?: string; organisationId?: string; supplierId?: null | string; externalRef?: null | string; dnNumber: string; purchaseOrderId?: null | … | The note 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… | |
purchaseOrder | { id?: string; organisationId?: string; supplierId?: null | string; externalRef?: null | string; poNumber: string; currency: string; status?… | The order the goods were despatched against. |
matchedBills | readonly { billId: string; matchGroupId: string; matchGroupStatus: components["schemas"]["MatchGroupStatus"]; invoiceNumber?: null | string;… | |
matchedBillCurrencies | Readonly<Record<string, string>> | Each matched bill's currency by bill id. |
loading | boolean | |
error | Error | |
onRetry | () => void | |
onClose | () => void | Shows Close in the header while the note is open. |
onCancel | () => void | Shows Cancel in the header while the note is open. |
pendingAction | OrderTransition | The transition running now: its button shows progress, and both wait. |
headerActions | string | 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 note (e.g. to open it for editing). |
before | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Above the header (a back link). |
className | string |
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.
useDeliveryNoteuseDeliveryNoteActionsuseDolfinLocaleuseMessagesuseSupplierFiles
Written to your app by the install command:
components/dolfin/ap/delivery-note-detail.tsx387 lines