@php $debit = 0; $credit = 0; @endphp @foreach ($transactions as $key => $value) @if ($value->txn_log == 'DEBIT') @else @endif @if ($value->txn_log == 'CREDIT') @else @endif @php if ($value->txn_log == 'DEBIT') { $debit += $value->amount; } if ($value->txn_log == 'CREDIT') { $credit += $value->amount; } @endphp @endforeach
Transaction Date Value Date Transaction Description Debits Credits Balance
{{ $value->transaction_on }} {{ $value->transaction_on }} {{ $value->txn_decriptions }}{{ number_format($value->amount, 2) }}{{ number_format($value->amount, 2) }}{{ number_format($value->closing_amount, 2) }}

Summary of Transactions

Debits @php echo number_format($debit,2); @endphp
Credits @php echo number_format($credit,2); @endphp