@extends('layouts.admin') @section('title', setting('school_name', 'ShulePoint') . ' | Invoices') @section('page-title', 'Invoices') @section('content') {{-- Generate card --}}

Generate for class

@if(!empty($currentYear) || !empty($currentTerm)) Auto: {{ $currentYear->name ?? '—' }} · {{ $currentTerm->name ?? '—' }} @endif
@csrf
@if(($classes ?? collect())->isEmpty())
No classes have been added yet. Add classes in Academics first, then generate invoices.
@else
@error('school_class_id'){{ $message }}@enderror
@error('academic_year_id'){{ $message }}@enderror
@error('term_id'){{ $message }}@enderror
@error('due_date'){{ $message }}@enderror
Year and term default to the current ones set by the admin. Pick the class you added in Academics — invoices go to every learner in it. @endif
{{-- Bulk action bar --}}
0 selected
Deleting removes payments + M-Pesa records linked to the invoice · this page only
{{-- Invoices table card --}}

Invoices {{ number_format($invoices->total()) }} total

0 on page Record Payment
@include('layouts.partials.school-th') @forelse($invoices as $i) @php $pill = $i->status === 'paid' ? 'ok' : ($i->status === 'partial' ? 'warn' : ($i->status === 'overdue' ? 'bad' : ($i->status === 'cancelled' ? 'muted' : 'info'))); @endphp @include('layouts.partials.school-td', ['schoolId' => $i->school_id ?? null]) @empty @endforelse
No Learner Total Paid Balance StatusAction
{{ $i->invoice_no }} @if($i->learner){{ $i->learner->first_name }} {{ $i->learner->last_name }} {{ $i->learner->admission_no }}@else#{{ $i->learner_id }}@endif KES {{ number_format($i->total, 0) }} KES {{ number_format($i->paid, 0) }} KES {{ number_format($i->balance, 0) }} {{ ucfirst($i->status) }}

No invoices yet

Generate invoices for a class using the form above.

{{-- Single delete confirmations --}} @foreach($invoices as $i) @endforeach {{-- Bulk: set status --}} {{-- Bulk: delete --}} @endsection @push('scripts') @endpush