{{ $formatted_date }} : @lang('lang.date')
@foreach ($bank_payments as $bank_payment) @php $totalCredit = $bank_payment->total_credit_match; $totalDebit = $bank_payment->total_debit_match; $previousBalance = $bank_payment->banks->previous_balance; if ($totalCredit > 0 && $totalDebit > 0) { $balance = $previousBalance + $totalCredit; $balance = $balance - $totalDebit; } elseif ($totalCredit >= 0 || $totalDebit >= 0) { $balance = $previousBalance + $totalCredit; $balance = $balance - $totalDebit; } @endphp @endforeach
S.no @lang('lang.name') @lang('lang.previous_balance') @lang('lang.credit_payment') @lang('lang.debit_payment') @lang('lang.balance')
{{ $loop->iteration }} {{ $bank_payment->banks->name }} {{ $previousBalance }} {{ $totalCredit }} {{ $totalDebit }} {{ $balance }}