@include('accounting::admin.accounting._styles')

Ledger

Account-wise transaction history
{{-- Filter Form --}}
@if($account) {{-- Account summary --}}
₹{{ number_format($opening,2) }}
Opening
₹{{ number_format($entries->sum('debit'),2) }}
Total Debit
₹{{ number_format($entries->sum('credit'),2) }}
Total Credit
₹{{ number_format(abs($account->current_balance),2) }} {{ $account->current_balance >= 0 ? 'Dr' : 'Cr' }}
Closing
{{-- Ledger table --}}

{{ $account->account_code }} — {{ $account->account_name }}

{{ $account->group?->name }}
{{-- Opening balance row --}} @php $runBal = $opening; $nature = $account->group?->nature ?? 'debit'; @endphp @forelse($entries as $entry) @php $d = (float)$entry->debit; $c = (float)$entry->credit; $runBal += $nature === 'debit' ? ($d - $c) : ($c - $d); @endphp @empty @endforelse @if($entries->isNotEmpty()) @endif
Date Voucher # Type Narration Debit (₹) Credit (₹) Balance
Opening Balance ₹ {{ number_format(abs($opening),2) }} {{ $opening >= 0 ? 'Dr' : 'Cr' }}
{{ $entry->voucher->voucher_date->format('d M Y') }} {{ $entry->voucher->voucher_number }} {{ $entry->voucher->type_label }} {{ $entry->narration ?: $entry->voucher->narration ?: '—' }} {{ $d > 0 ? '₹ '.number_format($d,2) : '' }} {{ $c > 0 ? '₹ '.number_format($c,2) : '' }} ₹ {{ number_format(abs($runBal),2) }} {{ $runBal >= 0 ? 'Dr' : 'Cr' }}
No transactions found for this account in the selected period.
Closing Balance ₹ {{ number_format($entries->sum('debit'),2) }} ₹ {{ number_format($entries->sum('credit'),2) }} ₹ {{ number_format(abs($runBal ?? $opening),2) }} {{ ($runBal ?? $opening) >= 0 ? 'Dr' : 'Cr' }}
@else

Select an account above to view its ledger.

@endif