dolfindevelopers

Credit notes list page

PageReceivablesSDK + UI

The credit notes list: Receivables header, a customer filter (once there are customers to tell apart) and the credit notes table with pagination. Plain node props for header actions, the empty state and an aside; takes the table's columns, rowActions and initial filters.

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

Works with Dolfin’s SDK context, 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/ar-credit-notes-list-page

Also installs: ar-credit-notes-table, base-page, ui-ar-credit-notes-list-page.

Usage

route.tsx
import { CreditNotesListPage } from "@/components/dolfin/ar/credit-notes-list-page";

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

Renders inside DolfinProvider (set it up once). It renders the data you pass as props.

API reference

PropTypeDescription
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons in the page header (credit notes are raised from an invoice, so there is no New button here).
asidestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…A column beside the table.
classNamestring
columnsCreditNoteColumnsProp
columnOrderreadonly string[]
columnVisibilityReadonly<Record<string, boolean>>
rowActionsCreditNoteRowActionsPropPass `[]` for none.
variantDataTableVariant
loadingboolean
filtersCreditNoteListFiltersInitial filters for the list it loads: a customer, an invoice. A changed value re-applies.
errorError
pagenumber1-based page number, for your own rows.
creditNotesreadonly { id?: string; organisationId?: string; invoiceId?: string; documentNumber?: null | string; amount?: number | string; netAmount?: n…Your own rows: the table then shows them and makes no request (and no customer filter).
onRetry() => void
emptyStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the default empty state.
pageSizenumber
toolbarActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra controls beside the customer filter.
hasNextPageboolean
onPageChange(page: number) => voidShows the pager for your own rows.
onRowClick(note: CreditNote) => voidCalled when a row is clicked; given, it replaces the row's link.
getRowRoute(note: CreditNote) => DolfinRoute | nullWhere a row links to; the credit note by default (return its invoice when you have no credit note page).
classNamesDataTableClassNames
pagerbooleanShow the built-in previous / next pager when there is more than one page. Default true; pass false when you draw your own pager from the list's pagination (the table still dims while a page loads).
onRowHover(row: { id?: string; organisationId?: string; invoiceId?: string; documentNumber?: null | string; amount?: number | string; netAmount?: numb…Called with the row the pointer moves onto, and with `null` when the pointer leaves the rows (e.g. to highlight the row's point in a chart next to the table). Moving between rows reports the new row without a `null` first.
emptyActionstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…In the default empty state (e.g. "Show all customers" while filtered).
onIssue(note: CreditNote) => voidAdds Issue to drafts' row menus (with your own rows).
forCustomerbooleanThe empty state reads "for this customer".
onCustomerFilterChange(customerId: string | null) => void
hideCustomerFilterbooleanHide the customer filter (a list already scoped to one customer or invoice).

Customisation

Without editing the source, you can change:

Class names
classNameclassNames.frameclassNames.headerclassNames.headerCellclassNames.rowclassNames.cellclassNames.pager
Messages
ar.creditNotes

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.

useMessages

Files

Written to your app by the install command:

  • components/dolfin/ar/credit-notes-list-page.tsx 44 lines