@php
$patient = $item?->type == 'appointment' ? $item?->Appointment?->Patient : $item?->Patient;
$rows = $stay['rows'] ?? [];
$segments = $stay['segments'] ?? [];
$ledgerTotal = $stay['total'] ?? 0;
// still admitted: the nights so far may be more than billed yet (the bill is fixed at discharge)
$total = $stillIn ? max((float) ($item->cost ?? 0), (float) $ledgerTotal) : (float) ($item->cost ?? 0);
// Anything billed that the night-by-night ledger doesn't explain (older
// admissions priced before per-night billing) is shown as its own line so
// the statement always adds up to the billed total.
$other = round($total - $ledgerTotal, 2);
$discount = (float) $item->pmt->sum('discount');
$promotion = (float) $item->pmt->sum('promotion');
$paid = (float) $item->pmt->sum('payment');
$balance = max(0, round($total - $settled, 2));
$money = fn ($v) => number_format((float) $v, 2);
@endphp
@include('layouts.print_header', ['printTitle' => 'Admission Statement'])
@if ($stillIn)
The patient is still admitted — the stay is counted up to {{ $stayEnd->format('d M, Y') }}. The final room charge is set at discharge.
@endif
Room transfers
@if ($transfers->count())
| Date |
From room |
To room |
Bed |
Status |
@if ($showMoney)Room charge | @endif
@foreach ($transfers as $t)
| {{ $t['date'] }} |
{{ $t['from'] ?? '-' }} |
{{ $t['to'] ?? '-' }} |
{{ $t['bed'] ? 'Bed ' . $t['bed'] : '-' }} |
{{ $t['refunded'] ? 'Cancelled (refund)' : ($t['until'] ? 'Until ' . $t['until'] : 'Current room') }} |
@if ($showMoney){{ $money($t['cost']) }} | @endif
@endforeach
@else
No transfers — the patient stayed in {{ $item?->Room?->name ?? 'the same room' }}.
@endif
Room summary
@if (count($segments))
| Room |
Bed |
From |
To |
Nights |
Rate / night |
Amount |
@foreach ($segments as $seg)
| {{ $seg['room'] }} |
{{ $seg['bed'] ? 'Bed ' . $seg['bed'] : '-' }} |
{{ $seg['from']->format('d M, Y') }} |
{{ $seg['to']->format('d M, Y') }} |
{{ $seg['nights'] }} |
{{ $money($seg['rate']) }} |
{{ $money($seg['amount']) }} |
@endforeach
@else
No nights to charge yet (checkout date is the same as, or before, the admission date).
@endif
Day by day charges
@if (count($rows))
@php $running = 0; @endphp
| Day |
Date |
Room |
Bed |
Charge |
Running total |
@foreach ($rows as $row)
@php $running += $row['rate']; @endphp
| {{ $row['night'] }} |
{{ $row['date']->format('D, d M Y') }} |
{{ $row['room'] }} |
{{ $row['bed'] ? 'Bed ' . $row['bed'] : '-' }} |
{{ $money($row['rate']) }} |
{{ $money($running) }} |
@endforeach
| Room charges ({{ $stay['days'] }} {{ \Illuminate\Support\Str::plural('night', $stay['days']) }}) |
{{ $money($ledgerTotal) }} |
|
@else
No daily charges.
@endif
@if ($payments->count())
Payments received
| Date | Method | Received by | Discount | Amount |
@foreach ($payments as $p)
| {{ $p['date'] }} | {{ $p['method'] }} | {{ $p['by'] }} | {{ $money($p['discount']) }} | {{ $money($p['amount']) }} |
@endforeach
@endif
| Room charges | {{ $money($ledgerTotal) }} |
@if (abs($other) > 0.004)
| Other / earlier charges | {{ $money($other) }} |
@endif
| Total | {{ $money($total) }} |
| Discount | {{ $money($discount) }} |
| Promotion | {{ $money($promotion) }} |
| Paid | {{ $money($paid) }} |
| Balance due | {{ $money($balance) }} |
Cashier
Patient / Guardian