@props(['expenses', 'activeTab'])
Monthly Expenses
@php $totalAmountPaid = $expenses->sum('amount_paid'); $totalCredit = $expenses->sum('credit'); @endphp
@php $runningBalance = 0; @endphp @foreach($expenses as $expense) @php $runningBalance += $expense->credit - $expense->amount_paid; @endphp @endforeach
Name Task Amount Paid Credit Current Account Due Date Notes Actions
{{ $expense->name }} {{ $expense->task }} {{ number_format($expense->amount_paid, 2) }} {{ number_format($expense->credit, 2) }} {{ number_format($runningBalance, 2) }} {{ \Carbon\Carbon::parse($expense->due_date)->format('Y-m-d') }} {{ $expense->notes }}
@csrf @method('DELETE')
Totals {{ number_format($totalAmountPaid, 2) }} {{ number_format($totalCredit, 2) }} {{ number_format($totalCredit - $totalAmountPaid, 2) }}
Net Balance (Credit - Amount Paid) {{ number_format($totalCredit - $totalAmountPaid, 2) }}
@include('invoices.partials.modals.create-expense-modal')