@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, '.', ','); } } @endphp
|
@if(!empty($setting['logo']) && file_exists(public_path('images/'.$setting['logo'])))
|
BOOKING
{{$booking['Ref'] ?? '#'.$booking['id']}}
|
| SERVICE DETAILS | VALUE |
|---|---|
| Service | {{$booking['product_name']}} |
| 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}} |
| Start Time | {{$booking['booking_time']}} |
| End Time | {{$booking['booking_end_time']}} |
| Status | @php $statusColors = [ 'pending' => ['bg' => '#fef3c7', 'color' => '#92400e'], 'confirmed' => ['bg' => '#d1fae5', 'color' => '#065f46'], 'cancelled' => ['bg' => '#fee2e2', 'color' => '#991b1b'], 'completed' => ['bg' => '#dbeafe', 'color' => '#1e40af'], ]; $statusKey = strtolower($booking['status']); $statusStyle = $statusColors[$statusKey] ?? ['bg' => '#e5e7eb', 'color' => '#374151']; @endphp {{$booking['status']}} |
{{$setting['invoice_footer']}}
Thank you for your booking!