@php
$statusColors = [
'unpaid' => ['bg' => '#fffbeb', 'fg' => '#b45309'],
'partially_paid' => ['bg' => '#eff6ff', 'fg' => '#1d4ed8'],
'paid' => ['bg' => '#ecfdf5', 'fg' => '#047857'],
'overdue' => ['bg' => '#fef2f2', 'fg' => '#b91c1c'],
'cancelled' => ['bg' => '#f1f5f9', 'fg' => '#475569'],
];
$statusColor = $statusColors[$invoice->status] ?? $statusColors['cancelled'];
$guardian = $invoice->student?->guardians->first();
@endphp
- Billed To
- {{ $invoice->student?->fullName() ?? 'Admission applicant' }} @if($invoice->student)({{ $invoice->student->student_code }})@endif
@if($guardian)
- Guardian
- {{ $guardian->fullName() }}
@endif
- Issued
- {{ $invoice->issued_at->setTimezone($tenant->timezone ?: 'UTC')->format('M j, Y') }}
- Due Date
- {{ $invoice->due_date->format('M j, Y') }}
@if($invoice->billing_period)
- Billing Period
- {{ $invoice->billing_period }}
@endif
@if($invoice->student)
- Class
- {{ $invoice->student->section?->schoolClass?->name ?? '—' }}
- Section
- {{ $invoice->student->section?->name ?? '—' }}
- Roll
- {{ $invoice->student->roll_number ?? '—' }}
- Branch
- {{ $invoice->student->branch?->name ?? '—' }}
- Campus
- {{ $invoice->student->branch?->campus?->name ?? '—' }}
@endif
| Description |
Fee Type |
Amount |
| {{ $invoice->description }} |
{{ $invoice->feeType?->name ?? $invoice->feeStructure?->feeType?->name ?? 'Ad-hoc' }} |
{{ \App\Support\Money::format($invoice->amount_cents, $currency) }} |
Subtotal{{ \App\Support\Money::format($invoice->amount_cents, $currency) }}
@if($invoice->discount_cents > 0)
Discount-{{ \App\Support\Money::format($invoice->discount_cents, $currency) }}
@endif
Paid So Far{{ \App\Support\Money::format($invoice->amountPaidCents(), $currency) }}
Amount Due{{ \App\Support\Money::format($invoice->amount_due_cents, $currency) }}
Payment History
@if($invoice->payments->isEmpty())
No payments recorded yet.
@else
| Gateway |
Reference |
Paid At |
Amount |
@foreach($invoice->payments as $payment)
| {{ ucfirst($payment->gateway) }} |
{{ $payment->gateway_reference ?? '—' }} |
{{ $payment->paid_at?->setTimezone($tenant->timezone ?: 'UTC')->format('M j, Y g:i A') ?? '—' }} |
{{ \App\Support\Money::format($payment->amount_cents, $currency) }} |
@endforeach
@endif