@if (isset($data) && $data->count() > 0)
@php // جلب قيمة الضريبة مرة واحدة خارج الحلقة لتحسين الأداء $saleavt = App\Models\Avt::find(1)->AVT ?? 0.15; @endphp @foreach ($data as $product) @endforeach
{{ __('home.Invoice_no') }} {{ __('home.sallerName') }} {{ __('home.clietName') }} {{ __('home.date') }} {{ __('home.branch') }} {{ __('home.total') }} {{ __('home.operations') }}
{{ $product->id }} {{ $product->user->name ?? 'N/A' }} {{ $product->customer->name ?? __('home.Cash Custome') }} {{ $product->created_at->format('Y-m-d H:i') }} {{ $product->branch->name ?? '' }} @php $netPrice = $product->Price - $product->discount; $totalWithTax = round($netPrice + ($netPrice * $saleavt), 2); @endphp @if($totalWithTax == 0) {{ __('home.return') }} @else {{ number_format($totalWithTax, 2) }} {{ __('home.SAR') }} @endif
@else @endif