@extends('layouts.admin') @section('title', setting('school_name', 'ShulePoint') . ' | Invoice ' . $invoice->invoice_no) @section('page-title', 'Invoice ' . $invoice->invoice_no) @push('styles') @endpush @section('content') @php $invPill = $invoice->status === 'paid' ? 'ok' : ($invoice->status === 'partial' ? 'warn' : 'muted'); $learner = $invoice->learner; @endphp {{-- Invoice card --}}

Invoice {{ $invoice->invoice_no }} {{ ucfirst($invoice->status) }}

Learner
{{ $learner ? $learner->first_name.' '.$learner->last_name : 'Learner #'.$invoice->learner_id }}
Adm: {{ $learner->admission_no ?? '—' }}
Class: {{ $learner?->schoolClass->name ?? '—' }}
Parent / Guardian
{{ $learner->guardian_name ?? '—' }}
{{ $learner->guardian_phone ?? '' }}
Invoice details
{{ $invoice->invoice_no }}
Term: {{ $invoice->term->name ?? '—' }} · Year: {{ $invoice->academicYear->name ?? '—' }}
Due: {{ $invoice->due_date ? $invoice->due_date->format('d M Y') : '—' }}
KES {{ number_format($invoice->total, 0) }} Total billed
KES {{ number_format($invoice->paid, 0) }} Paid
KES {{ number_format($invoice->balance, 0) }} Balance
{{-- Billed vote heads --}}

Billed vote heads KES {{ number_format($invoice->total, 0) }} total

@forelse($breakdown['lines'] as $i => $line) @empty @endforelse @if($breakdown['adjustment'] != 0) @endif
#Vote headDetailAmount
{{ $i + 1 }} {{ $line['label'] }} {{ $line['detail'] }} KES {{ number_format($line['amount'], 0) }}
1 School fees {{ $invoice->term->name ?? 'Term' }} {{ $invoice->academicYear->name ?? '' }} KES {{ number_format($invoice->total, 0) }}
– Other charges / adjustments Rounding and manual adjustments KES {{ number_format($breakdown['adjustment'], 0) }}
{{-- Payments recorded card --}}

Payments recorded {{ $invoice->payments->count() }} payment(s)

@forelse($invoice->payments as $p) @empty @endforelse
Amount Method Ref Date Receipt
KES {{ number_format($p->amount, 0) }} {{ $p->method }} {{ $p->reference ?? '–' }} {{ $p->paid_at }}

No payments recorded

Record the first payment against this invoice.

Record Payment
@endsection