dolfindevelopers

Delivery note form dialog

DialogPayablesSDK + UI

Record or edit a delivery note in a dialog: DN number, supplier, received date, the purchase order it was despatched against (its lines copy across, received in full until changed) and the received lines (description, SKU, quantity received, unit). Checks the fields before saving and refreshes order lists, bill matches and the overview afterwards. Also ships NewDeliveryNoteButton and EditDeliveryNoteButton.

Dialog: a modal you open from your own screen. You control when it opens with its props. 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-delivery-note-form-dialog

Also installs: button, dialog, input, select, base-theme, base-states, ap-purchase-order-form-parts, ui-ap-delivery-note-form-dialog.

Usage

screen.tsx
import { DeliveryNoteFormDialog } from "@/components/dolfin/ap/delivery-note-form-dialog";

// Place it anywhere inside your <DolfinProvider>.
<DeliveryNoteFormDialog open={open} onOpenChange={handleOpenChange} />

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
open requiredboolean
onOpenChange required(open: boolean) => void
deliveryNote{ id?: string; organisationId?: string; supplierId?: null | string; externalRef?: null | string; dnNumber: string; purchaseOrderId?: null | …The note to edit; omit (or pass null) to record a new one.
purchaseOrder{ id?: string; organisationId?: string; supplierId?: null | string; externalRef?: null | string; poNumber: string; currency: string; status?…A new note starts against this order, with its supplier and lines. When editing, names the linked order.
onSaved(deliveryNote: DeliveryNote) => voidAfter a save; the dialog has closed.
onSubmit(value: DeliveryNoteFormValue) => void | Promise<unknown>Saves the note yourself: called with the validated form instead of saving through the API. Resolve to close the dialog; reject (or set `error`) to keep it open.
submittingboolean
errorErrorWhy your save failed.
supplierOptionsreadonly { id: string; name: string; }[]Suppliers to pick from (with `onSubmit`). Given, the picker fetches nothing.
purchaseOrderOptionsreadonly { id?: string; organisationId?: string; supplierId?: null | string; externalRef?: null | string; poNumber: string; currency: string…Open purchase orders to despatch against (with `onSubmit`).
titlestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
descriptionstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.ordersbase.states.retrycore.errors

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

Hooks

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

useDeliveryNoteMutationsuseDolfinLocaleuseMessagesusePurchaseOrderOptions

Files

Written to your app by the install command:

  • components/dolfin/ap/delivery-note-form-dialog.tsx 359 lines
  • components/dolfin/ap/delivery-note-form-saver.tsx 68 lines