dolfindevelopers

Edit bill page

PagePayablesSDK + UI

Edit a bill in review: its document beside the header form and the lines editor, with unsaved-change marking, field errors in place, a conflict notice and a pinned save bar. Returns to the bill after saving. Accepts your own header actions, banners, aside cards, the empty lines note, a create-supplier dialog and the error state.

Page: A complete screen for one route, such as a bill or the invoices list. Mount it on a route in your app; connected SDK pages provide data and actions; standalone UI pages receive them as 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-edit-bill-page

Also installs: button, base-theme, base-states, ap-bill-document-viewer, ap-bill-edit-form, ap-bill-lines-editor, ap-create-supplier-dialog, ui-ap-edit-bill-page.

Usage

route.tsx
import { EditBillPage } from "@/components/dolfin/ap/edit-bill-page";

// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route({ params }: { params: { billId: string } }) {
  return <EditBillPage billId={params.billId} />;
}

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
billId requiredstring
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons in the bar above the form, after the title.
bannersstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Above the form: notices such as accounting sync or e-invoicing status.
asidestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Cards after the lines (for example accounting codes for each line).
emptyStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the note shown when the bill has no lines.
hideCreateSupplierbooleanHides "New Supplier" in the supplier picker (it opens `ApCreateSupplierDialog` prefilled from the bill; the new supplier is picked, and saving links it).
errorStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the not-found, load error and not-editable state.
onNavigate(route: DolfinRoute) => voidReplaces the provider's navigation (back, cancel, after saving, the suggested supplier link).
onSaved(bill: Bill) => voidCalled with the saved bill before the page goes back to it.
hideDocumentbooleanHides the document pane (for hosts that show the document elsewhere).
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.billDraftbase.statescore.errors

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

Hooks

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

useBillDraftuseDolfinNavigateuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ap/edit-bill-page.tsx 178 lines