Tally UI

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

PropTypeDefaultDescription
rowsreadonly ClosureRow[]requiredClosures with host-stamped opening floats in minor units
sessionsreadonly OpenSessionRow[]requiredOpen sessions in scope, using the counted opening float in preference to the expected float
currencystringrequiredISO currency of the amounts in minor units
blindbooleanfalseHide the entire strip
partialbooleanfalseShow the number of loaded closures and leave the discrepancy uncoloured while more pages remain
unknownbooleanfalseKeep the strip visible without reporting figures or counts

On this page