Tally UI

SalesCards

Show the Sales room's report cards, from orders and payments to taxes and refunds, over one SalesFigures result.

Import

import { SalesCards, type SalesCardId } from '@tallyui/components';

Usage

<SalesCards figures={figures} currency="NZD" onOpenCard={openPanel}
  cashierName={(id) => cashierNames.get(id)} hide={['brands']} />

The cards appear in this order: Orders, Payments, Where sold, Top products, Categories, Brands, Cashiers, Taxes and Refunds. Brands shows only when some line has a brand or a cost. Shares beyond the first five rows fold into Other, and Top products lists the first four products. An unknown figure, such as a margin with no costed line, shows —, never 0. When onOpenCard is given, each card's head becomes a button with a chevron. SalesRoom renders these cards, and SalesCardPanel shows a card's detail.

Props

PropTypeDefaultDescription
figuresSalesFiguresrequiredThe period's figures
currencystringrequiredCurrency of the figures' minor units
onOpenCard(card: SalesCardId) => void—Opens the card's panel; omit for cards without a button
cashierName(id: string) => string | undefined—A cashier id's display name; unknown or absent ids show “Unknown”
hideSalesCardId[]—Cards to leave out, for example one the backend's report cannot fill; the rest keep their order
allLeftOutbooleanfalseThe host left out every order of the period; the Orders card reads Every order is left out while it counts none

SalesCardId

type SalesCardId = 'orders' | 'payments' | 'where-sold' | 'products' | 'categories' | 'brands' | 'cashiers' | 'taxes' | 'refunds';