@extends('layouts.front.home') @section('title') {{ app()->getLocale() === 'ar' ? 'فواتير المورد' : 'Vendor Invoices' }} - Vendor | Hema @endsection @section('css') @endsection @section('content') @php $isAr = app()->getLocale() === 'ar'; @endphp
@include('flash::message')

{{ $isAr ? 'فواتير المورد' : 'Vendor Invoices' }}

{{ $isAr ? 'راجع فواتير الطلبات، حالة الدفع، والطلبات المجدولة من مكان واحد بتصميم واضح وسهل المتابعة.' : 'Review order invoices, payment status, and scheduled requests from one clean and easy-to-track place.' }}

{{ $isAr ? 'مدفوع' : 'Paid' }}

{{ number_format((int) $totals['paid']) }}

{{ $isAr ? 'غير مدفوع' : 'Unpaid' }}

{{ number_format((int) $totals['pending']) }}

{{ $isAr ? 'مكتمل' : 'Completed' }}

{{ number_format((int) $totals['completed']) }}

{{ $isAr ? 'ملغي' : 'Cancelled' }}

{{ number_format((int) $totals['cancelled']) }}

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

{{ $isAr ? 'حدد الفترة أو حالة الطلب أو حالة الدفع للوصول للفواتير المطلوبة بسرعة.' : 'Choose a date range, order status, or payment status to find invoices faster.' }}

@if(request()->hasAny(['date_from', 'date_to', 'order_status', 'payment_status'])) {{ $isAr ? 'إعادة ضبط' : 'Reset' }} @endif
{{ $isAr ? 'قائمة الفواتير' : 'Invoice List' }}

{{ $isAr ? 'كل الفواتير المرتبطة بطلباتك وحالات الدفع.' : 'All invoices linked to your orders and payment statuses.' }}

{{ method_exists($invoices, 'total') ? number_format($invoices->total()) : number_format($invoices->count()) }} {{ $isAr ? 'فاتورة' : 'Invoices' }}
@forelse($invoices as $order) @php $isPaid = (string)($order->payment_status ?? '') === '1' || (string)($order->payment_status ?? '') === 'paid'; $statusState = $order->front_status_state ?? ['text' => ($isAr ? 'قيد الانتظار' : 'Pending'), 'class' => 'chip-pending']; $statusChipClass = $statusState['class'] ?? 'chip-pending'; if (str_starts_with($statusChipClass, 'chip-')) { $statusChipClass = 'vi-chip-' . substr($statusChipClass, 5); } @endphp @empty @endforelse
# {{ $isAr ? 'تفاصيل الطلب' : 'Order Details' }} {{ $isAr ? 'الإجمالي' : 'Total' }} {{ $isAr ? 'الدفع' : 'Payment' }} {{ $isAr ? 'الحالة' : 'Status' }} {{ $isAr ? 'التاريخ' : 'Date' }}
#{{ $order->id }} {{ $isAr ? 'طلب' : 'Order' }} #{{ $order->id }} {{ $order->user->name ?? '-' }} {{ number_format((float)($order->total_cost ?? 0), 2) }} SAR {{ $isPaid ? ($isAr ? 'مدفوع' : 'Paid') : ($isAr ? 'غير مدفوع' : 'Unpaid') }} {{ $statusState['text'] ?? ($isAr ? 'قيد الانتظار' : 'Pending') }} {{ optional($order->created_at)->format('Y-m-d') }}
{{ $isAr ? 'لا توجد فواتير' : 'No invoices found' }}

{{ $isAr ? 'جرّب تغيير الفلاتر أو راجع الطلبات لاحقاً.' : 'Try changing the filters or check again later.' }}

@if(method_exists($invoices, 'hasPages') && $invoices->hasPages())
{{ $invoices->withQueryString()->links('pagination::bootstrap-5') }}
@endif
@endsection