@php // Number-to-words helper (used for both the riyal and halala portions below). // Extracted once instead of being duplicated inline. function numberToWords($num) { $num = (int) str_replace([',', ''], '', trim((string) $num)); if (!$num) { return ''; } $words = []; $list1 = [ '', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', ]; $list2 = ['', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', 'hundred']; $list3 = [ '', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion', 'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion', ]; $numLength = strlen($num); $levels = (int) (($numLength + 2) / 3); $maxLength = $levels * 3; $num = substr('00' . $num, -$maxLength); $numLevels = str_split($num, 3); for ($i = 0; $i < count($numLevels); $i++) { $levels--; $hundreds = (int) ($numLevels[$i] / 100); $hundreds = $hundreds ? ' ' . $list1[$hundreds] . ' hundred ' : ''; $tens = (int) ($numLevels[$i] % 100); $singles = ''; if ($tens < 20) { $tens = $tens ? ' and ' . $list1[$tens] . ' ' : ''; } else { $tensDigit = (int) ($tens / 10); $singlesDigit = (int) ($numLevels[$i] % 10); $tens = ' and ' . $list2[$tensDigit] . ' '; $singles = ' ' . $list1[$singlesDigit] . ' '; } $words[] = $hundreds . $tens . $singles . (($levels && (int) $numLevels[$i]) ? ' ' . $list3[$levels] . ' ' : ''); } $words = implode(' ', $words); $words = preg_replace('/^\s\b(and)/', '', $words); return ucfirst(trim($words)); } @endphp @php $logo = camplogo; @endphp
{{ Nameen }}
{{ describtionen }} {{ STen }} {{ Taxen }}
{{ Namear }}
{{ describtionar }} {{ STar }} {{ Taxar }}
عرض تسعيرة للعميل QUOTATION
@php $offer_price_to_customer = App\Models\offer_price_to_customer::find($itemsRequest[0]->order_id); $avt = App\Models\Avt::find(1); @endphp
{{ $offer_price_to_customer->customer->name }} اسم العميلCLIENT NAME
{{ $offer_price_to_customer->customer->tax_no }} الرقم الضريبيTAX NUMBER
{{ $offer_price_to_customer->created_at }} تاريخ التسعيرةQuote DATE
{{ $offer_price_to_customer->id }} رقم التسعيرةQuote NUMBER

@php $i = 0; $totalpricePurchases = 0; $totaldiscount = 0; @endphp @foreach ($itemsRequest as $product) @php $i++; $totalpricePurchases += $product->PriceWithoudTax * $product->quantity; $totaldiscount += $product->discount; @endphp @endforeach
Total AFTER DISCOUNTالاجمالي بعد الخصم DISCOUNTالخصم Totalالاجمالي QUANTITYالكمية PRODUCT PRICEسعر القطعة ITEM NAMEاسم الصنف Item NOرقم منتج NOرقم
{{ round(($product->quantity * $product->PriceWithoudTax) - $product->discount, 2) }} {{ $product->discount }} {{ $product->quantity * $product->PriceWithoudTax }} {{ $product->quantity }} {{ $product->PriceWithoudTax }} {{ $product->productData->product_name }} {{ $product->productData->Product_Code }} {{ $i }}

@php $total = round((round($totalpricePurchases, 2) - round($totaldiscount, 2)) * $avt->AVT, 2) + (round($totalpricePurchases, 2) - round($totaldiscount, 2)); [$whole, $decimal] = explode('.', number_format((float) $total, 2, '.', '')); $decimalDigits = str_split($decimal); $decimalValue = $decimalDigits[0] === '0' ? (int) $decimalDigits[1] : (int) $decimal; $decimalWords = $decimalValue !== 0 ? numberToWords($decimalValue) : 'Zero'; $wholeWords = numberToWords((int) $whole); @endphp
{{ round($totalpricePurchases, 2) }} الاجماليSUB TOTAL
{{ round($totaldiscount, 2) }} الخصمDISCOUNT
{{ round($totalpricePurchases, 2) - round($totaldiscount, 2) }} الاجمالي بعد الخصمSUB TOTAL AFTER DISCOUNT
{{ round((round($totalpricePurchases, 2) - round($totaldiscount, 2)) * $avt->AVT, 2) }} ضريبة القيمة المضافة ({{ $avt->AVT * 100 }}%)VALUE ADDED TAX
{{ number_format(round($total, 2), 2, '.', '') }}
الاجمالي الكليNET TOTAL
البنك العربي الوطني
Account Number : 0108095553810016
IBAN Number : SA9830400108095553810016