Bill summary
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
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-bill-summaryAlso installs: button, separator, base-info-hint, base-states, base-money, base-status-badge, base-theme, ui-ap-bill-summary.
Usage
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
| Prop | Type | Description |
|---|---|---|
billId | string | Fetches 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. |
loading | boolean | |
error | Error | |
onRetry | () => void | Shows "Try again" in the error state. |
suggestedSupplierName | string | The name of the supplier the extraction suggested (`bill.suggestedMatchedSupplierId`). |
onConfirmSupplier | (supplierId: string) => void | Shows "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 | () => void | Shows "Create supplier" when the bill names a supplier not on file; open your create-supplier dialog here. |
onNavigate | (route: DolfinRoute) => void | Replaces provider navigation for the supplier and edit links. |
children | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra fields at the end of the detail grid. |
className | string |
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.
useBilluseBillActionsuseBillPeopleuseBillPermissionsuseBillSupplieruseDolfinHasRouteuseDolfinLocaleuseDolfinNavigateuseMessagesuseNotifyFiles
Written to your app by the install command:
components/dolfin/ap/bill-summary.tsx288 linescomponents/dolfin/ap/bill-approval-card.tsx228 linescomponents/dolfin/ap/bill-detail-cards.tsx203 lines