@extends('layouts.finance') @section('title', 'Student Fees') @section('subtitle', 'Monthly tuition invoices — received via a bank credit in Transactions') @section('content') @php $monthNames = collect(range(1, 12))->mapWithKeys(fn ($m) => [$m => \Illuminate\Support\Carbon::create(2000, $m, 1)->format('F')]); @endphp

Add a Fee

@if($enrollments->isEmpty())

No active enrollments yet. Enroll a student in a course first.

@else
@csrf
Leave blank to bill the enrollment's monthly fee.
@csrf
Bulk: raise fees for every active enrollment for {{ $monthNames[$filters['month'] ?? now()->month] }} {{ $filters['year'] }}. Already-billed enrollments are skipped.
@endif
@if($summary->isNotEmpty())

Totals

@foreach($summary as $row)
{{ $row->currency }} Collected
{{ number_format((float) $row->collected, 2) }}
{{ $row->currency }} Outstanding
{{ number_format((float) $row->outstanding, 2) }}
@endforeach
@endif

Fee Invoices

@forelse($fees as $fee) @empty @endforelse
Invoice Student Course Period Amount Status
{{ $fee->invoice_number }} @if($fee->student) {{ $fee->student->name }} @else {{ $fee->client_name }} @endif {{ $fee->course?->name ?? $fee->product_name }} {{ $fee->feePeriodLabel() ?? '—' }} {{ $fee->currency }} {{ number_format($fee->total(), 2) }} @if($fee->status === 'paid') Paid {{ optional($fee->paid_at)->format('d M Y') }} @else Unpaid @endif @if($fee->status !== 'paid')
@csrf @method('DELETE')
@endif
No fee invoices for this period.

To receive a fee: go to Transactions → pick the bank account → Credit → category Student Fee, then select the invoice. The amount is credited to the account and the fee is marked paid.

{{ $fees->links() }}
@endsection