Tally UI

ClosuresRoom

Browse closures and open tills for a business-day range and export settled closure figures as CSV.

Import

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

Usage

<ClosuresRoom rows={rows} sessions={sessions} currency="GBP" timezone="Europe/London"
  scopeFrom={from} scopeTo={to} status={status} hasMore={hasMore} onLoadMore={loadMore}
  onRetry={retry} onSelect={setSelected} panel={panel} onExportCsv={saveCsv} />

ClosuresRoom places ClosureStats above ClosureList, with a SessionCard for each open or counting till in scope. The host supplies the data, handles selection and can pass a ClosurePanel to display after the scrollable list. A cashier filter draws and counts only sessions opened by that cashier.

With onExportCsv, the room shows Export CSV. The Open tab disables it because open sessions are not closures. All and Closed export the loaded closure rows to closures-<scopeFrom>-<scopeTo>.csv. The columns are Business day, Closure, Register, Store, Opened, Closed and Closer, then Expected, Counted and Variance for each tender in first-seen order, and finally Status. Amounts use the currency’s decimal precision and include settled corrections. Withheld figures leave tender cells blank. Unsynced takes precedence over Corrected. If the host’s export fails, the room shows “Export failed. Try again.”

Ready shows the list or its empty state. The other statuses show “Loading...”, “Unavailable offline”, “Report access is not permitted” or “Could not load closures”. Error shows Retry instead of Load more. Otherwise, when another page is available, the footer shows Load more and the stats indicate that counts are partial.

Props

PropTypeDefaultDescription
rowsreadonly ClosureRow[]requiredLoaded closures for the scope, stamped with their business days
sessionsreadonly OpenSessionRow[][]Open or counting tills in scope
currencystringrequiredISO currency for display and export
timezonestringrequiredIANA time zone or device for day headings and row times
now() => DateCurrent timeClock for Today and Yesterday
scopeFromstringrequiredFirst business day, YYYY-MM-DD
scopeTostringrequiredLast business day, inclusive
statusClosuresStatusrequiredloading, ready, unavailable, denied or error
hasMorebooleanfalseMore closure rows can be loaded
onLoadMore() => void---Request the next page
onRetry() => void---Retry a failed read
blindbooleanfalseHide the stats and session expected cash; disable session printing
cashierIdstring---Show and count only this cashier’s sessions
storeNamestring---CSV store label; otherwise the closure’s store ID is used
onSelect(row: ClosureRow) => void---Select an available closure
panelReactNode---Host’s panel for the selected closure
onExportCsv(csv: string, filename: string) => void | Promise<void>---Show Export CSV and deliver its contents and filename to the host
onPrintXReport(session: OpenSessionRow) => void | Promise<void>---Show the session’s Print X-report button and request a print

On this page