@if (@isset($data) && !@empty($data) && count($data) >0 ) @php $i=1; @endphp
@foreach ($data as $product) @endforeach
{{ __('home.Invoice_no') }} {{ __('home.sallerName') }} {{ __('home.clietName') }} {{ __('home.date') }} الخياط الحالة {{ __('home.branch') }} {{ __('home.total') }} {{ __('home.paymentmethod') }} {{ __('home.operations') }}
{{ $product->id }} {{ $product->user->name??'' }} {{ $product->customer->name??'' }} {{ $product->created_at }} {{ $product->employee->name_ar?? "لا يوجد" }} @switch($product->status_invoice) @case('NOT_STARTED') لم يبدأ @break @case('IN_PROGRESS') قيد التنفيذ @break @case('COMPLETED') مكتمل @break @default غير محدد @endswitch {{ $product->branch->name }} @php $totalPaid = ($product->Pay ?? 0) + ($product->cashamount ?? 0) + ($product->bankamount ?? 0) + ($product->Bank_transfer ?? 0); @endphp {{ number_format($totalPaid, 2) }} @php $methods = []; if (($product->cashamount ?? 0) > 0 || $product->payment_methods_text == 'Cash') $methods[] = __('report.cash'); if (($product->bankamount ?? 0) > 0 || $product->payment_methods_text == 'Network (Mada)') $methods[] = __('report.shabka'); if (($product->Bank_transfer ?? 0) > 0 || $product->payment_methods_text == 'Bank_transfer') $methods[] = __('home.Bank_transfer'); if ($product->payment_methods_text == 'Tabby') $methods[] = 'تابي (Tabby)'; if ($product->payment_methods_text == 'Tamara') $methods[] = 'تمارا (Tamara)'; // إزالة التكرار $methods = array_unique($methods); @endphp @if(count($methods) > 1) {{ __('sales.Partition of the amount') }} {{-- تجزئة المبلغ --}} @elseif(count($methods) == 1) {{ $methods[0] }} @else {{-- سيقوم بالبحث عن الترجمة داخل ملف home بناءً على النص القادم --}} {{ __('sales.' . strtolower($product->payment_methods_text ?? '---')) }} @endif @if($product->type == 'ready') {{-- رابط طباعة فاتورة الجاهز --}} @else {{-- رابط طباعة فاتورة التفصيل (القديم) --}} @endif @php // تعريف متغيرات الواتساب داخل الخلية لضمان عدم حدوث Undefined variable $customerPhone = $product->customer->phone ?? ''; $phone = "966" . substr($customerPhone, 1); $link = "https://demoo.ebdeaclients.online/ar/generate_pdf/" . $product->id; $message = "يسرنا خدمتك مرفق لكم فاتورتكم " . "فضلا لتحميل فاتورتك رقم : {$product->id}: {$link}\n" . "For download your invoice number :{$product->id } press here : {$link}"; $waLink = "https://web.whatsapp.com/send?phone={$phone}&text=" . urlencode($message); @endphp @if($product->type == 'fabric') @endif

@else
{{__('home.notfounddata')}}
@endif