Logo @if(!$is_pdf) Back @endif
{{ $company->company_name }}
{{ $company->address }}, {{ $company->city }}, {{ $company->state }}
Phone: {{ $company->phone1 }}
GST NO: {{ $company->gst_no }}

Today's Cash

@if(!$is_pdf)
Reset
@endif
@php $grandTotal = 0; @endphp @foreach($grouped_data as $paymentMethod => $customers) @foreach($customers as $customerName => $details) @php $customerTotal = 0; // Group first by order_id, then inside group by receipt_id $ordersGrouped = collect($details['orders'])->groupBy('order_id'); @endphp @foreach($ordersGrouped as $orderId => $orderGroup) @php $orderRowCount = $orderGroup->count(); $firstOrderRow = true; @endphp @php $receiptGroups = $orderGroup->groupBy('receipt_id'); @endphp @foreach($receiptGroups as $receiptId => $transactions) @php $receiptRowCount = count($transactions); $firstReceiptRow = true; @endphp @foreach($transactions as $txn) {{-- Order No (rowspan) --}} @if($firstOrderRow) @php $firstOrderRow = false; @endphp @endif {{-- Receipt ID (Bill No) (rowspan) --}} @if($firstReceiptRow) @php $firstReceiptRow = false; @endphp @endif @php $customerTotal += floatval(str_replace(',', '', $txn['amount'])); @endphp @endforeach @endforeach @endforeach {{-- Customer Total --}} @php $grandTotal += $customerTotal; @endphp @endforeach @endforeach {{-- Grand Total --}}
Order No Customer Name Transaction Date Amount Bill No Remarks Receipt Type
{{ strtoupper($paymentMethod) }}
{{ ucfirst($customerName) }}
{{ $txn['order_id'] }} {{ ucfirst($customerName) }}{{ date('d-m-Y', strtotime($txn['transaction_date'])) }} {{ number_format(floatval(str_replace(',', '', $txn['amount'])), 2) }}{{ $txn['receipt_id'] }}{{ $txn['remark'] }} {{ $txn['rcpt_type'] }}
Subtotal for {{ ucfirst($customerName) }}: {{ number_format($customerTotal, 2) }}
Grand Total: {{ number_format($grandTotal, 2) }}

@if(!$is_pdf) Download @endif