dolfindevelopers

Bill pre-submit review

ComponentPayablesSDK + UI

What to look at before a bill in review is submitted: a possible duplicate, dates, fields and lines the checks flagged, amounts that don't reconcile and an uncertain supplier, then Submit for review. By id it runs useBillPreSubmit; or pass your own issues. Checks that could not run show an error with Try again, never a clean result; a blocking issue holds Submit with the reason.

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-presubmit-review

Also installs: button, base-info-hint, base-states, base-theme, ui-ap-bill-presubmit-review.

Usage

screen.tsx
import { BillPreSubmitReview } from "@/components/dolfin/ap/bill-presubmit-review";

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

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
billIdstringRuns the checks (`useBillPreSubmit`) and wires Submit for review from the SDK, where the bill allows it.
issuesreadonly BillPreSubmitIssue[]Your issues (from `useBillPreSubmit(id).issues` or your own). Passing them (or `loading` or `error`) fetches nothing, and Submit shows only with `onSubmitReview`. Given with `billId`, the issues win.
loadingbooleanThe checks are still running.
errorErrorThe checks could not run (`useBillPreSubmit(id).checksError`, or the bill's read). Never read as "Everything checks out": without issues the error state shows; with some, they stay under an inline error.
onRetry() => voidShows "Try again" in the error state. By id, reads the bill and its checks again unless you pass your own.
onSubmitReview() => voidShows Submit for review. By id, yours replaces the SDK's. The same name, reason and progress as on `BillActions`, so one set of props drives both.
pendingActionBillActionNameThe bill action running now (`BillActions`' `pendingAction`): `"submitReview"` spins Submit; any other holds it. By id, `undefined` means the SDK's own progress.
submitReviewDisabledReasonstringA non-empty reason disables Submit and explains why in an InfoHint; `""` keeps it enabled. `undefined` means the SDK's reason: an open blocking issue holds Submit until it is fixed (and, by id, the user's role).
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.bill.actionsap.billPreSubmitap.fieldsap.fixFirstap.issuesap.readyap.readyWithNotesap.toCheckap.toFixap.unnamedFieldap.unnamedLineFieldbase.infoHint.moreAboutbase.states

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.

useBilluseBillActionsuseBillPermissionsuseBillPreSubmituseMessages

Files

Written to your app by the install command:

  • components/dolfin/ap/bill-presubmit-review.tsx 217 lines