@if (isset($products) && !empty($products) && count($products) > 0)
{{-- عنوان السعر يظهر دائمًا أو يمكن تغليفه بـ can إذا أردت إخفاء العمود بالكامل --}} @can('System setting') @endcan @foreach ($products as $index => $invoice) {{-- منطق عرض السعر --}} {{-- عمود العمليات --}} @can('System setting') @endcan @endforeach
# {{ __('report.invoiceNo') }} {{ __('home.productNo') }} {{ __('home.product') }} {{ __('report.date') }} {{ __('home.operationtype') }} - {{ __('home.quantity') }}{{ __('home.price') }}{{ __('home.operations') }}
{{ $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 @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
@else
{{ __('home.notfounddata') }}
@endif