@php $n = fn ($v) => number_format((float) $v, 2); $eff = $quote->effective_status; $phone = preg_replace('/\D+/', '', (string) $quote->customer_phone); if ($phone !== '' && str_starts_with($phone, '0')) { $phone = '966' . substr($phone, 1); } $wa = 'https://wa.me/' . $phone . '?text=' . rawurlencode("عرض سعر {$quote->quote_number} من {$company['name']}\nالإجمالي شامل الضريبة: {$n($quote->total)} ر.س" . ($quote->valid_until ? "\nصالح حتى: " . $quote->valid_until->format('Y-m-d') : '')); @endphp @unless($print)
💬 إرسال واتساب @if($quote->isEditable())✏️ تعديل@endif + عرض جديد 📋 كل العروض {{ $quote->status_label }}
@if($quote->isEditable())
تحديث الحالة: @foreach(['sent' => 'تم الإرسال للعميل', 'accepted' => 'العميل وافق', 'rejected' => 'العميل رفض', 'draft' => 'إرجاع لمسودة'] as $k => $lbl) @if($quote->status !== $k)
@csrf
@endif @endforeach
@csrf @method('DELETE')
@elseif($quote->order)
تحوّل إلى الطلب #{{ $quote->order->queue_label }} — {{ $quote->order->order_number }}
@endif
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @endunless

{{ $company['name'] }}

@if($company['address'])
{{ $company['address'] }}
@endif @if($company['vat_no'])
الرقم الضريبي: {{ $company['vat_no'] }}
@endif @if($company['cr_no'])
السجل التجاري: {{ $company['cr_no'] }}
@endif

عرض سعر

{{ $quote->quote_number }}
العميل:{{ $quote->customer_name ?: '—' }}
تاريخ العرض:{{ $quote->quote_date->format('Y-m-d') }}
الجوال:{{ $quote->customer_phone ?: '—' }}
صالح حتى:{{ optional($quote->valid_until)->format('Y-m-d') ?: '—' }}@if($eff === 'expired') (منتهي)@endif
@if($quote->subject)
الموضوع:{{ $quote->subject }}
@endif
@foreach($quote->items as $i => $it) @endforeach
#الوجبةالكميةسعر الوحدةالإجمالي
{{ $i + 1 }} {{ $it->name }}@if($it->size_name && $it->size_name !== 'عادي') — {{ $it->size_name }}@endif {{ $it->qty }} {{ $n($it->unit_price) }} {{ $n($it->line_total) }}
المجموع (بدون ضريبة){{ $n($quote->subtotal) }}
@if($quote->discount > 0)
الخصم-{{ $n($quote->discount) }}
@endif
ضريبة القيمة المضافة ({{ rtrim(rtrim(number_format($quote->vat_rate, 2), '0'), '.') }}%){{ $n($quote->vat_amount) }}
الإجمالي شامل الضريبة{{ $n($quote->total) }} ر.س
@if($quote->notes)
ملاحظات وشروط:
{{ $quote->notes }}
@endif
أعدّه: {{ $quote->creator->name ?? '-' }}الأسعار المذكورة سارية حتى تاريخ الصلاحية أعلاه.
@if($quote->isEditable() && !$print)

⚡ تحويل العرض إلى طلب مطعم

يُسجَّل الطلب بنفس أسعار العرض على وردية الكاشير الحالية{{ $hasShift ? '' : ' — لا توجد لديك وردية مفتوحة، افتح وردية من شاشة الكاشير أولاً' }}.
@csrf
@endif