Files
ladill-care/resources/views/care/bills/index.blade.php
T
isaaccladandCursor 015a4cc7fe
Deploy Ladill Care / deploy (push) Successful in 1m45s
Wire Care lists into Ladill Queue workflows instead of reception panels.
When Queue integration is on, role pages issue tickets into their own
department queues and drive Call next → Serve → Complete on the native
lists. Integration off leaves existing UI unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 16:27:48 +00:00

79 lines
4.2 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>
</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>