@section('title', 'لوحة تحكم المحطة - FuelPlus') @section('page-title', 'لوحة التحكم') @section('page-description', 'نظرة عامة على عمليات المحطة') @if(($stats['expired_licenses'] ?? 0) > 0 || ($stats['expiring_soon_licenses'] ?? 0) > 0 || ($stats['unpaid_violations'] ?? 0) > 0)

تنبيهات هامة

@if(($stats['expired_licenses'] ?? 0) > 0)

رخص منتهية

{{ $stats['expired_licenses'] }} رخصة

@endif @if(($stats['expiring_soon_licenses'] ?? 0) > 0)

رخص تنتهي قريباً

{{ $stats['expiring_soon_licenses'] }} رخصة

@endif @if(($stats['unpaid_violations'] ?? 0) > 0)

مخالفات غير مدفوعة

{{ $stats['unpaid_violations'] }} مخالفة

@endif
@endif

مبيعات اليوم

{{ number_format($stats['daily_sales'] ?? 0, 2) }} ر.س

الوقود المباع اليوم

{{ number_format($stats['fuel_dispensed'] ?? 0, 0) }} لتر

المضخات النشطة

{{ $stats['active_pumps'] ?? 0 }}/{{ $stats['total_pumps'] ?? 0 }}

الوردية الحالية

{{ $stats['current_shift_duration'] ?? 'غير نشطة' }}

الورديات المكتملة اليوم

{{ $stats['completed_shifts_today'] ?? 0 }}

ورديات بانتظار الموافقة

{{ $stats['pending_approval_shifts'] ?? 0 }}

متوسط المبيعات لكل وردية

{{ number_format($stats['average_sales_per_shift'] ?? 0, 2) }} ر.س

المعايرات المفتوحة

{{ $stats['open_calibrations'] ?? 0 }}

طلبات تحصيل في الانتظار

{{ $cashCollectionStats['pending_requests'] ?? 0 }}

تحصيل قيد التنفيذ

{{ $cashCollectionStats['in_progress_requests'] ?? 0 }}

بانتظار تأكيد الشركة

{{ $cashCollectionStats['awaiting_confirmation'] ?? 0 }}

إجمالي المبالغ المعلقة

{{ number_format($cashCollectionStats['total_pending_amount'] ?? 0, 2) }} ر.س

طلبات التحصيل الأخيرة

عرض جميع الطلبات
@if ($recentCashCollections->count() > 0)
@foreach ($recentCashCollections as $collection)

{{ $collection->collector->user->name ?? 'محصل غير معروف' }}

{{ number_format($collection->total_amount, 2) }} ر.س

@php $statusText = match($collection->status) { 'pending' => 'في الانتظار', 'approved' => 'معتمد', 'rejected' => 'مرفوض', 'in_progress' => 'قيد التنفيذ', 'awaiting_confirmation' => 'بانتظار التأكيد', 'completed' => 'مكتمل', default => 'غير معروف' }; $statusColor = match($collection->status) { 'pending' => 'text-yellow-600 bg-yellow-50', 'approved' => 'text-green-600 bg-green-50', 'rejected' => 'text-red-600 bg-red-50', 'in_progress' => 'text-blue-600 bg-blue-50', 'awaiting_confirmation' => 'text-purple-600 bg-purple-50', 'completed' => 'text-green-600 bg-green-50', default => 'text-gray-600 bg-gray-50' }; @endphp {{ $statusText }}

{{ $collection->requested_at->diffForHumans() }}

@if($collection->status === 'pending' && Auth::user()->user_type === 'station_manager')
@endif
@endforeach
@else

لا توجد طلبات تحصيل حديثة

@endif

حالة الخزانات

@if ($tanks->count() > 0)
@foreach ($tanks as $tank)

{{ $tank->name ?? 'خزان ' . $tank->id }}

{{ $tank->fuelType->name ?? 'نوع الوقود' }}

@php $percentage = $tank->capacity_liters > 0 ? ($tank->current_level_liters / $tank->capacity_liters) * 100 : 0; $statusColor = $percentage > 50 ? 'text-green-600' : ($percentage > 20 ? 'text-yellow-600' : 'text-red-600'); @endphp

{{ number_format($percentage, 1) }}%

{{ number_format($tank->current_level_liters, 0) }}/{{ number_format($tank->capacity_liters, 0) }} لتر

@endforeach
@else

لا توجد خزانات مسجلة

@endif

النشاط الأخير

@forelse($recent_activities as $activity)

{{ $activity['description'] }}

{{ $activity['time'] }}

@empty

لا توجد أنشطة حديثة

@endforelse
@if($openCalibrations->isNotEmpty())

المعايرات المفتوحة

{{ $openCalibrations->count() }} معايرة مفتوحة
@foreach ($openCalibrations as $calibration)

مسدس {{ $calibration->nozzle->name ?? $calibration->nozzle->id }}

{{ $calibration->nozzle->pump->name ?? 'مضخة ' . $calibration->nozzle->pump->id }}

بواسطة: {{ $calibration->performedBy->name }}

{{ $calibration->started_at->diffForHumans() }}

الكمية: {{ number_format($calibration->calibrated_volume, 1) }} لتر
@if($calibration->shift_id)
الوردية: {{ $calibration->shift_id }}
@endif @if($calibration->notes)

{{ Str::limit($calibration->notes, 60) }}

@endif
@endforeach
@endif

حالة المضخات

@if ($pumps->count() > 0)
@foreach ($pumps as $pump)

{{ $pump->name ?? 'مضخة ' . $pump->id }}

{{ $pump->code ?? 'P' . $pump->id }}

@php $statusText = match ($pump->status) { 'operational' => 'تعمل', 'maintenance' => 'صيانة', 'out_of_service' => 'خارج الخدمة', default => 'غير معروف', }; $statusColor = match ($pump->status) { 'operational' => 'text-green-600 bg-green-50', 'maintenance' => 'text-yellow-600 bg-yellow-50', 'out_of_service' => 'text-red-600 bg-red-50', default => 'text-gray-600 bg-gray-50', }; @endphp {{ $statusText }}
@endforeach
@else

لا توجد مضخات مسجلة

@endif
@push('scripts') @endpush