Invoice payments
Payments received against an invoice (date, method, payer, reference, status, amount and receipt), with loading, empty and error states and a Record button for off-platform payments.
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/ar-invoice-paymentsAlso installs: badge, button, table, base-info-hint, base-money, base-states, ar-record-payment-dialog, ui-ar-invoice-payments.
Usage
import { InvoicePayments } from "@/components/dolfin/ar/invoice-payments";
// Place it anywhere inside your <DolfinProvider>.
<InvoicePayments />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 |
|---|---|---|
invoiceId | string | Loads the invoice's payments and offers Record payment when the role and the invoice's state allow it. |
payments | readonly { id?: string; invoiceId?: string; organisationId?: string; accountingSync?: null | components["schemas"]["AccountingDocumentSyncRe… | Your own payments: the card then makes no request. |
invoice | Pick<{ id?: string; organisationId?: string; customerId?: string; documentNumber?: null | string; currency: string; issueDate?: string; dueD… | The invoice the payments are for (its state picks the empty message). |
loading | boolean | |
error | Error | |
onRetry | () => void | |
onRecordPayment | () => void | Shows Record payment (with your own payments); open your own dialog from it. |
recordPaymentDisabledReason | string | Why Record payment is unavailable; disables it and says why beside it. |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | More buttons in the card header (for example payment-link tools). |
renderPaymentMeta | (payment: InvoicePayment) => ReactNode | Extra content under a payment's amount, e.g. an accounting sync badge. |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ar.invoice.deniedar.invoice.paymentsbase.infoHint.moreAbout
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.
useDolfinLocaleuseInvoiceuseInvoicePaymentsuseInvoicePermissionsuseMessagesFiles
Written to your app by the install command:
components/dolfin/ar/invoice-payments.tsx121 lines