{{ $branch->branch_name ?? 'Branch' }} - Sales Bills

@foreach($rows as $i => $row) {{-- @php $billedBy = '-'; if ($row->billed_by) { $billedBy = ctype_digit((string) $row->billed_by) ? ($counterNames[$row->billed_by] ?? '-') : $row->billed_by; } @endphp --}} @php $billedBy = '-'; if (in_array($row->billed_in, ['branch', 'branch_kot_web'])) { $billedBy = $row->branch?->branch_name ?? '-'; } elseif (in_array($row->billed_in, ['billing', 'billing_kot_web', 'app'])) { $billedBy = $counterNames[$row->billed_by] ?? '-'; } @endphp @endforeach
# Serial No Date Customer Phone Order ID Billed By Staff Payment Total Status
{{ $i + 1 }} {{ $row->daily_serial_number ?? '-' }} {{ $row->created_at->format('d-m-Y h:i A') }} {{ $row->customer_name ?: '-' }} {{ $row->customer_phone ?: '-' }} {{ $row->order_id }} {{ $billedBy }} {{ $row->staff->name ?? '-' }} {{ ucfirst($row->payment_mode) }} ₹ {{ number_format($row->total, 2) }} {{ ucfirst($row->status) }}
Total ₹ {{ number_format($rows->sum('total'), 2) }}