@extends('layouts.portal') @section('title', $student->name) @section('subtitle', 'Learner profile · joined '.$student->created_at->format('d M Y')) @section('actions') All learners Fee statement Send details @endsection @section('content') @php $suspended = ($student->status ?? 'active') === 'suspended'; $liveCount = $enrollments->whereIn('status', ['active', 'completed'])->count(); $due = $enrollments->whereIn('status', ['pending', 'active'])->sum(fn ($e) => $e->balance()); @endphp
Enrollments{{ $enrollments->count() }}{{ $liveCount }} with access
Certificates{{ $credentials->count() }}{{ $badges->count() }} {{ \Illuminate\Support\Str::plural('badge', $badges->count()) }}
Exam attempts{{ $attempts->count() }}{{ $attempts->where('passed', true)->count() }} passed

Enrollments

@if($enrollments->isEmpty()) @else
@foreach($enrollments as $e) @php $net = $e->netFee(); $pp = $net > 0 ? min(100, round((float) $e->paid_amount / $net * 100)) : 100; $att = $attendance[$e->id] ?? null; @endphp @endforeach
Course · batchStatus & attendancePaymentActions
{{ $e->batch?->course?->title ?? 'Course removed' }}
{{ $e->batch?->batch_code }}
@if($att && $att['sessions_taken'] > 0) {{ rtrim(rtrim(number_format($att['percent'] ?? 0, 1), '0'), '.') }}% attendance @else {{ $att ? 'No registers yet' : 'Not started' }} @endif
{{ money($e->paid_amount) }} / {{ money($net) }}
@if($e->netFee() > 0 && in_array($e->status, ['pending', 'active'], true))@endif
@endif
@can('finance.view')

Fees & installment plans

@if($student->student_code){{ $student->student_code }}@endif
@forelse($plans as $p) @php($n = $p->nextInstallment())
{{ $p->course?->title }} · paid {{ money2($p->paidAmount()) }} of {{ money2($p->total) }}@if($n) · next {{ money2($n->outstanding()) }} due {{ $n->due_date->format('d M Y') }}@endif
{{ money2($p->remaining()) }}
@empty
No installment plan yet.@foreach($enrollments->whereIn('status', ['pending', 'active'])->filter(fn ($e) => $e->netFee() > 0) as $e) Create plan for {{ $e->batch?->batch_code }}@endforeach
@endforelse
@endcan @if($registrations->isNotEmpty())

Workshops

@foreach($registrations as $r)
{{ $r->event?->title }}
{{ $r->event?->starts_at?->format('d M Y, h:i A') }} · {{ $r->code }}
@if($r->event)Open@endif
@endforeach
@endif
@can('finance.view')@endcan
@forelse($attempts as $a)
{{ $a->exam?->title ?? 'Exam' }}
Attempt {{ $a->attempt_no }} · {{ ($a->submitted_at ?? $a->started_at)?->format('d M Y, g:i A') }}
{{ $a->percent !== null ? rtrim(rtrim(number_format($a->percent, 1), '0'), '.').'%' : '—' }}
@empty @endforelse
@forelse($credentials as $c)
{{ $c->title }}
{{ $c->credential_id }} · issued {{ $c->issued_at?->format('d M Y') }}
@empty
No certificates issued yet.
@endforelse @foreach($badges as $b)
{{ $b->badge?->name ?? 'Badge' }}
{{ $b->badge_id_code }} · issued {{ $b->issued_at?->format('d M Y') }}
@endforeach
@can('finance.view')

Invoices

All invoices
@forelse($invoices as $i)
{{ $i->number }}
Issued {{ $i->issue_date?->format('d M Y') }}@if($i->due_date) · due {{ $i->due_date->format('d M Y') }}@endif
{{ money($i->total) }}
paid {{ money($i->amount_paid) }}
@empty
No invoices yet.
@endforelse

Payments

@forelse($payments as $p)
{{ money($p->amount) }}
{{ ucfirst(str_replace('_', ' ', $p->method ?? 'transfer')) }} · {{ ($p->paid_at ?? $p->created_at)->format('d M Y') }}@if($p->invoice) · {{ $p->invoice->number }}@endif
@empty
No payments recorded.
@endforelse
@endcan
@forelse($applications as $a)
{{ $a->job?->title ?? 'Job removed' }}
{{ $a->job?->employer?->company_name }} · applied {{ $a->created_at->format('d M Y') }}
@empty @endforelse
@forelse($emails as $m)
{{ $m->subject }}
{{ $m->template_key ?: ($m->category ?: 'general') }} · {{ $m->relatedLabel() ?? 'no related record' }} · {{ $m->created_at->format('d M Y, g:i A') }}{{ $m->sender ? ' · by '.$m->sender->name : '' }}@if($m->error) · {{ \Illuminate\Support\Str::limit($m->error, 80) }}@endif
@if($m->status === 'failed')
@csrf
@endif
@empty @endforelse
@if($errors->any() && old('_method') === 'PUT')@endif @endsection