@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, '.', ','); } } @endphp
@php $logoSrc = null; if (!empty($setting['logo'])) { $logoPath = public_path('images/'.$setting['logo']); if (file_exists($logoPath) && is_readable($logoPath)) { $logoData = @file_get_contents($logoPath); if ($logoData !== false) { $logoB64 = base64_encode($logoData); $logoExt = strtolower(pathinfo($logoPath, PATHINFO_EXTENSION)); $logoMime = $logoExt === 'svg' ? 'image/svg+xml' : (in_array($logoExt, ['png','jpeg','jpg','gif','webp'], true) ? 'image/'.$logoExt : 'image/png'); if ($logoExt === 'jpg') { $logoMime = 'image/jpeg'; } $logoSrc = 'data:'.$logoMime.';base64,'.$logoB64; } } } @endphp @if($logoSrc) Logo @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 ? '' : ':' }} @php $statusColors = ['sent' => ['bg' => '#d1fae5', 'color' => '#065f46'], 'pending' => ['bg' => '#fef3c7', 'color' => '#92400e'], 'draft' => ['bg' => '#e5e7eb', 'color' => '#374151']]; $statusKey = strtolower($quote['statut']); $statusStyle = $statusColors[$statusKey] ?? ['bg' => '#dbeafe', 'color' => '#1e40af']; @endphp {{$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)}}
@php $tdAmountLeft = 'padding: 5px 10px; font-size: 8.5pt; font-weight: 600; text-align: left; direction: ltr;'; $tdLabelRight = 'padding: 5px 10px; font-size: 8pt; font-weight: 600; text-align: right; direction: rtl;'; @endphp
@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)}}
@if($setting['is_invoice_footer'] && $setting['invoice_footer'] !==null)

{{$setting['invoice_footer']}}

@endif

{{ __('pdf.thank_you') }}