@if (isset($data) && !empty($data) && count($data) > 0)
@php $avtSetting = App\Models\Avt::find(1); $saleavt = $avtSetting ? $avtSetting->AVT : 0.15; @endphp @foreach ($data as $product) @php // حساب الإجمالي مع الضريبة $netPrice = $product->Price - $product->discount; $taxAmount = $netPrice * $saleavt; $totalWithTax = round($netPrice + $taxAmount, 2); // تحديد نص طريقة الدفع $payText = match($product->Pay) { 'Cash' => __('report.cash'), 'Shabka' => __('report.shabka'), 'Credit' => __('report.credit'), 'Bank_transfer' => __('home.Bank_transfer'), default => __('home.Partition of the amount'), }; // تجهيز رابط الواتساب $cleanPhone = "966" . ltrim($product->customer->phone ?? '', '0'); $pdfLink = "https://demoo.ebdeaclients.online/ar/generate_pdf/" . $product->id; $waMessage = "يسرنا خدمتك. فاتورتك رقم {$product->id} جاهزة للتحميل:\n" . $pdfLink; $waFullUrl = "https://wa.me/{$cleanPhone}?text=" . urlencode($waMessage); @endphp @endforeach
{{ __('home.Invoice_no') }} {{ __('home.sallerName') }} {{ __('home.clietName') }} {{ __('home.date') }} {{ __('home.branch') }} {{ __('home.total') }} {{ __('home.paymentmethod') }} الربط مع زكاة (Zatca) {{ __('home.operations') }}
{{ $product->id }} {{ $product->user->name ?? '---' }} {{ $product->customer->name ?? '---' }} {{ $product->created_at->format('Y-m-d H:i') }} {{ $product->branch->name }} @if($totalWithTax == 0) {{ __('home.return') }} @else {{ number_format($totalWithTax, 2) }} @endif {{ $payText }} @if($product->Pay == "Partition")
{{ __('report.shabka') }}: {{ $product->bankamount }} | {{ __('home.Bank_transfer') }}: {{ $product->Bank_transfer }}
@endif
@if($product->sent_to_zatca == 1) مرسلة @else مسودة @endif
@else @endif