@extends('layouts.portal') @section('title', 'Fees') @section('page-header')

Fees & Payments

Invoices and payment history for {{ $child->full_name }}

@endsection @section('content') @if (session('success'))
{{ session('success') }}
@endif @if (session('info'))
{{ session('info') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
{{-- Invoices --}} @if ($feeSummary['invoices']->isEmpty()) @else
@foreach ($feeSummary['invoices'] as $invoice) @php $balance = round((float) $invoice->amount - (float) $invoice->discount - (float) $invoice->total_paid, 2); if ($invoice->status === 'paid') { [$tone, $label] = ['emerald', 'Paid']; } elseif ($invoice->isOverdue()) { [$tone, $label] = ['rose', 'Overdue']; } elseif ($invoice->total_paid > 0) { [$tone, $label] = ['amber', 'Partial']; } else { [$tone, $label] = ['slate', 'Unpaid']; } @endphp

{{ $invoice->feeStructure?->category?->name ?? 'School fees' }} {{ $invoice->invoice_no }}

{{ $invoice->academicYear?->name }}{{ $invoice->term?->name ? ' · ' . $invoice->term->name : '' }} · Due {{ $invoice->due_date?->format('M j, Y') ?? '-' }}

₦{{ number_format((float) $invoice->amount - (float) $invoice->discount, 2) }}

@if ($invoice->total_paid > 0 && $invoice->status !== 'paid')

Paid ₦{{ number_format((float) $invoice->total_paid, 2) }}

@endif {{ $label }}
@if ($balance > 0)
Pay now · ₦{{ number_format($balance, 2) }} @php $charge = $serviceCharges[$invoice->id] ?? null; @endphp @if ($charge && (float) $charge['charge_amount'] > 0)
School fee {{ number_format((float) $charge['base_amount'], 2) }}
Pishon service charge @if ($charge['charge_to'] === 'school') · absorbed by school @endif {{ number_format((float) $charge['charge_amount'], 2) }}
Total to pay {{ number_format((float) $charge['total_charged'], 2) }}
@endif
@csrf

Transfer to any school account below, then submit the reference for confirmation.

@if ($onlineEnabled && count($onlineProviders))
@foreach ($onlineProviders as $provider)
@csrf
@endforeach
@endif
@endif
@endforeach
@endif
{{-- Payment history + bank accounts --}}
@if ($feeSummary['payments']->isEmpty()) @else
    @foreach ($feeSummary['payments'] as $payment)
  1. ₦{{ number_format((float) $payment->amount, 2) }}

    {{ $payment->payment_date?->format('M j, Y') ?? $payment->created_at->format('M j, Y') }}

    {{ $payment->payment_method ? ucwords(str_replace('_', ' ', $payment->payment_method)) : 'Payment' }} @if ($payment->receipt_no) · {{ $payment->receipt_no }} @endif @if ($payment->status === 'pending_verification') · awaiting confirmation @elseif ($payment->status === 'rejected') · rejected @endif

    @if (in_array($payment->status, ['confirmed','verified','reconciled']) && $payment->receipt_no) View receipt @endif
  2. @endforeach
@endif
@if ($bankAccounts->isNotEmpty())
    @foreach ($bankAccounts as $account)
  • {{ $account->bank_name }}

    {{ $account->maskedNumber() }}

    Account name: {{ $account->account_name }}@if($account->is_default) · preferred@endif

  • @endforeach
@endif
@endsection