@extends('hms.layout') @section('title','Billing & finance') @section('content') @php($manager=(bool)auth()->user()->is_platform_admin || \App\Models\Hms\Membership::where('organization_id',session('hms_organization_id'))->where('user_id',auth()->id())->whereIn('role',['admin','organization_manager'])->exists())

Service pricing, patient invoices, payment collection and outstanding balances. Catalogue prices and new invoices use {{ config('hms_billing.currencies')[\App\Services\Hms\OrganizationCurrency::code((int)session('hms_organization_id'))] ?? '' }} ({{ \App\Services\Hms\OrganizationCurrency::code((int)session('hms_organization_id')) }}).

@if($manager)
Service catalogue · add a charge
@csrf
Choose the corresponding link type and item.

Manage prices
@foreach($services as $service)@endforeach
CodeItemTypePriceActive
{{ $service->code }}{{ $service->name }}{{ $service->kind }}
@csrf @method('PATCH')
@endif
Emergency interventions and other delivered services
@if($manager)@endif
@csrf
Create patient invoice
@csrf
Invoices
@forelse($invoices as $invoice)@empty@endforelse
InvoicePatientStatusTotalPaidBalanceActions
{{ $invoice->number }}
Review charges & split
{{ $invoice->first_name }} {{ $invoice->last_name }}{{ str_replace('_',' ',$invoice->status) }}{{ number_format($invoice->total,2) }} {{ $invoice->currency }}{{ number_format($invoice->paid_total,2) }} {{ $invoice->currency }}{{ number_format($invoice->total-$invoice->paid_total,2) }} {{ $invoice->currency }} @foreach($payments[$invoice->id]??[] as $payment)
Receipt PAY-{{ $payment->id }} · {{ number_format($payment->amount,2) }} @if($payment->reversal_id)Reversed@elseif($manager)
@csrf
@endif
@endforeach @foreach($lines[$invoice->id]??[] as $line)
{{ $line->excluded_at?'[Excluded] ':'' }}{{ $line->description }} · {{ $line->quantity }} × {{ number_format($line->unit_price,2) }} = {{ number_format($line->line_total,2) }}
@endforeach @if($invoice->status==='draft')
@csrf
@csrf
@elseif(in_array($invoice->status,['issued','partially_paid'],true))
@csrf
@endif
No invoices yet.
{{ $invoices->links() }}
@endsection