Sales Report

Generated: {{ now()->format('d M Y H:i') }}

@php $grandTotal = 0; @endphp @foreach(($data['items'] ?? $data) as $i => $sale) @php $item = is_array($sale) ? $sale : $sale->toArray(); $grandTotal += (float)($item['total'] ?? 0); @endphp @endforeach
# Sale Number Date Patient Store Staff Status Subtotal Tax Discount Total Paid
{{ $i + 1 }} {{ $item['sale_number'] ?? '-' }} {{ isset($item['completed_at']) ? \Carbon\Carbon::parse($item['completed_at'])->format('d M Y') : '-' }} {{ $item['patient']['first_name'] ?? '' }} {{ $item['patient']['last_name'] ?? 'Walk-in' }} {{ $item['store']['name'] ?? '-' }} {{ $item['staff']['name'] ?? '-' }} {{ ucfirst($item['status'] ?? '-') }} {{ number_format((float)($item['subtotal'] ?? 0), 2) }} {{ number_format((float)($item['tax_total'] ?? 0), 2) }} {{ number_format((float)($item['discount_total'] ?? 0), 2) }} {{ number_format((float)($item['total'] ?? 0), 2) }} {{ number_format((float)($item['amount_paid'] ?? 0), 2) }}
Grand Total {{ number_format($grandTotal, 2) }}