{{-- Service lines editor: rows of service + quantity (e.g. Oxygen × 3 hours), rate and amount, "Add row" and a running total. Posts service_id[] and quantity[] (App\Services\ServiceLines). Used by the Services module form and the admission profile's Service tab. Include with: ['lineTypes' => ServiceType collection (with category name as ->cat_name), 'linesParent' => '#modal' or null] JS: serviceLines.reset(), serviceLines.load([{service_id, quantity}, ...]) --}}
Service * Quantity * Rate Amount
Total $ 0.00
{{-- carries the "add at least one service" error only; never named service_id, which would overwrite the rows --}}
@php $svcLineTypes = $lineTypes->map(fn ($t) => ['id' => $t->id, 'name' => $t->name, 'rate' => (float) $t->rate, 'cat' => $t->cat_name ?? 'Other', 'hourly' => ($t->billing_unit ?? 'fixed') === 'hour'])->values(); @endphp @push('scripts') @endpush