Tally UI

RegisterPanel

Register dialog with session figures, cash movements, and closing controls

Import

import { RegisterPanel } from '@tallyui/components';

Usage

<RegisterPanel
  register={register}
  currency="EUR"
  registerName="Front counter"
  open={registerOpen}
  onOpenChange={setRegisterOpen}
/>

Renders a register dialog with session sales count, movement actions, an expandable movement list with Undo, and Close register. Expected amounts and movement details are hidden during blind counting; nothing renders without a session or last closure.

When the store refused a closure's manager approval (register.approvalNeeded), the panel shows an "Approval needed" card. With reapprove, its Approve button asks the host for a new approval and sends it with register.actions.reapproveClosure; without it, the card explains and has no button.

Props

PropTypeDefaultDescription
registerReturnType<typeof useRegisterSession>requiredSession, expected figures, sales count, blind state, movements, last closure, and actions
currencystringrequiredISO 4217 code used for money display and movement amounts
registerNamestring---Panel title; the heading reads “Register” when omitted
openbooleanrequiredWhether the dialog is open
onOpenChange(open: boolean) => voidrequiredReceives dialog visibility changes, including false after starting the closing count
reapprove(needed: ApprovalNeeded) => Promise<{ approvedBy: string; approval: string } | null>---The host's approval for a refused closure; gets register.approvalNeeded, and its result goes to reapproveClosure. null leaves the closure as it is
classNamestring---Additional styles for the dialog content
presentation'dialog' | 'side''dialog''dialog' is the centred panel; 'side' is WCPOS v2's right-hand sheet with the cash expected, session sales, drawer ledger, Other tenders and a Print X-report / Close register footer
storeNamestring---'side': the store's name, first in the header line
onPrintXReport() => void | Promise<void>---'side': builds and prints the X-report; a rejection shows “Printing failed. Try again.”; without it there is no button
now() => Datenew Date()'side': the clock for the session's age
openedBy{ name: string; avatar?: string }---'side': the session's opener. Its name ends the header line in place of “Cashier”, and an “opened HH:MM by” line with its avatar (or initials) sits under the drawer figure
movementReasonsPartial<Record<MovementType, readonly string[]>>---Replaces MovementSheet's reason chips per movement type; a type left out keeps v2's defaults

On this page