Use compact operational KPIs in the Reports page hero.
Deploy Ladill Care / deploy (push) Successful in 56s
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:
@@ -410,19 +410,20 @@ class AdminOverviewService
|
||||
'period_label' => 'This month',
|
||||
'from' => $from->toDateString(),
|
||||
'to' => $to->toDateString(),
|
||||
// Lead with compact counts for the page hero (first 3); money lives in the grid below.
|
||||
'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' => 'Appointments MTD', 'value' => number_format($appointments['total'])],
|
||||
['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' => [
|
||||
[
|
||||
'title' => 'Month-to-date snapshot',
|
||||
'rows' => [
|
||||
['label' => 'Visits', 'value' => number_format($patients['total_visits']), 'pct' => null],
|
||||
['label' => 'Completed appointments', 'value' => number_format($appointments['completed']), 'pct' => null],
|
||||
['label' => 'No-shows', 'value' => number_format($appointments['no_show']), 'pct' => null],
|
||||
['label' => 'Lab completed', 'value' => number_format($lab['completed']), 'pct' => null],
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
@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;">
|
||||
@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">
|
||||
<p class="whitespace-nowrap text-xl font-bold text-slate-900 sm:text-2xl">{{ $stat['value'] }}</p>
|
||||
<p class="mt-0.5 whitespace-nowrap text-[11px] font-medium text-slate-500">{{ $stat['label'] }}</p>
|
||||
<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="truncate text-lg font-bold tabular-nums text-slate-900 sm:text-xl" title="{{ $stat['value'] }}">{{ $stat['value'] }}</p>
|
||||
<p class="mt-0.5 truncate text-[11px] font-medium text-slate-500" title="{{ $stat['label'] }}">{{ $stat['label'] }}</p>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -114,7 +114,9 @@ class CareAdminOverviewTest extends TestCase
|
||||
$this->actingAs($this->admin)
|
||||
->get(route('care.reports.index'))
|
||||
->assertOk()
|
||||
->assertSee('Revenue today')
|
||||
->assertSee('New patients MTD')
|
||||
->assertSee('Appointments MTD')
|
||||
->assertSee('Lab pending')
|
||||
->assertSee('Detailed reports')
|
||||
->assertSee('Finance');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user