dolfindevelopers

Edit tax rate dialog

DialogReceivablesSDK + UI

Edit a custom tax rate's code, name and rate in a dialog. Platform defaults open read-only. Shows the API's errors beside their fields and refreshes everything in receivables that works tax out from the rate.

Dialog: a modal you open from your own screen. You control when it opens with its props. 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-edit-tax-rate-dialog

Also installs: button, dialog, base-theme, ar-tax-rate-form, ui-ar-edit-tax-rate-dialog.

Usage

screen.tsx
import { ArEditTaxRateDialog } from "@/components/dolfin/ar/edit-tax-rate-dialog";

// Place it anywhere inside your <DolfinProvider>.
<ArEditTaxRateDialog taxRate={taxRate} open={open} onOpenChange={handleOpenChange} />

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
taxRate required{ id?: string; organisationId?: null | string; code: string; name: string; rate?: number | string; source: string; isReadOnly?: boolean; cre…The rate to edit; the form reloads whenever it changes. Platform defaults open read-only.
open requiredboolean
onOpenChange required(open: boolean) => void
onUpdated(taxRate: TaxRate) => voidAfter the rate was saved; the dialog has closed.
onSubmit(body: UpdateTaxRateRequest) => Promise<TaxRate | void> | voidSaves it yourself instead of the SDK. The dialog closes once it resolves and shows the error in place if it rejects.
submittingbooleanYour own save is running.
submitDisabledReasonstringWhy the rate can't be saved (a platform default, or the role); disables Save.
childrenstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
titlestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
descriptionstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ar.taxRates

Or edit the installed file directly: it is your code. See theming for colours and fonts.

Hooks

The SDK hooks this dialog uses. Use them directly from @dolfinai/react to build your own version.

useMessagesuseTaxRateMutations

Files

Written to your app by the install command:

  • components/dolfin/ar/edit-tax-rate-dialog.tsx 128 lines