@php $ledger = $ledger ?? []; $isAllLedger = ($ledger['mode'] ?? 'single') === 'all'; $groups = $ledger['groups'] ?? []; $entries = $ledger['entries'] ?? collect(); $totals = $ledger['totals'] ?? []; $hasGroups = $isAllLedger && !empty($groups); $balanceLabel = function (array $rowTotals, string $prefix) use ($money) { $debit = (float) ($rowTotals[$prefix . '_debit'] ?? 0); $credit = (float) ($rowTotals[$prefix . '_credit'] ?? 0); if ($debit > 0) { return $money($debit) . ' Dr'; } if ($credit > 0) { return $money($credit) . ' Cr'; } return '—'; }; @endphp
| Date | Voucher | Reference / Narration | Name | Dimension | Split Accounts | Debit | Credit | Balance |
|---|---|---|---|---|---|---|---|---|
| {{ $accountTitle }} | ||||||||
| {{ \Carbon\Carbon::parse($dateFrom)->subDay()->format('d M Y') }} | Opening Balance | {{ $money($groupTotals['opening_debit'] ?? 0) }} | {{ $money($groupTotals['opening_credit'] ?? 0) }} | {{ $balanceLabel($groupTotals, 'opening') }} | ||||
| Total {{ $account->name }} | {{ $money($groupTotals['period_debit'] ?? 0) }} | {{ $money($groupTotals['period_credit'] ?? 0) }} | {{ $balanceLabel($groupTotals, 'closing') }} | |||||
| No ledger movement found. | ||||||||
| {{ \Carbon\Carbon::parse($dateFrom)->subDay()->format('d M Y') }} | Opening Balance | {{ $money($totals['opening_debit'] ?? 0) }} | {{ $money($totals['opening_credit'] ?? 0) }} | {{ $balanceLabel($totals, 'opening') }} | ||||
| No ledger movement found. | ||||||||
| Current Period Total | {{ $money($totals['period_debit'] ?? 0) }} | {{ $money($totals['period_credit'] ?? 0) }} | ||||||