Tally UI

ClosurePanel

ClosurePanel shows one store Z closure’s settled figures and corrections in a right-hand panel with an optional Recount… button.

Import

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

Usage

import { useStoreClosure } from '@tallyui/pos';

const state = useStoreClosure(connector, context, { last: registerId });
<ClosurePanel
  state={state}
  currency="NZD"
  online={online}
  onRecount={connector.closures ? openRecount : undefined}
  onClose={() => setPanelOpen(false)}
/>

The panel shows the settled cash variance, counted and expected amounts by tender, and a recorded-vs-settled notice when a correction changed a figure. When the store withholds figures, both the figures and the notice stay hidden; the list of corrections remains visible. Pass onRecount to show Recount…, including for a blind count. Offline, the button is disabled and the footer says “Connect to recount”. Unmount the panel to close it.

Props

PropTypeDefaultDescription
stateStoreClosureStaterequiredThe closure, loading state, error and refetch function from useStoreClosure
currencystringrequiredCurrency used to format the closure’s minor units
onlinebooleanrequiredWhen false, disables Recount… and shows the connection hint
onRecount() => void---Shows Recount… and is called when it is pressed; omit when the connector has no closures
onClose() => voidrequiredCalled by Close and when the panel is dismissed
scopestring---Optional line under the title, such as the register and closing time

On this page