@extends('layouts.app') @section('title', 'Close register - ' . setting('system_name')) @section('content') @php // Blind close: cashiers count the drawer without seeing what the system expects $isAdmin = auth()->user()->hasRole('admin') || auth()->user()->hasRole('super_admin'); // One switch in Loss Prevention settings: when on, everyone must count the drawer and non-admins can't see the expected cash $countRequired = \App\Models\IntegrityEvent::cashCountRequired(); $blind = $countRequired && !$isAdmin; $money = fn ($v, $prefix = 'MWK ') => $blind ? '••••••' : $prefix . number_format($v, 2); // The shop's payment methods (Settings → Payment methods), cheque totals are kept under "cheques" $methods = collect(\App\Helpers\PaymentMethods::definitions()) ->map(fn ($m) => ['key' => $m['key'] === 'cheque' ? 'cheques' : $m['key'], 'label' => $m['label'], 'icon' => $m['icon'], 'color' => $m['color']]) ->values()->all(); $methods[] = ['key' => 'cash_and_card', 'label' => 'Other', 'icon' => 'bi-intersect', 'color' => '#334155']; // Anything else paid in this shift (e.g. a method since deleted) still gets a line foreach (array_keys($counts) as $countKey) { $key = substr($countKey, 6); if ($key !== 'total_sales' && !in_array($key, array_column($methods, 'key'), true)) { $methods[] = ['key' => $key, 'label' => ucwords(str_replace('_', ' ', $key)), 'icon' => 'bi-wallet', 'color' => '#7c3aed']; } } $used = collect($methods)->filter(fn ($m) => ($counts['count_' . $m['key']] ?? 0) > 0)->values(); $methodTotal = max(1, $used->sum(fn ($m) => $totals['total_' . $m['key']] ?? 0)); $expectedCash = ($totals['total_cash'] ?? 0) + $register->opening_cash; $minutesOpen = (int) $register->opened_at->diffInMinutes(now()); @endphp
@if($countRequired) Count all notes and coins in the drawer, including the opening float. Do not copy a figure from the screen. @else Check the drawer against the expected amount, then close the register. @endif
| Method | Count | Total |
|---|---|---|
| {{ $method['label'] }} | {{ $counts['count_'.$method['key']] }} | {{ $money($totals['total_'.$method['key']], '') }} |
| No sales recorded | ||
*** END OF REPORT ***