D-RESTAURANT SALES REPORT

Generated on: {{ date('d-M-Y H:i:s') }}

@if(!empty(array_filter($filters)))

Applied Filters:

@if(!empty($filters['from']) && !empty($filters['to']))

Date Range: {{ \Carbon\Carbon::parse($filters['from'])->format('d M Y') }} to {{ \Carbon\Carbon::parse($filters['to'])->format('d M Y') }}

@endif @if(!empty($filters['waiter_id'])) @php $waiter = \App\Models\User::find($filters['waiter_id']); @endphp

Waiter: {{ $waiter ? $waiter->name : 'N/A' }}

@endif @if(!empty($filters['cashier_id'])) @php $cashier = \App\Models\User::find($filters['cashier_id']); @endphp

Cashier: {{ $cashier ? $cashier->name : 'N/A' }}

@endif @if(!empty($filters['payment_type']))

Payment Type: {{ $filters['payment_type'] }}

@endif @if(!empty($filters['status']))

Status: {{ ucfirst($filters['status']) }}

@endif

Total Records: {{ $sales->count() }}

@endif @foreach($sales as $sale) @endforeach
ID Date Waiter Cashier Subtotal Tax Total Payment Status
{{ $sale->id }} {{ $sale->created_at->format('d-m-Y H:i') }} {{ $sale->waiter ? $sale->waiter->name : '—' }} {{ $sale->cashier ? $sale->cashier->name : '—' }} {{ number_format($sale->subtotal) }} {{ number_format($sale->tax) }} {{ number_format($sale->total) }} {{ $sale->payment_type }} {{ ucfirst($sale->status) }}

Subtotal Total: Tsh {{ number_format($totals['subtotal']) }}

Tax Total: Tsh {{ number_format($totals['tax']) }}

Grand Total: Tsh {{ number_format($totals['total']) }}