{{-- ICTHospital - final settlement for one patient across all their invoices. Copyright (c) DEVtrust Part of ICTHospital Licensed under the GNU General Public License v3.0. --}} @extends('layouts.master') @section('content') @include('app.partials._alerts')

Final settlement{{ $patient ? ': ' . $patient->name . ' (' . $patient->patient_id . ')' : '' }}

@if ($patient)
@foreach (['Base price' => $base, 'Discount' => $discount, 'Net amount' => $net, 'Paid' => $paid, 'Written off' => $writtenOff, 'Receivable' => $receivable] as $label => $value)
{{ $label }}
{{ number_format($value, 2) }}
@endforeach
@forelse ($invoices as $inv) @empty @endforelse
InvoiceDateSettingChargesBaseDiscountNetPaidBalanceStatus
#{{ $inv->id }}{{ $inv->date }}{{ strtoupper($inv->care_setting ?: 'opd') }} {{ \Illuminate\Support\Str::limit($inv->items->map->summary()->implode(', '), 60) }} {{ number_format((float) $inv->amount, 2) }}{{ number_format((float) $inv->discount, 2) }} {{ number_format((float) $inv->gross_total, 2) }}{{ number_format($inv->paid(), 2) }} {{ number_format($inv->balance(), 2) }}{{ ucfirst($inv->settlement()) }}
No invoices for this patient.
@if ($receivable > 0)

Settle

{{ csrf_field() }}
@if (\App\Support\Permissions::allows('payment_update'))
@endif

The amount is applied to the oldest invoices first. A write-off settles what is left without counting as money collected.

@else

Nothing outstanding.

@endif @endif
@stop