@if (@isset($data) && !@empty($data) && count($data) > 0) @php $i = 1; $avt = App\Models\Avt::find(1); $saleavt = $avt ? $avt->AVT : 0; @endphp
@foreach ($data as $product) @php $netPrice = ($product->Price - $product->discount); $totalWithTax = round($netPrice + ($netPrice * $saleavt), 2); $formattedTotal = $totalWithTax == 0 ? __('home.return') : $totalWithTax; $pay = match($product->Pay) { 'Cash' => __('report.cash'), 'Shabka' => __('report.shabka'), 'Credit' => __('report.credit'), 'Bank_transfer' => __('home.Bank_transfer'), default => __('home.Partition of the amount') }; $phone = "966" . substr($product->customer->phone ?? 0, 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 @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 }} {{ $product->branch->name ?? '' }} {{ $formattedTotal }} {{ $pay }} @if($product->Pay == "Partition")
{{ __('report.cash') }} : {{ $totalWithTax == 0 ? __('home.return') : $totalWithTax - $product->bankamount - $product->Bank_transfer }} {{ __('report.shabka') }} : {{ $product->bankamount }} {{ __('home.Bank_transfer') }} : {{ $product->Bank_transfer }} @endif
@if($product->sent_to_zatca == 1) {{ __('home.sent') }} @else {{ __('home.not_sent') }} @endif

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