Add specialty module and GP service pricing settings.
Deploy Ladill Care / deploy (push) Successful in 51s
Deploy Ladill Care / deploy (push) Successful in 51s
Admin dashboard module cards open per-module settings with editable service prices; GP consultation and clinic fees live under Settings → GP pricing (inventory drugs unchanged). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -197,10 +197,19 @@
|
||||
<h2 class="text-sm font-semibold text-slate-900">Specialty modules</h2>
|
||||
<div class="mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@foreach ($specialtyModules as $item)
|
||||
<a href="{{ route('care.specialty.show', $item['key']) }}"
|
||||
@php
|
||||
$toSettings = $permissions->can($member, 'settings.view');
|
||||
$href = $toSettings
|
||||
? route('care.settings.modules.show', $item['key'])
|
||||
: route('care.specialty.show', $item['key']);
|
||||
@endphp
|
||||
<a href="{{ $href }}"
|
||||
class="rounded-2xl border border-slate-200 bg-white px-4 py-4 transition hover:border-indigo-300 hover:shadow-sm">
|
||||
<p class="text-sm font-semibold text-slate-900">{{ $item['definition']['nav_label'] ?? $item['definition']['label'] }}</p>
|
||||
<p class="mt-1 text-xs text-slate-500">{{ $item['definition']['description'] ?? '' }}</p>
|
||||
@if ($toSettings)
|
||||
<p class="mt-2 text-[11px] font-medium text-indigo-600">Settings & pricing →</p>
|
||||
@endif
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -116,6 +116,16 @@
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<li>
|
||||
<a href="{{ route('care.settings.gp-pricing') }}"
|
||||
class="flex items-center justify-between rounded-xl border border-slate-100 bg-slate-50 px-4 py-3 text-sm text-slate-700 hover:text-indigo-700">
|
||||
<span>
|
||||
GP pricing
|
||||
<span class="mt-0.5 block text-xs text-slate-500">Consultation, registration, and clinic service prices</span>
|
||||
</span>
|
||||
<span class="text-slate-400">→</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('care.settings.modules') }}"
|
||||
class="flex items-center justify-between rounded-xl border border-slate-100 bg-slate-50 px-4 py-3 text-sm text-slate-700 hover:text-indigo-700">
|
||||
@@ -124,7 +134,7 @@
|
||||
@if (empty($canUseSpecialtyModules))
|
||||
<span class="ml-2 rounded-full bg-amber-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-amber-700">Pro</span>
|
||||
@endif
|
||||
<span class="mt-0.5 block text-xs text-slate-500">Dentistry, eye care, physiotherapy, maternity, radiology</span>
|
||||
<span class="mt-0.5 block text-xs text-slate-500">Dentistry, eye care, physiotherapy, maternity, radiology — activate & set prices</span>
|
||||
</span>
|
||||
<span class="text-slate-400">→</span>
|
||||
</a>
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<x-app-layout title="GP pricing · Settings">
|
||||
<x-settings.page
|
||||
title="GP products & services"
|
||||
description="Prices for general practice consultations and clinic services at {{ $organization->name }}. Drug prices are managed in Inventory; lab tests in Laboratory catalog."
|
||||
>
|
||||
<p class="text-sm">
|
||||
<a href="{{ route('care.settings') }}" class="font-medium text-indigo-600 hover:text-indigo-800">← Facility settings</a>
|
||||
</p>
|
||||
|
||||
@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="Service prices" description="Used for GP consultation bills, registration / patient card, and related charges. Currency: {{ $currency }}.">
|
||||
<form method="POST" action="{{ route('care.settings.gp-pricing.update') }}" 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'] }}">
|
||||
<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>
|
||||
</x-settings.page>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,82 @@
|
||||
<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.'.' }}"
|
||||
>
|
||||
<p class="text-sm">
|
||||
<a href="{{ route('care.settings.modules') }}" class="font-medium text-indigo-600 hover:text-indigo-800">← Specialty modules</a>
|
||||
</p>
|
||||
|
||||
@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 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>
|
||||
@@ -1,7 +1,9 @@
|
||||
<x-app-layout title="Modules · Settings">
|
||||
<x-settings.page title="Specialty modules" description="Activate specialty practice surfaces for {{ $organization->name }}. Departments and queues are provisioned per branch; deactivating hides UI without deleting clinical history.">
|
||||
<x-settings.page title="Specialty modules" description="Activate specialty practice surfaces for {{ $organization->name }}. Open a module to set service prices. Departments and queues are provisioned per branch; deactivating hides UI without deleting clinical history.">
|
||||
<p class="text-sm">
|
||||
<a href="{{ route('care.settings') }}" class="font-medium text-indigo-600 hover:text-indigo-800">← Facility settings</a>
|
||||
<span class="mx-2 text-slate-300">·</span>
|
||||
<a href="{{ route('care.settings.gp-pricing') }}" class="font-medium text-indigo-600 hover:text-indigo-800">GP pricing</a>
|
||||
</p>
|
||||
|
||||
@if (session('success'))
|
||||
@@ -24,27 +26,30 @@
|
||||
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@foreach ($catalog as $key => $module)
|
||||
@php $isDefault = ! empty($module['default_on_paid_plans']); @endphp
|
||||
<label class="flex flex-col rounded-2xl border border-slate-200 bg-white p-5 shadow-sm transition {{ $isDefault ? '' : 'cursor-pointer hover:border-indigo-200' }} {{ ! empty($enabled[$key]) || $isDefault ? 'ring-1 ring-indigo-200' : '' }}">
|
||||
<div class="flex flex-col rounded-2xl border border-slate-200 bg-white p-5 shadow-sm transition {{ ! empty($enabled[$key]) || $isDefault ? 'ring-1 ring-indigo-200' : '' }}">
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div>
|
||||
<a href="{{ route('care.settings.modules.show', $key) }}" class="min-w-0 flex-1 hover:opacity-90">
|
||||
<p class="text-sm font-semibold text-slate-900">{{ $module['label'] }}</p>
|
||||
<p class="mt-1 text-xs text-slate-500">{{ $module['description'] }}</p>
|
||||
@if ($isDefault)
|
||||
<p class="mt-2 text-[11px] font-medium uppercase tracking-wide text-indigo-600">Included on Pro / Enterprise</p>
|
||||
@endif
|
||||
</div>
|
||||
<input type="checkbox" name="modules[{{ $key }}]" value="1"
|
||||
@checked(old("modules.{$key}", ! empty($enabled[$key]) || $isDefault))
|
||||
@disabled(! $canManage || $isDefault)
|
||||
class="mt-0.5 rounded border-slate-300">
|
||||
@if ($isDefault)
|
||||
<input type="hidden" name="modules[{{ $key }}]" value="1">
|
||||
@endif
|
||||
<p class="mt-3 text-[11px] font-medium text-indigo-600">Settings & pricing →</p>
|
||||
</a>
|
||||
<label class="{{ $isDefault ? '' : 'cursor-pointer' }}" title="Activate module" @click.stop>
|
||||
<input type="checkbox" name="modules[{{ $key }}]" value="1"
|
||||
@checked(old("modules.{$key}", ! empty($enabled[$key]) || $isDefault))
|
||||
@disabled(! $canManage || $isDefault)
|
||||
class="mt-0.5 rounded border-slate-300">
|
||||
@if ($isDefault)
|
||||
<input type="hidden" name="modules[{{ $key }}]" value="1">
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
<p class="mt-3 text-[11px] uppercase tracking-wide text-slate-400">
|
||||
{{ $module['department_name'] ?? $module['label'] }}
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user