@extends('layouts.app') @php($isStudent = auth()->user()->isStudent()) @section('title', $isStudent ? 'My Payments' : 'Payments') @section('subtitle', 'Invoices, collections and outstanding balances') @section('content') @unless ($isStudent) Alerts Analytics New invoice @endunless
@unless ($isStudent) @endunless @forelse ($payments as $payment) @unless ($isStudent) @endunless @empty @endforelse
InvoiceStudentDescription Total Paid Balance Due date Status
{{ $payment->invoice_number }}{{ $payment->student?->user?->name ?? '—' }}
{{ $payment->student?->student_number }}
{{ $payment->description }} {{ money($payment->totalDue()) }} {{ money($payment->amount_paid) }} {{ money($payment->balance()) }} {{ $payment->due_date?->format('j M Y') }} @if ($payment->status === 'overdue' && $payment->due_date)
{{ $payment->due_date->diffForHumans() }}
@endif
{{ $statuses[$payment->status] ?? ucfirst($payment->status) }}
@if ($payments->hasPages())
{{ $payments->links() }}
@endif
@endsection