Use compact operational KPIs in the Reports page hero.
Deploy Ladill Care / deploy (push) Successful in 56s

Hero cards now show patient/appointment/lab counts instead of long currency strings, and page-hero values truncate safely for large figures.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-20 11:09:25 +00:00
co-authored by Cursor
parent a3839da869
commit 76241ac2b5
3 changed files with 11 additions and 8 deletions
+5 -4
View File
@@ -410,19 +410,20 @@ class AdminOverviewService
'period_label' => 'This month', 'period_label' => 'This month',
'from' => $from->toDateString(), 'from' => $from->toDateString(),
'to' => $to->toDateString(), 'to' => $to->toDateString(),
// Lead with compact counts for the page hero (first 3); money lives in the grid below.
'kpis' => [ 'kpis' => [
['label' => 'Revenue today', 'value' => $money((int) $today['revenue_today_minor'])],
['label' => 'Collected MTD', 'value' => $money($finance['collected_minor'])],
['label' => 'Outstanding', 'value' => $money($finance['outstanding_minor'])],
['label' => 'New patients MTD', 'value' => number_format($patients['new_patients'])], ['label' => 'New patients MTD', 'value' => number_format($patients['new_patients'])],
['label' => 'Appointments MTD', 'value' => number_format($appointments['total'])], ['label' => 'Appointments MTD', 'value' => number_format($appointments['total'])],
['label' => 'Lab pending', 'value' => number_format($lab['pending'])], ['label' => 'Lab pending', 'value' => number_format($lab['pending'])],
['label' => 'Visits MTD', 'value' => number_format($patients['total_visits'])],
['label' => 'Revenue today', 'value' => $money((int) $today['revenue_today_minor'])],
['label' => 'Collected MTD', 'value' => $money($finance['collected_minor'])],
['label' => 'Outstanding', 'value' => $money($finance['outstanding_minor'])],
], ],
'breakdowns' => [ 'breakdowns' => [
[ [
'title' => 'Month-to-date snapshot', 'title' => 'Month-to-date snapshot',
'rows' => [ 'rows' => [
['label' => 'Visits', 'value' => number_format($patients['total_visits']), 'pct' => null],
['label' => 'Completed appointments', 'value' => number_format($appointments['completed']), 'pct' => null], ['label' => 'Completed appointments', 'value' => number_format($appointments['completed']), 'pct' => null],
['label' => 'No-shows', 'value' => number_format($appointments['no_show']), 'pct' => null], ['label' => 'No-shows', 'value' => number_format($appointments['no_show']), 'pct' => null],
['label' => 'Lab completed', 'value' => number_format($lab['completed']), 'pct' => null], ['label' => 'Lab completed', 'value' => number_format($lab['completed']), 'pct' => null],
@@ -27,9 +27,9 @@
@if (count($stats) > 0) @if (count($stats) > 0)
<div class="scrollbar-hide flex snap-x snap-mandatory gap-3 overflow-x-auto pb-2 sm:grid sm:grid-cols-3 sm:overflow-visible sm:pb-0 lg:gap-4" style="-ms-overflow-style:none;scrollbar-width:none;"> <div class="scrollbar-hide flex snap-x snap-mandatory gap-3 overflow-x-auto pb-2 sm:grid sm:grid-cols-3 sm:overflow-visible sm:pb-0 lg:gap-4" style="-ms-overflow-style:none;scrollbar-width:none;">
@foreach ($stats as $stat) @foreach ($stats as $stat)
<div class="mobile-stats-card shrink-0 snap-start rounded-xl border border-slate-200 bg-white/90 px-4 py-3 text-center backdrop-blur-sm"> <div class="mobile-stats-card flex w-[8.5rem] shrink-0 snap-start flex-col justify-center rounded-xl border border-slate-200 bg-white/90 px-3 py-3 text-center backdrop-blur-sm sm:w-auto sm:min-w-0">
<p class="whitespace-nowrap text-xl font-bold text-slate-900 sm:text-2xl">{{ $stat['value'] }}</p> <p class="truncate text-lg font-bold tabular-nums text-slate-900 sm:text-xl" title="{{ $stat['value'] }}">{{ $stat['value'] }}</p>
<p class="mt-0.5 whitespace-nowrap text-[11px] font-medium text-slate-500">{{ $stat['label'] }}</p> <p class="mt-0.5 truncate text-[11px] font-medium text-slate-500" title="{{ $stat['label'] }}">{{ $stat['label'] }}</p>
</div> </div>
@endforeach @endforeach
</div> </div>
+3 -1
View File
@@ -114,7 +114,9 @@ class CareAdminOverviewTest extends TestCase
$this->actingAs($this->admin) $this->actingAs($this->admin)
->get(route('care.reports.index')) ->get(route('care.reports.index'))
->assertOk() ->assertOk()
->assertSee('Revenue today') ->assertSee('New patients MTD')
->assertSee('Appointments MTD')
->assertSee('Lab pending')
->assertSee('Detailed reports') ->assertSee('Detailed reports')
->assertSee('Finance'); ->assertSee('Finance');
} }