ClosureStats
Show session counts, drawer discrepancies and cash totals above a closures list.
Import
import { ClosureStats, type ClosureRow } from '@tallyui/components';Usage
const rows: ClosureRow[] = closures.map((closure) => ({
closure,
day: closure.businessDay ?? openingDayInStoreTime(closure.openedAt, timezone),
openingFloatMinor: closure.openingFloat?.counted ?? closure.openingFloat?.expected,
}));
<ClosureStats rows={rows} sessions={sessions} currency="GBP" />A store closure carries openingFloat when the store recorded one; counted wins over expected, as in WCPOS v2.
If any closure withholds its figures, all four money values show a dash rather than a partial total. The result note is empty then too. A missing closure opening float hides cash at open and cash activity; a session missing both counted and expected floats hides only cash at open. A zero discrepancy is a dash, as is cash at close when nothing has closed. When the read is unavailable, unknown dashes every value, including sessions, and clears the notes. A closure with no expected cash and no recorded variance counts as exact, as in WCPOS v2.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
rows | readonly ClosureRow[] | required | Closures with host-stamped opening floats in minor units |
sessions | readonly OpenSessionRow[] | required | Open sessions in scope, using the counted opening float in preference to the expected float |
currency | string | required | ISO currency of the amounts in minor units |
blind | boolean | false | Hide the entire strip |
partial | boolean | false | Show the number of loaded closures and leave the discrepancy uncoloured while more pages remain |
unknown | boolean | false | Keep the strip visible without reporting figures or counts |