Recent Transactions
(Last 20)
@if($account->transactions->count() > 0)
| Date |
Reference |
Description |
Debit |
Credit |
Balance |
@php $runningBalance = $account->opening_balance; @endphp
@foreach($account->transactions->take(20) as $transaction)
@php
if ($transaction->type == 'debit') {
$runningBalance += $transaction->amount;
} else {
$runningBalance -= $transaction->amount;
}
@endphp
| {{ \Carbon\Carbon::parse($transaction->date)->format('d M Y') }} |
{{ $transaction->reference }} |
{{ $transaction->description ?: '-' }} |
@if($transaction->type == 'debit')
Rs. {{ number_format($transaction->amount, 2) }}
@else
-
@endif
|
@if($transaction->type == 'credit')
Rs. {{ number_format($transaction->amount, 2) }}
@else
-
@endif
|
Rs. {{ number_format(abs($runningBalance), 2) }}
|
@endforeach
@if($account->transactions->count() > 20)
@endif
@else
No transactions found for this account.
@endif