@extends('layouts.school') @section('title', 'Finance Dashboard') @section('header', 'Finance Dashboard') @section('content')
@php $cards = [ ['label' => 'Billed (Year)', 'value' => '₦' . number_format($stats['billed'], 0), 'accent' => 'text-gray-900'], ['label' => 'Collected', 'value' => '₦' . number_format($stats['collected'], 0), 'accent' => 'text-green-600'], ['label' => 'Outstanding', 'value' => '₦' . number_format($stats['outstanding'], 0), 'accent' => 'text-red-600'], ['label' => 'Expenses (Year)', 'value' => '₦' . number_format($stats['expenses'], 0), 'accent' => 'text-orange-600'], ['label' => 'Other Income', 'value' => '₦' . number_format($stats['otherIncome'], 0), 'accent' => 'text-blue-600'], ['label' => 'Refunds', 'value' => '₦' . number_format($stats['refunded'], 0), 'accent' => 'text-purple-600'], ['label' => 'Overdue Amount', 'value' => '₦' . number_format($stats['overdueAmount'], 0), 'accent' => 'text-red-600'], ['label' => 'Net Position', 'value' => ($stats['netPosition'] >= 0 ? '₦' : '-₦') . number_format(abs($stats['netPosition']), 0), 'accent' => $stats['netPosition'] >= 0 ? 'text-green-700' : 'text-red-700'], ] @endphp @foreach ($cards as $card)

{{ $card['label'] }}

{{ $card['value'] }}

@endforeach
Generate Invoices All Invoices Pending Verification @if ($stats['pendingVerificationCount'] > 0) {{ $stats['pendingVerificationCount'] }} @endif Expenses Reports

Collections by Month

@if (empty($collections))

No collections recorded yet this year.

@else @php $max = max($collections); @endphp
@foreach ($collections as $month => $total)
{{ \Carbon\Carbon::parse($month . '-01')->format('M Y') }}₦{{ number_format($total, 0) }}
@endforeach
@endif

Outstanding by Class

@if (empty($byClass))

No outstanding balances.

@else @foreach (array_slice($byClass, 0, 8) as $row) @endforeach
{{ $row['class'] }} {{ $row['students'] }} student(s) ₦{{ number_format($row['outstanding'], 0) }}
@endif

Recent Invoices

Recent Payments

@endsection