Files
ladill-care/resources/views/care/bills/index.blade.php
T
isaaccladandCursor 3ee59a0956
Deploy Ladill Care / deploy (push) Failing after 1m9s
Activate Care workflows across check-in and financial clearance.
Enforce service-queue gates, cashier settlements, and clinical stage progression so patient journeys cannot bypass configured payment or authorization rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 21:13:06 +00:00

82 lines
4.4 KiB
PHP

@php $money = fn ($minor) => config('care.billing.currency').' '.number_format($minor / 100, 2); @endphp
<x-app-layout title="Bills">
<div class="flex items-center justify-between">
<div>
<h1 class="text-xl font-semibold text-slate-900">Bills & invoices</h1>
<p class="mt-1 text-sm text-slate-500">Encounter billing and outstanding balances</p>
</div>
@if (app(\App\Services\Care\CareFeatures::class)->enabled($organization, \App\Services\Care\CareFeatures::WORKFLOW_ENGINE))
<a href="{{ route('care.obligations.index') }}" class="btn-primary">Financial gates</a>
@endif
</div>
<form method="GET" class="mt-4 flex gap-3 rounded-2xl border border-slate-200 bg-white p-4">
<select name="status" class="rounded-lg border-slate-300 text-sm">
<option value="">All statuses</option>
@foreach ($statuses as $value => $label)
<option value="{{ $value }}" @selected(request('status') === $value)>{{ $label }}</option>
@endforeach
</select>
<button type="submit" class="btn-primary">Filter</button>
</form>
<div class="mt-4">
@include('care.partials.queue-ops', [
'queueIntegration' => $queueIntegration ?? null,
'queueCallNextRoute' => 'care.bills.call-next',
'queueCallNextParams' => [],
'branchId' => $branchId ?? null,
])
</div>
<div class="mt-4 overflow-hidden rounded-2xl border border-slate-200 bg-white">
<table class="min-w-full text-sm">
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
<tr>
<th class="px-4 py-3">Ticket</th>
<th class="px-4 py-3">Invoice</th>
<th class="px-4 py-3">Patient</th>
<th class="px-4 py-3">Total</th>
<th class="px-4 py-3">Balance</th>
<th class="px-4 py-3">Status</th>
<th></th>
</tr>
</thead>
<tbody class="divide-y divide-slate-50">
@forelse ($bills as $bill)
<tr>
<td class="px-4 py-3">
@if (! empty($queueIntegration['enabled']) && $bill->queue_ticket_number)
@include('care.partials.queue-ticket', [
'ticketNumber' => $bill->queue_ticket_number,
'ticketStatus' => $bill->queue_ticket_status,
])
@else
<span class="text-slate-400"></span>
@endif
</td>
<td class="px-4 py-3 font-mono text-xs">{{ $bill->invoice_number }}</td>
<td class="px-4 py-3">{{ $bill->patient->fullName() }}</td>
<td class="px-4 py-3">{{ $money($bill->total_minor) }}</td>
<td class="px-4 py-3 {{ $bill->balance_minor > 0 ? 'text-amber-700' : '' }}">{{ $money($bill->balance_minor) }}</td>
<td class="px-4 py-3">{{ $statuses[$bill->status] ?? $bill->status }}</td>
<td class="px-4 py-3 text-right">
<div class="flex items-center justify-end gap-2">
@if (! empty($queueIntegration['enabled']) && $bill->queue_ticket_uuid && ($bill->queue_ticket_status ?? '') !== 'serving' && $bill->balance_minor > 0)
<form method="POST" action="{{ route('care.bills.serve', $bill) }}">
@csrf
<button type="submit" class="rounded-lg bg-sky-600 px-2.5 py-1 text-xs font-medium text-white hover:bg-sky-700">Serve</button>
</form>
@endif
<a href="{{ route('care.bills.show', $bill) }}" class="text-sky-600">View</a>
</div>
</td>
</tr>
@empty
<tr><td colspan="7" class="px-4 py-8 text-center text-slate-500">No bills yet.</td></tr>
@endforelse
</tbody>
</table>
</div>
<div class="mt-4">{{ $bills->links() }}</div>
</x-app-layout>