feat(web): Z-отчёт смены — разбивка по товарам + предупреждение о >24ч (п.1/2)
Some checks are pending
Auto-tag / Create date-tag (push) Waiting to run
CI / Backend (.NET 8) (push) Waiting to run
CI / Web (React + Vite) (push) Waiting to run
CI / POS (WPF, Windows) (push) Waiting to run
Docker Web / Build + push Web (push) Waiting to run
Docker Web / Deploy Web on stage (push) Blocked by required conditions

Веб Z-отчёт показывает byProduct (товар/продано/выручка/возвраты) и баннер «смена
открыта дольше 24ч». Печать уже была (window.print()).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
nns 2026-10-09 06:48:00 +05:00
parent fd03700a58
commit 68bfb582e7

View file

@ -267,6 +267,8 @@ function ZReport({ id, onClose }: { id: string; onClose: () => void }) {
number?: string; openedAt?: string; closedAt?: string; openingFloat?: number
sales?: { cash: number; card: number }; returns?: { cash: number; card: number }
drawer?: { in: number; out: number }; expectedCash?: number; actualCash?: number; cashDifference?: number
overLimit24h?: boolean; durationHours?: number
byProduct?: { productId: string; name: string; soldQty: number; soldAmount: number; returnedQty: number; returnedAmount: number }[]
} | undefined
return (
<Modal open onClose={onClose} title={`Z-отчёт ${r?.number ?? ''}`}
@ -286,6 +288,28 @@ function ZReport({ id, onClose }: { id: string; onClose: () => void }) {
<tr><td>По факту</td><td>{fmt(r.actualCash)}</td></tr>
<tr className="font-semibold"><td>Разница</td><td>{fmt(r.cashDifference)}</td></tr>
</tbody></table>
{r.overLimit24h && (
<div className="text-xs text-amber-700 bg-amber-50 dark:bg-amber-950/40 dark:text-amber-300 rounded px-2 py-1">
⚠ Смена открыта дольше 24 ч ({r.durationHours} ч) — рекомендуется закрыть.
</div>
)}
{r.byProduct && r.byProduct.length > 0 && (
<div className="pt-2 border-t border-slate-200 dark:border-slate-700">
<div className="font-semibold mb-1">По товарам</div>
<table className="w-full text-xs"><thead>
<tr className="text-slate-500 text-left"><th>Товар</th><th className="text-right">Прод.</th><th className="text-right">Выручка</th><th className="text-right">Возвр.</th></tr>
</thead><tbody className="[&_td]:py-0.5">
{r.byProduct.map((p) => (
<tr key={p.productId}>
<td className="truncate max-w-[180px]">{p.name}</td>
<td className="text-right">{p.soldQty}</td>
<td className="text-right">{fmt(p.soldAmount)}</td>
<td className="text-right text-red-600">{p.returnedQty > 0 ? p.returnedQty : ''}</td>
</tr>
))}
</tbody></table>
</div>
)}
</div>
) : <p className="text-sm text-slate-500">Загрузка…</p>}
</Modal>