Ledger
@if($accountHead)
Account: {{ $accountHead->name }}

Code: {{ $accountHead->account_code }}

@php $balance = 0; @endphp @foreach($ledger as $entry) @php $balance += $entry->entry_type === 'debit' ? $entry->amount : -$entry->amount; @endphp @endforeach
Date Voucher No Description Debit Credit Balance
{{ $entry->voucher->date->format('Y-m-d') }} {{ $entry->voucher->voucher_no }} {{ $entry->note }} {{ $entry->entry_type === 'debit' ? number_format($entry->amount, 2) : '-' }} {{ $entry->entry_type === 'credit' ? number_format($entry->amount, 2) : '-' }} {{ number_format($balance, 2) }}
@else
Please select an account head to view the ledger.
@endif