@php $pdfLocale = app()->getLocale(); $isRtl = $pdfLocale === 'ar'; $rtlLabelSuffix = $isRtl ? '' : ':'; @endphp Quotation - {{$quote['Ref']}} @php $priceFormat = $setting['price_format'] ?? null; function formatPrice($number, $decimals = 2, $priceFormat = null) { $number = (float) $number; $decimals = (int) $decimals; if (empty($priceFormat)) { return number_format($number, $decimals, '.', ','); } switch ($priceFormat) { case 'comma_dot': return number_format($number, $decimals, '.', ','); case 'dot_comma': return number_format($number, $decimals, ',', '.'); case 'space_comma': return number_format($number, $decimals, ',', ' '); default: return number_format($number, $decimals, '.', ','); } } $quoPillKeys = ['sent', 'pending', 'draft']; $statusKey = strtolower($quote['statut']); $quoStatusPill = in_array($statusKey, $quoPillKeys, true) ? $statusKey : 'default'; @endphp @php $pdfCssPath = public_path('css/pdf.css'); @endphp @if (is_file($pdfCssPath) && is_readable($pdfCssPath)) @endif @php $x = public_path('css/quotation_pdf.css'); @endphp @if (is_file($x) && is_readable($x)) @endif
{{ __('pdf.quotation') }}
{{$quote['Ref']}}
{{ __('pdf.date') }}{{ $isRtl ? '' : ':' }} @php $dateFormat = $setting['date_format'] ?? 'YYYY-MM-DD'; $dateTime = \Carbon\Carbon::parse($quote['date']); $phpDateFormat = str_replace(['YYYY', 'MM', 'DD'], ['Y', 'm', 'd'], $dateFormat); $hasTime = strpos($quote['date'], ' ') !== false && preg_match('/\d{1,2}:\d{2}/', $quote['date']); if ($hasTime) { $formattedDate = $dateTime->format($phpDateFormat . ' H:i'); if (preg_match('/:\d{2}:\d{2}/', $quote['date'])) { $formattedDate = $dateTime->format($phpDateFormat . ' H:i:s'); } } else { $formattedDate = $dateTime->format($phpDateFormat); } @endphp {{$formattedDate}}
{{ __('pdf.quote_no') }}{{ $isRtl ? '' : ':' }} {{$quote['Ref']}}
{{ __('pdf.status') }}{{ $isRtl ? '' : ':' }} {{$quote['statut']}}
{{ __('pdf.quote_for') }}
{{$quote['client_name']}}
@if($isRtl) @if($quote['client_tax']) @endif @else @if($quote['client_tax']) @endif @endif
{{$quote['client_phone']}}{{ __('pdf.phone') }}
{{$quote['client_email']}}{{ __('pdf.email') }}
{{$quote['client_adr']}}{{ __('pdf.address') }}
{{$quote['client_tax']}}{{ __('pdf.tax_no') }}
{{ __('pdf.phone') }}:{{$quote['client_phone']}}
{{ __('pdf.email') }}:{{$quote['client_email']}}
{{ __('pdf.address') }}:{{$quote['client_adr']}}
{{ __('pdf.tax_no') }}:{{$quote['client_tax']}}
{{ __('pdf.from') }}
{{$setting['CompanyName']}}
@if($isRtl) @else @endif
{{$setting['CompanyPhone']}}{{ __('pdf.phone') }}
{{$setting['email']}}{{ __('pdf.email') }}
{{$setting['CompanyAdress']}}{{ __('pdf.address') }}
{{ __('pdf.phone') }}:{{$setting['CompanyPhone']}}
{{ __('pdf.email') }}:{{$setting['email']}}
{{ __('pdf.address') }}:{{$setting['CompanyAdress']}}
@php $rowIndex = 0; @endphp @foreach ($details as $detail) @php $rowIndex++; @endphp @endforeach
{{ __('pdf.product') }} {{ __('pdf.price') }} {{ __('pdf.qty') }} {{ __('pdf.disc') }} {{ __('pdf.tax') }} {{ __('pdf.total') }}
{{$detail['name']}}
{{ __('pdf.code') }} {{$detail['code']}}
@if($detail['is_imei'] && $detail['imei_number'] !==null)
{{ __('pdf.sn') }} {{$detail['imei_number']}}
@endif
{{formatPrice((float)$detail['price'], 2, $priceFormat)}} {{$detail['quantity']}} {{$detail['unitSale']}} {{formatPrice((float)$detail['DiscountNet'], 2, $priceFormat)}} {{formatPrice((float)$detail['taxe'], 2, $priceFormat)}} {{formatPrice((float)$detail['total'], 2, $priceFormat)}}
@if($isRtl) @else @endif
{{$symbol}} {{formatPrice((float)($quote['GrandTotal'] - $quote['TaxNet'] + $quote['discount'] - $quote['shipping']), 2, $priceFormat)}} {{ __('pdf.subtotal') }}{!! $rtlLabelSuffix !!}
{{$symbol}} {{formatPrice((float)$quote['TaxNet'], 2, $priceFormat)}} {{ __('pdf.order_tax') }}{!! $rtlLabelSuffix !!}
- {{$symbol}} {{formatPrice((float)$quote['discount'], 2, $priceFormat)}} {{ __('pdf.discount') }}{!! $rtlLabelSuffix !!}
{{$symbol}} {{formatPrice((float)$quote['shipping'], 2, $priceFormat)}} {{ __('pdf.shipping') }}{!! $rtlLabelSuffix !!}
{{$symbol}} {{formatPrice((float)$quote['GrandTotal'], 2, $priceFormat)}} {{ __('pdf.total_label') }}{!! $rtlLabelSuffix !!}
{{ __('pdf.subtotal') }} {{$symbol}} {{formatPrice((float)($quote['GrandTotal'] - $quote['TaxNet'] + $quote['discount'] - $quote['shipping']), 2, $priceFormat)}}
{{ __('pdf.order_tax') }} {{$symbol}} {{formatPrice((float)$quote['TaxNet'], 2, $priceFormat)}}
{{ __('pdf.discount') }} - {{$symbol}} {{formatPrice((float)$quote['discount'], 2, $priceFormat)}}
{{ __('pdf.shipping') }} {{$symbol}} {{formatPrice((float)$quote['shipping'], 2, $priceFormat)}}
{{ __('pdf.total_label') }} {{$symbol}} {{formatPrice((float)$quote['GrandTotal'], 2, $priceFormat)}}