@extends('layouts.school') @section('title', 'Expenses') @section('header', 'Expense Management') @section('content')

Committed this month

₦{{ number_format($totalThisMonth, 0) }}

Awaiting approval

{{ $pendingCount }}

Recurring schedules

{{ $recurrings->where('status', 'active')->count() }}

{{-- Record expense --}}

Record Expense

@csrf
{{-- List --}}

All Expenses

@forelse ($expenses as $expense) @empty @endforelse
Date Title Amount Status Actions
{{ $expense->expense_date?->format('d M Y') }} {{ $expense->title }} @if ($expense->vendor){{ $expense->vendor }}@endif ₦{{ number_format($expense->amount, 0) }} @php $colors = ['draft' => 'bg-gray-100 text-gray-600', 'pending_approval' => 'bg-yellow-50 text-yellow-700', 'approved' => 'bg-blue-50 text-blue-700', 'paid' => 'bg-green-50 text-green-700', 'rejected' => 'bg-red-50 text-red-700', 'cancelled' => 'bg-gray-100 text-gray-400']; @endphp {{ str_replace('_', ' ', $expense->status) }} @if ($expense->status === 'draft')
@csrf @method('PATCH')
@elseif ($expense->status === 'pending_approval')
@csrf @method('PATCH')
@csrf @method('PATCH')
@elseif ($expense->status === 'approved')
@csrf @method('PATCH')
@endif
No expenses recorded.
{{ $expenses->links() }}
{{-- Categories --}}

Expense Categories

    @forelse ($categories as $category)
  • {{ $category->name }} @if ($category->is_active)
    @csrf
    @endif
  • @empty
  • None yet.
  • @endforelse
@csrf
{{-- Recurring --}}

Recurring Expenses

    @forelse ($recurrings as $recurring)
  • {{ $recurring->title }}

    ₦{{ number_format($recurring->amount, 0) }} · {{ $recurring->frequency }} · next {{ $recurring->next_due_date?->format('d M Y') }}

    @csrf @method('PATCH')
  • @empty
  • No schedules yet.
  • @endforelse
+ New schedule
@csrf
@endsection