@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
{{ $loop->iteration }} |
{{ $bank_payment->banks->name }} |
{{ $previousBalance }} |
{{ $totalCredit }} |
{{ $totalDebit }} |
{{ $balance }} |
@endforeach