dolfindevelopers

Bill payments

ComponentPayablesSDK + UI

What was paid against a bill, when, how and by whom, and what is outstanding. Read-only; recording or making a payment goes in the actions slot. Its data is payments: pass them and nothing is fetched. A bill you pass alone only saves the bill's read: the payments of bill.id are still fetched.

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-payments-card

Also installs: table, base-money, base-states, base-theme, ui-ap-bill-payments-card.

Usage

screen.tsx
import { BillPaymentsCard } from "@/components/dolfin/ap/bill-payments-card";

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

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's payments (and the bill for its totals, when `bill` is not given).
bill{ id?: string; organisationId?: string; state?: components["schemas"]["BillState"]; source?: components["schemas"]["BillSource"]; eInvoiceId…Supporting: the bill for the paid and outstanding totals. It never selects data mode: passed alone, the card still fetches the payments of `bill.id` (but not the bill). Pass `payments` too and nothing is fetched.
paymentsreadonly { id?: string; billId?: string; provider?: components["schemas"]["BillPaymentProvider"]; amount?: number | string; currency: string…The card's data: the payments to list. Passing it (or `loading` / `error`) fetches nothing. Given with `billId`, the payments win.
loadingboolean
errorError
onRetry() => void
peopleNamesReadonly<Record<string, string>>Display names by user id, for "by <name>" under a payment. Read for you when the card fetches.
actionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons in the card header, such as recording a payment or paying by bank. Paying is not part of this card; pass your own action here.
renderPaymentMeta(payment: BillPaymentRecord) => ReactNodeExtra content under a payment's amount, e.g. an accounting sync badge.
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.bill.paymentsbase.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.

useBilluseBillPaymentsuseBillPeopleuseDolfinLocaleuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ap/bill-payments-card.tsx 143 lines