dolfindevelopers

Bill summary

ComponentPayablesSDK + UI

BillSummary (supplier, due date, total, state, the supplier match and invoice details), BillApprovalCard (applied rule, approvers, possible duplicate, void), and the detail cards: supplier details on the bill, breakdown, payment details and the three-way match at a glance.

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-bill-summary

Also installs: button, separator, base-info-hint, base-states, base-money, base-status-badge, base-theme, ui-ap-bill-summary.

Usage

screen.tsx
import { BillSummary } from "@/components/dolfin/ap/bill-summary";

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

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
billIdstringFetches the bill (sharing the bill page's cache) and its suggested supplier, and wires Confirm supplier.
bill{ id?: string; organisationId?: string; state?: components["schemas"]["BillState"]; source?: components["schemas"]["BillSource"]; eInvoiceId…Your bill. Passing it (or `loading` or `error`) fetches nothing. `null` reads as not found. Given with `billId`, the bill wins.
loadingboolean
errorError
onRetry() => voidShows "Try again" in the error state.
suggestedSupplierNamestringThe name of the supplier the extraction suggested (`bill.suggestedMatchedSupplierId`).
onConfirmSupplier(supplierId: string) => voidShows "Confirm supplier" on an unconfirmed suggestion. By id, yours replaces the SDK's.
pendingAction"confirmSupplier"The summary's action running now: its button shows progress.
onCreateSupplier() => voidShows "Create supplier" when the bill names a supplier not on file; open your create-supplier dialog here.
onNavigate(route: DolfinRoute) => voidReplaces provider navigation for the supplier and edit links.
childrenstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra fields at the end of the detail grid.
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.billap.bills.matchStatusap.bills.statesbase.infoHintbase.statescore.errors

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.

useBilluseBillActionsuseBillPeopleuseBillPermissionsuseBillSupplieruseDolfinHasRouteuseDolfinLocaleuseDolfinNavigateuseMessagesuseNotify

Files

Written to your app by the install command:

  • components/dolfin/ap/bill-summary.tsx 288 lines
  • components/dolfin/ap/bill-approval-card.tsx 228 lines
  • components/dolfin/ap/bill-detail-cards.tsx 203 lines