Files
ladill-care/resources/views/care/settings/module-show.blade.php
T
isaaccladandCursor 656f402e8f
Deploy Ladill Care / deploy (push) Successful in 38s
Restrict lab catalog pricing to admins only.
Split catalog CRUD onto lab.catalog.manage so technicians keep lab.manage for queue and results workflow without setting investigation prices.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 18:58:57 +00:00

86 lines
5.2 KiB
PHP

<x-app-layout title="{{ $definition['label'] ?? $moduleKey }} · Module settings">
<x-settings.page
title="{{ $definition['label'] ?? ucfirst($moduleKey) }}"
description="{{ $definition['description'] ?? 'Module settings and service prices for '.$organization->name.'.' }}"
>
<div class="flex items-center gap-3">
<x-care.specialty-icon :module="$moduleKey" boxed />
<p class="text-sm">
<a href="{{ route('care.settings.modules') }}" class="font-medium text-indigo-600 hover:text-indigo-800"> Specialty modules</a>
</p>
</div>
@if (session('success'))
<p class="rounded-lg bg-emerald-50 px-3 py-2 text-sm text-emerald-800">{{ session('success') }}</p>
@endif
<x-settings.card title="Status" description="Activate modules from the modules list. Drug prices stay in Inventory; lab test prices are set by admins in Laboratory catalog.">
<div class="flex flex-wrap items-center gap-3 text-sm">
@if ($enabled)
<span class="rounded-full bg-emerald-50 px-2.5 py-1 text-xs font-semibold text-emerald-800">Active</span>
@else
<span class="rounded-full bg-slate-100 px-2.5 py-1 text-xs font-semibold text-slate-600">Inactive</span>
@endif
@if ($canOpenWorkspace)
<a href="{{ route('care.specialty.show', $moduleKey) }}" class="font-medium text-indigo-600 hover:text-indigo-800">Open module workspace </a>
@endif
<a href="{{ route('care.settings.modules') }}" class="font-medium text-slate-600 hover:text-slate-900">Manage activation</a>
</div>
</x-settings.card>
@if (! $canUseSpecialtyModules)
<x-settings.card title="Pro feature" description="Specialty module pricing requires Care Pro or Enterprise.">
<a href="{{ route('care.pro.index') }}" class="btn-primary mt-2 inline-flex text-sm">View plans</a>
</x-settings.card>
@else
<x-settings.card title="Service prices" description="Amounts billed when these services are added from the specialty workspace. Currency: {{ $currency }}.">
<form method="POST" action="{{ route('care.settings.modules.services.update', $moduleKey) }}" class="space-y-4">
@csrf
@method('PUT')
<div class="overflow-x-auto">
<table class="min-w-full text-left text-sm">
<thead>
<tr class="border-b border-slate-200 text-xs uppercase tracking-wide text-slate-500">
<th class="py-2 pr-3">Service</th>
<th class="py-2 pr-3">Type</th>
<th class="py-2">Price ({{ $currency }})</th>
</tr>
</thead>
<tbody>
@foreach ($services as $i => $service)
<tr class="border-b border-slate-100">
<td class="py-2.5 pr-3">
<input type="hidden" name="services[{{ $i }}][code]" value="{{ $service['code'] }}">
<input type="hidden" name="services[{{ $i }}][label]" value="{{ $service['label'] }}">
<p class="font-medium text-slate-900">{{ $service['label'] }}</p>
<p class="text-xs text-slate-400">{{ $service['code'] }}</p>
</td>
<td class="py-2.5 pr-3 text-slate-600">{{ ucfirst($service['type'] ?? 'misc') }}</td>
<td class="py-2.5">
<input
type="number"
name="services[{{ $i }}][amount]"
step="0.01"
min="0"
value="{{ old('services.'.$i.'.amount', number_format(((int) ($service['amount_minor'] ?? 0)) / 100, 2, '.', '')) }}"
@disabled(! $canManage)
class="w-32 rounded-lg border-slate-300 text-sm tabular-nums"
required
>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@if ($canManage)
<div class="flex justify-end">
<button type="submit" class="btn-primary">Save prices</button>
</div>
@endif
</form>
</x-settings.card>
@endif
</x-settings.page>
</x-app-layout>