@switch($order->status)
@case('pending')
قيد الانتظار
تم استلام طلبك وسيتم معالجته قريبًا
@break
@case('preparing')
@php
// Verificar si todos los elementos están listos o servidos
$allItemsReady = $order->items->every(function($item) {
return in_array($item->status, ['ready', 'served']);
});
// Verificar si hay al menos un elemento listo
$hasReadyItems = $order->items->contains(function($item) {
return $item->status === 'ready';
});
@endphp
@if($allItemsReady || $hasReadyItems)
جاهز للتقديم
طلبك جاهز وسيتم تقديمه قريبًا
@else
جاري التحضير
يتم تحضير طلبك الآن
@endif
@break
@case('completed')
تم التسليم
تم تسليم طلبك بنجاح
@break
@case('cancelled')
تم الإلغاء
تم إلغاء هذا الطلب
@break
@default
غير معروف
حالة الطلب غير معروفة
@endswitch
@if(!in_array($order->status, ['cancelled', 'completed']))
@switch($order->status)
@case('pending')
@break
@case('preparing')
@php
// Verificar si hay al menos un elemento listo
$hasReadyItems = $order->items->contains(function($item) {
return $item->status === 'ready';
});
@endphp
@if($hasReadyItems)
@else
@endif
@break
@default
@endswitch
استلام الطلب
تحضير
جاهز
تم التسليم
@if(in_array($order->status, ['pending', 'preparing']))
الوقت المتوقع للتحضير: {{ $estimatedTime ?? '10-15' }} دقيقة
@endif
@endif
@if($order->payment_status == 'pending')
حالة الدفع: غير مدفوع
يرجى دفع هذا الطلب عند المحاسبة
استدعاء المحاسب
@elseif($order->payment_status == 'paid')
حالة الدفع: تم الدفع
شكراً لك!
@endif
رقم الطاولة: {{ $order->table->name }}
@if($order->customer_name)
اسم العميل: {{ $order->customer_name }}
@endif
وقت الطلب: {{ $order->created_at->format('Y-m-d H:i') }}
المنتج
الكمية
السعر
المجموع
@foreach($order->items as $item)
{{ $item->product->name }}
@if($item->notes)
{{ $item->notes }}
@endif
{{ $item->quantity }}
{{ number_format($item->unit_price, 2) }}
{{ number_format($item->total_price, 2) }}
@endforeach
المجموع
{{ number_format($order->total_amount, 2) }}
@if($order->is_external_order)
طلب جديد
@else
طلب جديد
@endif
@if(in_array($order->status, ['pending']))
إلغاء الطلب
@endif