{{-- Flash Messages --}} @if(session('success'))
{{ session('success') }}
@endif {{-- Header --}}

{{ __('Expense Tracking') }}

{{ __('Record, approve, and report on institutional expenses') }}

{{-- The x-data is critical here to allow Alpine.js to process the click --}}
{{-- Stats Grid --}}

{{ __('Total This Month') }}

{{ $currency ?? 'GHS' }} {{ number_format($totalThisMonth ?? 0, 2) }}

{{ __('Pending Approval') }}

{{ $pendingCount ?? 0 }}

{{ __('Approved This Month') }}

{{ $currency ?? 'GHS' }} {{ number_format($approvedThisMonth ?? 0, 2) }}

{{ __('Budget Remaining') }}

{{ $currency ?? 'GHS' }} {{ number_format($budgetRemaining ?? 0, 2) }}

{{-- Filters --}}
{{-- Expenses Table --}}
@forelse($expenses ?? [] as $expense) @empty @endforelse
{{ __('Description') }} {{ __('Amount') }} {{ __('Status') }} {{ __('Actions') }}

{{ $expense->description ?? '' }}

@if($expense->receipt) {{ __('View Receipt') }} @endif
{{ $currency ?? 'GHS' }} {{ number_format($expense->amount ?? 0, 2) }} @php $expStatus = strtolower($expense->status ?? 'pending'); @endphp {{ $expStatus }}
@if($expStatus === 'pending')
@csrf
@csrf
@endif
🧾

{{ __('No expenses recorded') }}

{{ __('Click Add Expense to log a new transaction.') }}

{{-- Fully Repaired Add Expense Modal --}}
@csrf