@extends('layouts.dashboard') @section('content') @php /** * Vendor → Cash drawer: till sessions with a BLIND cash-up. * * While a session is open and uncounted the controller does not compute expected cash and * does not send the components it could be derived from, so there is nothing on this page * for an operator to copy into the count field. Counting is the first step, not the last. * * @var array|null $open the open shift row (or null) * @var array|null $openTotals ledger totals — present ONLY once the drawer is counted * @var float|null $expected expected cash — present ONLY once the drawer is counted * @var float|null $declared what the operator counted, this cash-up * @var float|null $variance counted − expected, once both exist * @var array $movementCounts how many movements of each kind this session * @var array $openMovements recent movements of the open shift * @var array|null $session non-cash trading figures for the open session * @var array $closed closed sessions (newest first) * @var array $trendChart @var array $trendMeta @var array $trendStats */ $typeLabels = ['sale' => t_raw('vendor.shifts.type_sale'), 'refund' => t_raw('vendor.shifts.type_refund'), 'payin' => t_raw('vendor.shifts.type_payin'), 'payout' => t_raw('vendor.shifts.type_payout'), 'drop' => t_raw('vendor.shifts.type_drop')]; $typePills = ['sale' => 'qm-pill-green', 'refund' => 'qm-pill-red', 'payin' => 'qm-pill-blue', 'payout' => 'qm-pill-amber', 'drop' => 'qm-pill-grey']; $declared = $declared ?? null; $counted = $declared !== null; // the one switch this whole screen turns on $movementCounts = $movementCounts ?? []; $session = $session ?? null; $trendStats = $trendStats ?? ['short' => 0, 'over' => 0, 'balanced' => 0, 'worst' => 0.0, 'sessions' => 0]; // The shift history takes no filters beyond the restaurant scope, so the export needs no query string. $qs = ''; @endphp @php /* .qm-d2: the dashboard density standard (app.css §35) */ @endphp
{!! t_raw('vendor.shifts.drawer_open_sub', [':time' => fmt_datetime($open['opened_at'])]) !!}
{{ t_raw('vendor.shifts.cashup_blind_hint') }}
@else| {{ t_raw('common.when') }} | {{ t_raw('common.type') }} | {{ t_raw('common.amount') }} | {{ t_raw('vendor.shifts.col_order') }} | {{ t_raw('vendor.shifts.col_by') }} | {{ t_raw('common.note') }} |
|---|---|---|---|---|---|
| {!! fmt_clock($m['created_at']) !!} | {{ $typeLabels[$m['type']] ?? ucfirst((string) $m['type']) }} | @php /* The audit trail stays fully readable while blind — who did what, when and why — because none of it is the number under control. The amounts are the number under control, so they wait for the count. */ @endphp@if ($counted){{ in_array($m['type'], ['refund', 'payout', 'drop'], true) ? '−' : '+' }}{{ money($m['amount']) }}@else{{ t_raw('vendor.shifts.hidden_until_counted') }}@endif | {!! or_dash($m['order_number'] ?? null) !!} | {!! or_dash($m['user_name'] ?? null) !!} | {!! or_dash($m['note'] ?? null) !!} |
{{ t_raw('vendor.shifts.drawer_closed_sub') }}
| {{ t_raw('vendor.shifts.col_opened') }} | {{ t_raw('vendor.shifts.col_closed') }} | {{ t_raw('vendor.shifts.col_float') }} | {{ t_raw('vendor.shifts.col_expected') }} | {{ t_raw('vendor.shifts.col_counted') }} | {{ t_raw('vendor.shifts.col_variance') }} | {{ t_raw('common.actions') }} |
|---|---|---|---|---|---|---|
| {!! fmt_datetime($s['opened_at']) !!} {{ (string) ($s['opened_by'] ?? '') }} |
{!! fmt_datetime($s['closed_at']) !!} {{ (string) ($s['closed_by'] ?? '') }} |
{{ money($s['opening_float']) }} | {!! $s['expected_cash'] !== null ? money($s['expected_cash']) : dash() !!} | {!! $s['counted_cash'] !== null ? money($s['counted_cash']) : dash() !!} |
@if ($v == 0.0){{ t_raw('vendor.shifts.balanced_pill') }}
@elseif ($v > 0){{ money($v) }} {{ t_raw('vendor.shifts.variance_over_suffix') }}
@else{{ money(abs($v)) }} {{ t_raw('vendor.shifts.variance_short_suffix') }}@endif
@if (!empty($s['variance_reason'])) {{ (string) $s['variance_reason'] }} @endif
|
{{ t_raw('vendor.shifts.zreport_link') }} |