{{ $company ?? '' }}
General Ledger
Generated: {{ $generatedAt ?? '' }}
@php $blocks = []; if (isset($data['accounts'])) { $blocks = $data['accounts']; } else $blocks = [[ 'account' => $data['account'], 'opening_balance' => $data['opening_balance'], 'transactions' => $data['transactions'], 'closing_balance' => $data['closing_balance'], 'period' => $data['period'] ]]; @endphp @foreach ($blocks as $block) @php $acc = (object)$block['account']; $period = $block['period']; $opening = $block['opening_balance']; $closing = $block['closing_balance']; $transactions = $block['transactions']; $items = is_array($transactions) ? $transactions : (method_exists($transactions, 'items') ? $transactions->items() : ($transactions['data'] ?? [])); @endphp @foreach ($items as $t) @php $t = (object)$t; @endphp @endforeach
Account: {{ $acc->account_code }} - {{ $acc->account_name }}
Period: {{ $period['start'] }} to {{ $period['end'] }}
Date Journal No Reference Description Debit Credit Balance
Opening Balance - - {{ number_format($opening ?? 0, 2) }}
{{ $t->entry_date }} {{ $t->journal_no }} {{ $t->reference ?? '' }} {{ $t->line_description ?? $t->entry_description ?? '' }} {{ $t->debit > 0 ? number_format($t->debit, 2) : '-' }} {{ $t->credit > 0 ? number_format($t->credit, 2) : '-' }} {{ number_format($t->balance ?? 0, 2) }}
Closing Balance - - {{ number_format($closing ?? 0, 2) }}
@endforeach