@extends('layouts.front.home') @section('title') {{ __('nav.my_offers') }} - Vendor | Hema @endsection @section('css') @endsection @section('content') @php $isAr = app()->getLocale() === 'ar'; @endphp
@include('flash::message')

{{ $isAr ? 'عروضي' : 'My Offers' }}

{{ $isAr ? 'تابع جميع العروض التي قدمتها على الطلبات، وحالاتها، وإجراءات التعديل والحذف.' : 'Track all offers you submitted on orders, their statuses, and edit or delete actions.' }}

{{ $isAr ? 'تصفية العروض' : 'Filter Offers' }}

{{ $isAr ? 'حدد حالة العرض أو ابحث برقم الطلب للوصول السريع.' : 'Choose an offer status or search by order number to find offers faster.' }}

@if(request()->hasAny(['status', 'search'])) {{ $isAr ? 'إعادة ضبط' : 'Reset' }} @endif
{{ $isAr ? 'قائمة العروض' : 'Offers List' }}

{{ $isAr ? 'كل العروض المرتبطة بطلباتك وحالاتها.' : 'All offers linked to your orders and their statuses.' }}

{{ method_exists($offers, 'total') ? number_format($offers->total()) : number_format($offers->count()) }} {{ $isAr ? 'عرض' : 'Offers' }}
@forelse($offers as $offer) @php $status = strtolower($offer->status_label ?? 'pending'); $statusLabel = match($status) { 'accepted' => ($isAr ? 'مقبولة' : 'Accepted'), 'rejected' => ($isAr ? 'مرفوضة' : 'Rejected'), default => ($isAr ? 'قيد الانتظار' : 'Pending'), }; $statusChipClass = match($status) { 'accepted' => 'vo-chip-accepted', 'rejected' => 'vo-chip-rejected', default => 'vo-chip-pending', }; $typeTitle = match((int)($offer->order->order_type ?? 0)) { 1 => $isAr ? 'طلب شراء' : 'Purchase Order', 3 => $isAr ? 'طلب صيانة' : 'Maintenance Request', default => $isAr ? 'طلب تسعير' : 'Quotation Request', }; @endphp @empty @endforelse
# {{ $isAr ? 'تفاصيل العرض' : 'Offer Details' }} {{ $isAr ? 'العميل' : 'Customer' }} {{ $isAr ? 'التكلفة' : 'Cost' }} {{ $isAr ? 'مدة التوصيل' : 'Delivery' }} {{ $isAr ? 'الحالة' : 'Status' }} {{ $isAr ? 'التاريخ' : 'Date' }} {{ $isAr ? 'إجراءات' : 'Actions' }}
#{{ $offer->id }} {{ $isAr ? 'طلب' : 'Order' }} #{{ $offer->order_id }} {{ $typeTitle }} {{ $isAr ? 'رقم العرض' : 'Offer' }} #{{ $offer->id }} {{ $offer->order->user->name ?? '-' }} {{ number_format((float)($offer->cost ?? 0), 2) }} {{ $isAr ? 'ر.س' : 'SAR' }} {{ $offer->delivery_time ?? '-' }} {{ $isAr ? 'يوم' : 'days' }} @if($offer->warranty) {{ $isAr ? 'ضمان' : 'Warranty' }}: {{ $offer->warranty }} @endif {{ $statusLabel }} {{ $offer->created_at->format('Y-m-d') }}
@if($status === 'pending')
@csrf @method('DELETE')
@endif
{{ $isAr ? 'لا توجد عروض' : 'No offers found' }}

{{ $isAr ? 'لم تقدم أي عروض بعد، أو جرّب تغيير الفلاتر.' : 'You haven\'t submitted any offers yet, or try changing the filters.' }}

{{ $isAr ? 'تصفح الطلبات' : 'Browse Orders' }}
@if(method_exists($offers, 'hasPages') && $offers->hasPages())
{{ $offers->appends(['status' => $status, 'search' => $search])->links('pagination::bootstrap-5') }}
@endif
@endsection