@extends('layouts.app') @section('title', 'التقارير') @push('head') @endpush @php // Each report tile carries a tone color for the top accent line + // icon background. Keys map to subtle Tabler colors that don't // clash with the main hero gradient. $reports = [ [ 'icon' => 'ti-cash', 'tone' => '#16a34a', 'bg' => '#dcfce7', 'fg' => '#15803d', 'title' => 'الإيراد اليومي', 'desc' => 'تفصيل الإيرادات بحسب اليوم وطريقة الدفع', 'url' => route('reports.daily-revenue'), 'feature' => null, ], [ 'icon' => 'ti-user-search', 'tone' => '#0ea5e9', 'bg' => '#dbeafe', 'fg' => '#1e40af', 'title' => 'كشف حساب مريض', 'desc' => 'كل الفواتير والمدفوعات لمريض محدد', // No direct URL — requires picking a patient first. The card // opens a modal that redirects to /reports/patients/{id}/statement // once the user picks one. 'url' => null, 'modal' => 'patientStatementModal', 'feature' => null, ], [ 'icon' => 'ti-stethoscope', 'tone' => '#8b5cf6', 'bg' => '#ede9fe', 'fg' => '#5b21b6', 'title' => 'أداء الأطباء', 'desc' => 'عدد المواعيد والمرضى بحسب الطبيب', 'url' => route('reports.doctor-performance'), 'feature' => 'advanced_reports', ], [ 'icon' => 'ti-chart-pie', 'tone' => '#f59e0b', 'bg' => '#fef3c7', 'fg' => '#b45309', 'title' => 'تحليلات المواعيد', 'desc' => 'معدلات الإلغاء وعدم الحضور والنشاط الأسبوعي', 'url' => route('reports.appointments-analytics'), 'feature' => 'advanced_reports', ], [ 'icon' => 'ti-clock-dollar', 'tone' => '#ef4444', 'bg' => '#fee2e2', 'fg' => '#b91c1c', 'title' => 'الذمم المُعمّرة', 'desc' => 'الفواتير غير المدفوعة بحسب العمر (30/60/90 يوم)', 'url' => route('reports.aged-receivables'), 'feature' => 'advanced_reports', ], ]; $gate = app(\App\Services\PlanFeatureGate::class); @endphp @section('content')
@foreach($reports as $r) @php $locked = ! empty($r['feature']) && ! $gate->can($r['feature']); // A card with `modal` set opens a picker dialog instead of // navigating directly. Locked cards are inert regardless. $isModal = ! empty($r['modal']); $href = $locked ? '#' : ($r['url'] ?? '#'); @endphp @endforeach
{{-- ============================================================ --}} {{-- Patient picker modal for the patient-statement report. --}} {{-- ============================================================ --}} @endsection @push('head') @endpush @push('scripts') @endpush