@if (isset($products) && !empty($products) && count($products) > 0)
| # | {{ __('report.invoiceNo') }} | {{ __('home.productNo') }} | {{ __('home.product') }} | {{ __('report.date') }} | {{ __('home.operationtype') }} | - | {{ __('home.quantity') }} | {{-- عنوان السعر يظهر دائمًا أو يمكن تغليفه بـ can إذا أردت إخفاء العمود بالكامل --}}{{ __('home.price') }} | @can('System setting'){{ __('home.operations') }} | @endcan
|---|---|---|---|---|---|---|---|---|---|
| {{ $index + 1 }} | {{ $invoice['id'] }} | {{ $invoice['Product_Code'] }} | {{ $invoice['product_name'] }} | {{ $invoice['created_at'] }} | {{ $invoice['operation'] }} | {{ $invoice['man'] }} | {{ $invoice['quantity'] }} | {{-- منطق عرض السعر --}}@if($invoice['type'] != 4) {{-- يظهر السعر للجميع طالما النوع ليس 4 --}} {{ number_format($invoice['price'], 2) }} @else {{-- إذا كان النوع 4، نتحقق من الصلاحية --}} @can('System setting') {{ number_format($invoice['price'], 2) }} @else - @endcan @endif | {{-- عمود العمليات --}} @can('System setting')@php if($invoice['type'] == 1) { $url = "showInvoiceRecent/" . $invoice['id']; $label = __('home.show'); $isPrintBtn = false; } elseif($invoice['type'] == 3) { $url = "print_Transfer_products/" . $invoice['id']; $label = __('home.show'); $isPrintBtn = false; } elseif($invoice['type'] == 4) { $url = url('purchasesShow/' . $invoice['id']); $label = __('home.print'); $isPrintBtn = true; } else { $url = url('printreturnInvoice/' . $invoice['id']); $label = __('home.print'); $isPrintBtn = true; } @endphp @if(!$isPrintBtn) {{ $label }} @else {{ $label }} @endif | @endcan