MovementSheet
MovementSheet records paid-in, paid-out, or no-sale register movements with a reason, amount when applicable, and optional drawer action.
Import
import { MovementSheet } from '@tallyui/components';Usage
<MovementSheet
register={register}
type="paid_in"
currency="EUR"
onOpenChange={(open) => {
if (!open) setMovementType(null);
}}
/>Renders an open dialog for the chosen paid-in, paid-out, or no-sale movement with a reason input and a confirm button that names the amount, 'Put €5.00 in' or 'Take €5.00 out' ('Put cash in' / 'Take cash out' until an amount is valid; 'Record' for a no sale). No-sale movements hide the amount input, record zero, and call onOpenDrawer after recording when supplied.
The sheet offers v2's common reasons as chips that fill the reason field, and "Other…" clears the field and focuses it.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
register | ReturnType<typeof useRegisterSession> | required | Register session state and actions; records through register.actions.recordMovement |
type | MovementType | required | Movement type chosen before mounting the sheet |
currency | string | required | ISO 4217 code used to parse the entered amount into minor units |
onDone | (id: string, type: MovementType, amountMinor: number) => void | --- | Called with the recorded movement's ID, type, and amount |
onOpenChange | (open: boolean) => void | required | Receives dialog visibility changes; called with false after recording |
onOpenDrawer | () => void | --- | Called after recording a no-sale movement to open the drawer |
reasons | readonly string[] | v2's reasons for the type | Replaces the default reason chips for this type; [] shows only "Other…" |