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

Fund Diagnostics - {{ $fund->name }}

Total Transactions

{{ $diagnostics['total_transactions'] }}

Approved

{{ $diagnostics['approved_count'] }}

Pending

{{ $diagnostics['pending_count'] }}

Rejected

{{ $diagnostics['rejected_count'] }}

Financial Summary

Initial Amount

UGX {{ number_format($diagnostics['initial_amount'], 2) }}

Total Expenses

UGX {{ number_format($diagnostics['total_expenses'], 2) }}

Total Replenishments

UGX {{ number_format($diagnostics['total_replenishments'], 2) }}

Net Change

{{ $diagnostics['net_change'] >= 0 ? '+' : '' }}UGX {{ number_format($diagnostics['net_change'], 2) }}

Balance Verification
Current Balance (System): UGX {{ number_format($diagnostics['current_balance'], 2) }}
Calculated Balance: UGX {{ number_format($diagnostics['calculated_balance'], 2) }}
Difference: UGX {{ number_format($diagnostics['calculated_balance'] - $diagnostics['current_balance'], 2) }}
@if(abs($diagnostics['calculated_balance'] - $diagnostics['current_balance']) >= 0.01)
Balance mismatch detected! Use auto-reconcile to fix.
@else
Balance is correct!
@endif
Transaction Distribution
@if(isset($diagnostics['largest_transaction']) && $diagnostics['largest_transaction'])
Largest Transaction

Amount

UGX {{ number_format($diagnostics['largest_transaction']->amount, 2) }}

Type

{{ ucfirst($diagnostics['largest_transaction']->type) }}

Date

{{ $diagnostics['largest_transaction']->transaction_date->format('M d, Y') }}

Description

{{ $diagnostics['largest_transaction']->description }}
@endif @if(isset($diagnostics['potential_duplicates']) && $diagnostics['potential_duplicates'] > 0)
Potential Issues Detected

Found {{ $diagnostics['potential_duplicates'] }} potential duplicate transaction(s). Review your transactions for entries with the same amount, date, and description.

@endif
Back to Fund
Run Full Integrity Check @if(abs($diagnostics['calculated_balance'] - $diagnostics['current_balance']) >= 0.01)
@csrf
@endif
@endsection @push('scripts') @endpush @push('styles') @endpush