@if(count($bills) > 0) @php $idx = 1; $total_prev_balance = 0; $total_debit = 0; $total_edit = 0; $total_balance = 0; //$debit_summaries = array(); //$edit_summaries = array(); //$balance_summaries = array(); $summaries = array(); @endphp @foreach($bills as $no_bill => $bill) @php $index_bill = 0; $balance = 0; $bill_balance = 0; @endphp @foreach($bill as $key => $item_bill) @php $bill_balance = $balance; $index_bill++; $idx++; @endphp @endforeach @php $total_balance += $bill_balance; @endphp @endforeach @if(count($bills) > 0) @php $total_summary_debit = 0; $total_summary_credit = 0; @endphp @foreach($summaries as $key => $summary) @php $total_summary_credit += array_sum($summary['credit']); $total_summary_debit += array_sum($summary['debit']); @endphp @endforeach {{-- @foreach($edit_summaries as $key => $edit_summary) @endforeach --}} @endif @else @endif
Name RmNo BillNo Description Prev Balance Debit Credit Balance Arrival Transaction Date
{{ $index_bill == 0 ? $item_bill['name'] : '' }} {{ $index_bill == 0 ? $item_bill['rmno'] : '' }} {{ $index_bill == 0 ? $item_bill['billno'] : '' }} {{ $item_bill['description'] }} {{ (array_sum($item_bill['prev_balance'])) }} @php $total_prev_balance += array_sum($item_bill['prev_balance']); @endphp {{ (array_sum($item_bill['debit'])) }} @php $total_debit += array_sum($item_bill['debit']); $summaries[$key]['label'] = $item_bill['description']; $summaries[$key]['debit'][] = array_sum($item_bill['debit']); @endphp {{ (array_sum($item_bill['credit']) * -1) }} @php $total_edit += array_sum($item_bill['credit']); $summaries[$key]['credit'][] = array_sum($item_bill['credit']) * -1; @endphp @php $balance += array_sum($item_bill['prev_balance']) + array_sum($item_bill['debit']) + array_sum($item_bill['credit']); $bill_balance += $balance; @endphp {{ ($balance) }} {{ $item_bill['arrival'] }} {{ $item_bill['departure'] }} {{ $item_bill['transaction_date'] }}
Total {{($total_prev_balance)}} {{($total_debit)}} {{($total_edit * -1)}} {{($total_balance)}}
Outstanding {{($total_balance)}}
Stored Guest Ledger Amount {{($total_balance)}}
Summary Of Transaction
{{ $summary['label'] }} {{ (array_sum($summary['debit'])) }} {{ (array_sum($summary['credit'])) }} {{ (array_sum($summary['debit']) - array_sum($summary['credit'])) }}
Total {{ ($total_summary_debit) }} {{ ($total_summary_credit) }} {{ ($total_summary_debit - $total_summary_credit) }}
{{ $key }} {{ (array_sum($edit_summary)) }} {{ (array_sum($balance_summaries[$key])) }}

No Transactions