@extends('pdf._base') @section('title', 'Installment schedule '.$plan->code) @php $rows = $plan->installments->where('status', '!=', 'cancelled')->values(); $course = $plan->enrollment?->batch?->course ?? $plan->course; $batch = $plan->enrollment?->batch; $next = $plan->nextInstallment(); @endphp @section('body') @include('pdf._letterhead', ['title' => 'PAYMENT PLAN', 'number' => $plan->code, 'subtitle' => 'Installment schedule & agreement']) @if($plan->status === 'completed')
PAID
@elseif($plan->status === 'cancelled')
CANCELLED
@endif
Learner
{{ $plan->customer_name }}
{{ $plan->customer_email }}@if($plan->user?->phone)
{{ $plan->user->phone }}@endif @if($plan->user?->student_code)
Student ID {{ $plan->user->student_code }}@endif
Program
{{ $course?->title ?? 'Training program' }}
@if($batch)Batch {{ $batch->batch_code }}@if($batch->start_date) · starts {{ $batch->start_date->format('d M Y') }}@endif
@endif @if($plan->enrollment)Enrollment {{ $plan->enrollment->code }}@endif
Plan no.{{ $plan->code }}
Invoice{{ $plan->invoice?->number ?? '—' }}
Issued{{ $plan->created_at->format('d M Y') }}
Status{{ str_replace('_', ' ', $plan->financialStatus()) }}
Fee breakdown
@if((float) $plan->exam_fee > 0)@endif @if((float) $plan->additional_charges > 0)@endif @if((float) $plan->discount > 0)@endif @if((float) $plan->tax_amount > 0)@endif
Course / tuition fee{{ money2($plan->course_fee) }}
Certification exam fee{{ money2($plan->exam_fee) }}
{{ $plan->additional_label ?: 'Additional charges' }}{{ money2($plan->additional_charges) }}
Discount{{ $plan->discount_reason ? ' ('.$plan->discount_reason.')' : '' }}− {{ money2($plan->discount) }}
Tax ({{ rtrim(rtrim(number_format((float) $plan->tax_percent, 2), '0'), '.') }}%){{ money2($plan->tax_amount) }}
Final fee{{ money2($plan->total) }}
Account summary
@if($plan->waivedAmount() > 0)@endif @if($plan->overdueAmount() > 0)@endif
Paid to date{{ money2($plan->paidAmount()) }}
Waived{{ money2($plan->waivedAmount()) }}
Remaining balance{{ money2($plan->remaining()) }}
Overdue now{{ money2($plan->overdueAmount()) }}
Next payment{{ $next ? money2($next->outstanding()).' · '.$next->due_date->format('d M Y') : 'None — fully paid' }}
Installment schedule
@foreach($rows as $n => $x) @endforeach
#InstallmentDue dateAmountPaidBalanceStatus
{{ $n + 1 }}{{ $x->label }}{{ $x->due_date->format('d M Y') }}@if($x->original_due_date && ! $x->original_due_date->eq($x->due_date))
rescheduled from {{ $x->original_due_date->format('d M') }}@endif
{{ money2($x->amount) }}{{ money2($x->paid_amount) }}{{ money2($x->outstanding()) }}{{ $x->statusLabel() }}
Total{{ money2($rows->sum('amount')) }}{{ money2($rows->sum('paid_amount')) }}{{ money2($plan->remaining()) }}
How to pay
@foreach($methods as $m)
• {{ $m }}
@endforeach
Reference: {{ $plan->invoice?->number ?? $plan->code }}@if($plan->payment_method) · preferred method: {{ ucfirst(str_replace('_', ' ', $plan->payment_method)) }}@endif
@if($plan->terms)
Payment terms
{!! nl2br(e($plan->terms)) !!}
@endif
Learner — {{ $plan->customer_name }}
Accounts — {{ config('infotics.brand.legal_name') }}
@include('pdf._verify', ['qr' => $qr, 'verifyUrl' => $verifyUrl, 'docId' => $plan->code, 'docType' => 'plan'])
@include('pdf._footer') @endsection