@extends('layouts.app') @section('customcss') @endsection @section('content')

Balance History - {{ $fund->name }}

Initial Amount

UGX {{ number_format($fund->initial_amount, 2) }}

Current Balance

UGX {{ number_format($fund->current_balance, 2) }}

Total Expenses

UGX {{ number_format($fund->total_expenses, 2) }}

Total Replenishments

UGX {{ number_format($fund->total_replenishments, 2) }}

Balance Timeline
@if($history->count() > 0)
Transaction History
@php $previousBalance = $fund->initial_amount; @endphp @foreach($history as $index => $item) @endforeach
# Date Description Type Amount Balance After Change
{{ $index + 1 }} {{ \Carbon\Carbon::parse($item['date'])->format('M d, Y') }} {{ $item['description'] }} {{ ucfirst($item['type']) }} {{ $item['type'] === 'expense' ? '-' : '+' }}UGX {{ number_format($item['amount'], 2) }} UGX {{ number_format($item['balance'], 2) }} @php $change = $item['balance'] - $previousBalance; $previousBalance = $item['balance']; @endphp {{ $change >= 0 ? '+' : '' }}{{ number_format($change, 2) }}
@else
No Balance History Available

No approved transactions with balance_after records found.

@endif
@endsection @section('customjs') @endsection