@php // Guard against a fatal "cannot redeclare function" error if this // template is ever rendered more than once in the same request. if (!function_exists('ConvertToHEX')) { function ConvertToHEX($value) { return pack('H*', sprintf('%02X', $value)); } } $logo = camplogo; @endphp
{{ Nameen }}
{{ describtionen }} {{ STen }} {{ Taxen }}
{{ Namear }}
{{ describtionar }} {{ STar }} {{ Taxar }}
@if ($data['invoiceData']->customer->id == 1)

Simplified Tax Invoice - فاتورة ضريبية مبسطة

@else

Tax Invoice - فاتورة ضريبية

@endif
@php $pay = ''; if ($data['invoiceData']->Pay == 'Cash') { $pay = __('report.cash'); } elseif ($data['invoiceData']->Pay == 'Shabka') { $pay = __('report.shabka'); } elseif ($data['invoiceData']->Pay == 'Credit') { $pay = __('report.credit'); } elseif ($data['invoiceData']->Pay == 'Bank_transfer') { $pay = __('home.Bank_transfer'); } else { $pay = __('home.Partition of the amount'); } @endphp
{{ $data['invoiceData']->id }} INVOICE NUMBER
رقم الفاتورة
{{ $data['invoiceData']->branch->name }} BRANCH NAME
اسم الفرع
{{ $pay }} PAYMENT METHOD
طريقة الدفع
{{ $data['invoiceData']->created_at }} INVOICE DATE
تاريخ الفاتورة
{{ $data['invoiceData']->p_o ?: '-' }} PURCHASE ORDER
امر الشراء

@if ($data['invoiceData']->customer->address == '-') @else @endif
{{ Namear }} SELLER NAME اسم البائع {{ $data['invoiceData']->customer->name }} CLIENT NAME اسم العميل
{{ Taxen }} TAX NUMBER الرقم الضريبي {{ $data['invoiceData']->customer->tax_no == 0 ? '-' : $data['invoiceData']->customer->tax_no }} TAX NUMBER الرقم الضريبي
{{ defined('city') ? city : '-' }} المدينة CITY {{ $data['invoiceData']->customer->id == 1 ? '-' : $data['invoiceData']->customer->phone }} رقم الجوال PHONE
{{ defined('city') ? city : '-' }} المدينة CITY {{ $data['invoiceData']->customer->id == 1 ? '-' : $data['invoiceData']->customer->address }} العنوان ADDRESS
{{ defined('region') ? region : '-' }} المنطقة REGION {{ $data['invoiceData']->customer->id == 1 ? '-' : $data['invoiceData']->customer->sub_city }} المنطقة REGION
{{ defined('street_name') ? street_name : '-' }} اسم الشارع STREET NAME {{ $data['invoiceData']->customer->id == 1 ? '-' : $data['invoiceData']->customer->street_name }} اسم الشارع STREET NAME
{{ defined('postal_number') ? postal_number : '-' }} الرمز البريدي POSTAL NUMBER {{ $data['invoiceData']->customer->postcode }} الرمز البريدي POSTAL NUMBER
{{ defined('building_number') ? building_number : '-' }} رقم المبنى BUILDING NUMBER {{ $data['invoiceData']->customer->id == 1 ? '-' : $data['invoiceData']->customer->building_number }} رقم المبنى BUILDING NUMBER

@php $i = 0; $discountreturn = 0; @endphp @foreach (App\Models\sales::where('invoice_id', $data['invoiceData']->id)->get() as $product) @if ($product->quantity != 0) @php $i++; @endphp @endif @endforeach @foreach (App\Models\return_sales::where('invoice_id', $data['invoiceData']->id)->get() as $product) @php $i++; $discountreturn += $product->discountvalue + $product->discountoninvoice; @endphp @if ($product->return_quantity != 0) @endif @endforeach
Total AFTER DISCOUNT
الاجمالي بعد الخصم
DISCOUNT
الخصم
Total
الاجمالي
PRODUCT PRICE
سعر القطعة
QUANTITY
الكمية
ITEM NAME
اسم الصنف
Item NO
رقم منتج
NO
رقم
{{ number_format(($product->Unit_Price * $product->quantity) - $product->Discount_Value, 2, '.', '') }} {{ number_format($product->Discount_Value, 2, '.', '') }} {{ number_format($product->Unit_Price * $product->quantity, 2, '.', '') }} {{ number_format($product->Unit_Price, 2, '.', '') }} {{ $product->quantity }} {{ $product->productData->product_name }} {{ $product->productData->Product_Code }} {{ $i }}
{{ number_format((float) (($product->return_Unit_Price * $product->return_quantity) - $product->discountvalue), 2, '.', '') }} {{ number_format((float) $product->discountvalue, 2, '.', '') }} {{ number_format((float) $product->return_Unit_Price * $product->return_quantity, 2, '.', '') }} {{ number_format($product->return_Unit_Price, 2, '.', '') }} {{ $product->return_quantity }} {{ $product->productData->product_name }} {{ $product->productData->Product_Code }} {{ $i }}

@php // ZATCA simplified tax invoice QR payload — logic preserved exactly as original. $invoice = App\Models\invoices::find($data['invoiceData']->id); $price = $invoice->cashamount + $invoice->Bank_transfer + $invoice->bankamount + $invoice->creaditamount; $avt = App\Models\Avt::find(1); $price_befor_tax = ($price * 100) / (100 + $avt->AVT * 100); $invoicetotal_addedvalue = $price_befor_tax * $avt->AVT; $invoicetotal_price = $price_befor_tax; $invoicetotal_discount = $invoice->discount + $discountreturn; $sellerName = sallerQrCode; $varNumber = TaxQrCode; $time = $invoice->created_at; $issue_time = substr($time, 11); $issue_date = substr($time, 0, 10); $time = (string) $issue_date . 'T' . (string) $issue_time; $total = number_format(round($invoicetotal_addedvalue + $invoicetotal_price, 2), 2, '.', ''); $tax = number_format(round($invoicetotal_addedvalue, 2), 2, '.', ''); $HexSeller = ConvertToHEX(1) . ConvertToHEX(strlen($sellerName)); $seller = $HexSeller . $sellerName; $HexVAT = ConvertToHEX(2) . ConvertToHEX(strlen($varNumber)); $vat = $HexVAT . $varNumber; $HexTime = ConvertToHEX(3) . ConvertToHEX(strlen($time)); $time = $HexTime . $time; $HexTotal = ConvertToHEX(4) . ConvertToHEX(strlen($total)); $total = $HexTotal . $total; $HexVATN = ConvertToHEX(5) . ConvertToHEX(strlen($tax)); $VATN = $HexVATN . $tax; $empty = ''; $Hexempty = ConvertToHEX(6) . ConvertToHEX(strlen($empty)); $empty6 = $Hexempty . $empty; $Hexempty = ConvertToHEX(7) . ConvertToHEX(strlen($empty)); $empty7 = $Hexempty . $empty; $Hexempty = ConvertToHEX(8) . ConvertToHEX(strlen($empty)); $empty8 = $Hexempty . $empty; $Hexempty = ConvertToHEX(9) . ConvertToHEX(strlen($empty)); $empty9 = $Hexempty . $empty; $tobase = $seller . $vat . $time . $total . $VATN . $empty6 . $empty7 . $empty8 . $empty9; $dataforQRcode = base64_encode($tobase); @endphp

يمكن ارجاع القطع المباعة او استبدالها خلال 3 ايام من تاريخ الشراء وتكون بحالتها المباعة
والقطع الكهربائية لا ترد ولا تستبدل والطلبات الخاصة لا يمكن ارجاعها او استبدالها بعد تاكيد الطلب

{{ number_format((float) (round($invoicetotal_price, 2) + round($invoicetotal_discount, 2)), 2, '.', '') }} الاجمالي - SUB TOTAL
{{ number_format(round($invoicetotal_discount, 2), 2, '.', '') }} الخصم - DISCOUNT
{{ number_format(round($invoicetotal_price, 2), 2, '.', '') }} الاجمالي بعد الخصم
SUB TOTAL AFTER DISCOUNT
{{ number_format(round($invoicetotal_addedvalue, 2), 2, '.', '') }} ضريبة القيمة المضافة ({{ $avt->AVT * 100 }}%)
VALUE ADDED TAX ({{ $avt->AVT * 100 }}%)
{{ number_format(round($invoicetotal_addedvalue + $invoicetotal_price, 2), 2, '.', '') }} الاجمالي الكلي - NET TOTAL
@if (Auth()->user()->branchs_id == 1)

{{ bankname }}
Account Number : {{ bank_acount_number }}
IBAN Number : {{ bank_acount_iban }}

@endif

البنك العربي الوطني
Account Number :0108095553810016
IBAN Number : SA9830400108095553810016

{{ __('home.notesClient') }} : {{ $data['invoiceData']->note }}