@php $pdfLocale = app()->getLocale(); $isRtl = $pdfLocale === 'ar'; $statusKey = strtolower($booking['status'] ?? ''); $statusBadgeClass = [ 'pending' => 'book-status--pending', 'confirmed' => 'book-status--confirmed', 'cancelled' => 'book-status--cancelled', 'completed' => 'book-status--completed', ][$statusKey] ?? 'book-status--default'; @endphp Booking - #{{$booking['id']}} @php // Price formatting helper function $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, '.', ','); } } $bookingPdfCssPath = public_path('css/booking_pdf.css'); @endphp @if (is_file($bookingPdfCssPath) && is_readable($bookingPdfCssPath)) @endif
{{ __('pdf.booking') }}
{{$booking['Ref'] ?? '#'.$booking['id']}}
Date: @php $dateFormat = $setting['date_format'] ?? 'YYYY-MM-DD'; $dateTime = \Carbon\Carbon::parse($booking['booking_date']); $phpDateFormat = str_replace(['YYYY', 'MM', 'DD'], ['Y', 'm', 'd'], $dateFormat); $formattedDate = $dateTime->format($phpDateFormat); @endphp {{$formattedDate}}
{{ __('pdf.reference') }}{{ $isRtl ? '' : ':' }} {{$booking['Ref'] ?? '#'.$booking['id']}}
{{ __('pdf.status') }}{{ $isRtl ? '' : ':' }} {{$booking['status']}}
{{ __('pdf.customer') }}
{{$booking['customer_name']}}
@if($booking['customer_phone'] && $booking['customer_phone'] !== '-')
{{ __('pdf.phone') }}{{ $isRtl ? '' : ':' }} {{$booking['customer_phone']}}
@endif @if($booking['customer_email'] && $booking['customer_email'] !== '-')
{{ __('pdf.email') }}{{ $isRtl ? '' : ':' }} {{$booking['customer_email']}}
@endif @if($booking['customer_adr'] && $booking['customer_adr'] !== '-')
{{ __('pdf.address') }}{{ $isRtl ? '' : ':' }} {{$booking['customer_adr']}}
@endif
{{ __('pdf.company_info') }}
{{$setting['CompanyName']}}
{{ __('pdf.phone') }}{{ $isRtl ? '' : ':' }} {{$setting['CompanyPhone']}}
{{ __('pdf.email') }}{{ $isRtl ? '' : ':' }} {{$setting['email']}}
{{ __('pdf.address') }}{{ $isRtl ? '' : ':' }} {{$setting['CompanyAdress']}}
@if($booking['booking_end_time']) @endif
{{ __('pdf.service_details') }} {{ __('pdf.value') }}
{{ __('pdf.service') }} {{$booking['product_name']}}
{{ __('pdf.price') }} @if($booking['price'] && $booking['price'] > 0) {{$symbol}} {{formatPrice((float)$booking['price'], 2, $priceFormat)}} @else - @endif
Booking Date @php $dateFormat = $setting['date_format'] ?? 'YYYY-MM-DD'; $dateTime = \Carbon\Carbon::parse($booking['booking_date']); $phpDateFormat = str_replace(['YYYY', 'MM', 'DD'], ['Y', 'm', 'd'], $dateFormat); $formattedDate = $dateTime->format($phpDateFormat); @endphp {{$formattedDate}}
{{ __('pdf.start_time') }} {{$booking['booking_time']}}
{{ __('pdf.end_time') }} {{$booking['booking_end_time']}}
{{ __('pdf.status') }} {{$booking['status']}}
@if($booking['notes'])
{{ __('pdf.notes') }}
{{$booking['notes']}}
@endif