@php
$money = fn ($v) => '$ ' . number_format((float) $v, 2);
$patient = $plan->patient;
@endphp
@include('layouts.print_header', ['printTitle' => 'Treatment Plan Statement'])
{{-- only the months something was paid for --}}
@php($paidMonths = collect($s['installments'])->filter(fn ($i) => $i['paid'] + $i['discount'] > 0.004))
Months paid
@if ($paidMonths->count())
| Month | Due | Paid | Discount | Status |
@foreach ($paidMonths as $i)
| {{ $i['no'] }} / {{ $s['months'] }} | {{ $i['due'] }} |
{{ $money($i['paid']) }} | {{ $money($i['discount']) }} |
{{ $i['status'] }} |
@endforeach
| Total paid | {{ $money($s['paid']) }} | {{ $money($s['discount']) }} | |
@else
No month paid yet.
@endif
Payments
@if ($payments->count())
| Date | Month | Method | Received by | Discount | Amount |
@foreach ($payments as $p)
| {{ $p['date'] }} | {{ $p['month'] }} | {{ $p['method'] }}{{ $p['refunded'] ? ' — refunded' : '' }} | {{ $p['by'] }} |
{{ $money($p['discount']) }} | {{ $money($p['amount']) }} |
@endforeach
@else
No payments yet.
@endif
| Plan total | {{ $money($s['total']) }} |
| Paid | {{ $money($s['paid']) }} |
| Discount | {{ $money($s['discount']) }} |
@if ($s['overdue'])
| Overdue now ({{ $s['overdue'] }} month(s)) | {{ $money($s['overdue_amount']) }} |
@endif
| Left to pay | {{ $money($s['balance']) }} |
@if ($s['next'] && $plan->status === 'Active')
| Next month | {{ $s['next']['due'] }} — {{ $money($s['next']['amount']) }} |
@endif
Cashier
Patient / Guardian