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
| Prop | Type | Default | Description |
|---|---|---|---|
register | ReturnType<typeof useRegisterSession> | required | Session, expected figures, sales count, blind state, movements, last closure, and actions |
currency | string | required | ISO 4217 code used for money display and movement amounts |
registerName | string | --- | Panel title; the heading reads “Register” when omitted |
open | boolean | required | Whether the dialog is open |
onOpenChange | (open: boolean) => void | required | Receives 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 |
className | string | --- | 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 |
storeName | string | --- | '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 | () => Date | new 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 |
movementReasons | Partial<Record<MovementType, readonly string[]>> | --- | Replaces MovementSheet's reason chips per movement type; a type left out keeps v2's defaults |