General Ledger

From {{ \Carbon\Carbon::parse($data['date_from'])->format('F j, Y') }} to {{ \Carbon\Carbon::parse($data['date_to'])->format('F j, Y') }}

@php $totalDebit = 0; $totalCredit = 0; @endphp @foreach($data['accounts'] as $account) @php $totalDebit += $account->period_debit; $totalCredit += $account->period_credit; $isExpanded = in_array($account->id, $expandedAccounts ?? []); $moves = $isExpanded ? $getAccountMoves($account->id) : []; $runningBalance = $account->opening_balance; @endphp {{-- Account Header --}} {{-- Opening Balance --}} @if($account->opening_balance != 0 && $isExpanded) @endif {{-- Move Lines --}} @if($isExpanded) @foreach($moves as $move) @php $runningBalance += $move['debit'] - $move['credit']; @endphp @endforeach @endif @endforeach {{-- Totals --}}
Account Date Communication Partner Debit Credit Balance
Opening Balance {{ \Carbon\Carbon::parse($data['date_from'])->format('m/d/Y') }} {{ number_format($account->opening_balance, 2) }}
{{ $move['move_name'] }} {{ \Carbon\Carbon::parse($move['date'])->format('m/d/Y') }} {{ $move['name'] ?? '' }} {{ $move['partner_name'] ?? '' }} {{ $move['debit'] > 0 ? number_format($move['debit'], 2) : '' }} {{ $move['credit'] > 0 ? number_format($move['credit'], 2) : '' }} {{ number_format($runningBalance, 2) }}
Total {{ number_format($totalDebit, 2) }} {{ number_format($totalCredit, 2) }}