{{ $formatted_date }} : @lang('lang.date')
@foreach ($supplier_payments as $supplier_payment) @php $totalCredit = $supplier_payment->total_credit_match; $totalDebit = $supplier_payment->total_debit_match; $previousBalance = $supplier_payment->suppliers->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 }} {{ $supplier_payment->suppliers->name }} {{ $previousBalance }} {{ $totalCredit }} {{ $totalDebit }} {{ $balance }}