@foreach ($ledger as $index => $row) @endforeach @php $isDue = $closingBalance > 0; $isPayable = $closingBalance < 0; @endphp
SL Date File No Name Particular Debit Credit Balance
{{ $index + 1 }} {{ $row['date'] }} {{ $row['file_no'] }} {{ $row['file_name'] }} {{ $row['particular'] }} {{ number_format($row['debit'], 2) }} {{ number_format($row['credit'], 2) }} {{ number_format($row['balance'], 2) }}
@if ($isDue) Total Due Balance @elseif ($isPayable) Total Payable to Agent @else Balance Settled @endif {{ number_format(abs($closingBalance), 2) }}