dolfindevelopers

Supplier credit note detail

ComponentPayablesSDK + UI

One supplier credit note: header with Issue, Delete (drafts that are not e-invoices) and Apply to bill, the draft notice, amount, applied, available and net and tax figures, details, history, and the bills it was applied to with Reverse. 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/ap-supplier-credit-note-detail

Also installs: button, card, popover, ap-apply-supplier-credit-dialog, ap-supplier-credit-parts, base-data-table, base-info-hint, base-money, base-page, base-states, base-status-badge, base-timeline, ui-ap-supplier-credit-note-detail.

Usage

screen.tsx
import { SupplierCreditNoteDetail } from "@/components/dolfin/ap/supplier-credit-note-detail";

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

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
creditNoteIdstringFetches the note, its supplier, applications and bill names, and wires every action.
creditNote{ id?: string; organisationId?: string; supplierId?: string; documentNumber?: null | string; amount?: number | string; netAmount?: number | …The note to show. Passing it (or `loading` / `error`) fetches nothing; null reads "not found".
supplierNamestring
applicationsreadonly { id?: string; supplierCreditNoteId?: string; billId?: string; supplierId?: string; amount?: number | string; currency: string; sta…The bills the credit was applied to, oldest first.
billLabelsReadonly<Record<string, string>>Bill invoice numbers by bill id, for the applications and history.
loadingboolean
errorError
onRetry() => void
onIssue() => voidShows Issue on a draft.
onDelete() => voidShows Delete on a deletable draft.
onApply() => voidShows Apply to bill while credit is left; open your own dialog. Wired to the apply dialog when fetching.
onReverseApplication(application: SupplierCreditApplication) => voidShows Reverse on applied rows. By id, each `onX` you pass replaces the SDK's own handler.
pendingActionSupplierCreditNoteActionThe header action running now (Issue or Delete).
pendingIdstringThe application a reversal is running for.
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons after Issue, Delete and Apply to bill.
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; goes back to the list by default.
onApplied(result: ApplySupplierCreditResult) => void
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.
hideHistoryboolean
hideApplicationsboolean
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.supplierCreditNotes

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.

useDolfinLocaleuseDolfinNavigateuseMessagesuseSupplierCreditNoteuseSupplierCreditNoteMutations

Files

Written to your app by the install command:

  • components/dolfin/ap/supplier-credit-note-detail.tsx 364 lines
  • components/dolfin/ap/supplier-credit-note-cards.tsx 283 lines