@section('title', 'تقرير المبيعات اليومية - ' . $company->name) @section('page-title', 'تقرير المبيعات اليومية') @section('page-description', 'تقرير مفصل لمبيعات ' . $selectedDate->format('Y-m-d'))

إجمالي المبيعات

{{ number_format($totals['total_sales'], 2) }} ر.س

إجمالي الوقود

{{ number_format($totals['total_fuel'], 0) }} لتر

متوسط السعر

{{ $totals['total_fuel'] > 0 ? number_format($totals['total_sales'] / $totals['total_fuel'], 3) : '0.000' }} ر.س/لتر

عدد الورديات

{{ $totals['shifts_count'] }}

المحطات النشطة

{{ $totals['stations_count'] }}

@if($shifts->count() > 0)

تفاصيل الورديات

@foreach($shifts as $shift) @endforeach
المحطة الموظف الوردية والتوقيت المدة الوقود المباع متوسط السعر المبيعات الإجراءات
{{ $shift->station->name }}
{{ $shift->station->code }}
{{ $shift->user ? substr($shift->user->name, 0, 1) : '؟' }}
{{ $shift->user ? $shift->user->name : 'غير محدد' }}
#{{ $shift->id }} @if($shift->status === 'open') نشطة @elseif($shift->status === 'closed') مُنهاة @elseif($shift->status === 'reconciled') مُطابقة @endif
بداية: {{ $shift->start_datetime->format('H:i') }}
@if($shift->end_datetime)
نهاية: {{ $shift->end_datetime->format('H:i') }}
@else
جارية...
@endif
@if($shift->end_datetime) @php $duration = $shift->start_datetime->diff($shift->end_datetime); $totalMinutes = $duration->h * 60 + $duration->i; @endphp
@if($duration->d > 0) {{ $duration->d }} يوم، @endif {{ $duration->h }} ساعة، {{ $duration->i }} دقيقة
إجمالي: {{ $totalMinutes }} دقيقة
@else
نشطة
منذ {{ $shift->start_datetime->diffForHumans() }}
@endif
{{ number_format($shift->nozzleReadings->sum(function($reading) { return ($reading->closing_reading ?? 0) - ($reading->opening_reading ?? 0); }), 2) }} لتر
@php $totalFuel = $shift->nozzleReadings->sum(function($reading) { return ($reading->closing_reading ?? 0) - ($reading->opening_reading ?? 0); }); $totalSales = $shift->nozzleReadings->sum(function($reading) { $quantity = ($reading->closing_reading ?? 0) - ($reading->opening_reading ?? 0); return $quantity * ($reading->price_per_liter ?? 0); }); $avgPrice = $totalFuel > 0 ? $totalSales / $totalFuel : 0; @endphp
{{ number_format($avgPrice, 3) }} ر.س/لتر
{{ number_format($totalSales, 2) }} ر.س
@if($chartData->count() > 0)

توزيع المبيعات حسب المحطة

مقارنة أداء المحطات في {{ $selectedDate->format('Y-m-d') }}

@foreach($chartData as $item)
{{ $item['station'] }}
{{ number_format($item['fuel'], 0) }} لتر
متوسط السعر: {{ $item['fuel'] > 0 ? number_format($item['sales'] / $item['fuel'], 3) : '0.000' }} ر.س/لتر
{{ number_format($item['sales'], 2) }} ر.س
{{ $totals['total_sales'] > 0 ? number_format(($item['sales'] / $totals['total_sales']) * 100, 1) : 0 }}%
@endforeach
@endif @else

لا توجد ورديات

لا توجد ورديات مكتملة في التاريخ المحدد

@endif