dolfindevelopers

Credit note detail

ComponentReceivablesSDK + UI

One credit note: header with the signed amount, customer and reason, status, Issue and Delete on drafts, the draft notice, amounts (net, tax at its rate, credit), details, the invoice it credits and its history. Props for header actions, a status badge (e.g. e-invoice delivery), extra detail rows and extra sections. Exports each card for your own layout.

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/ar-credit-note-detail

Also installs: button, card, popover, separator, table, ar-credit-note-parts, base-data-table, base-entity-cell, base-info-hint, base-money, base-page, base-states, base-timeline, ui-ar-credit-note-detail.

Usage

screen.tsx
import { CreditNoteDetail } from "@/components/dolfin/ar/credit-note-detail";

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

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
creditNoteIdstringLoads the note and the invoice it credits, and wires Issue and Delete.
creditNote{ id?: string; organisationId?: string; invoiceId?: string; documentNumber?: null | string; amount?: number | string; netAmount?: number | s…Your own credit note: the detail then makes no request. `null` reads as not found.
invoice{ id?: string; organisationId?: string; customerId?: string; documentNumber?: null | string; currency: string; issueDate?: string; dueDate?:…The invoice it credits (for the customer, the credited line and the invoice card).
loadingboolean
errorError
onRetry() => void
onIssue() => Promise<unknown> | voidShows Issue on a draft.
onDelete() => Promise<unknown> | voidShows Delete on a draft.
draftActionsDisabledReasonstring
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons after Issue and Delete.
statusstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Beside the status badge (e.g. e-invoice delivery status for an issued note).
detailsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra rows at the end of the details card, as `<dt>`/`<dd>` pairs.
sectionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra cards after the invoice (e.g. the e-invoice delivery, or where it stands in your books).
beforestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Rendered above the header (e.g. a back link).
onDeleted() => voidAfter a draft is deleted. By id, goes back to the list by default.
hideTimelineboolean
hideInvoiceboolean
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ar.creditNotesbase.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.

useCreditNoteuseCreditNoteMutationsuseDolfinLocaleuseDolfinNavigateuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ar/credit-note-detail.tsx 320 lines
  • components/dolfin/ar/credit-note-cards.tsx 197 lines