@php $pdfLocale = app()->getLocale(); $isRtl = $pdfLocale === 'ar'; @endphp Service Job - #{{$job['id']}} @php $statusColors = [ 'pending' => ['bg' => '#fef3c7', 'color' => '#92400e'], 'intake' => ['bg' => '#fef3c7', 'color' => '#92400e'], 'diagnostic' => ['bg' => '#e0f2fe', 'color' => '#075985'], 'quoted' => ['bg' => '#e0f2fe', 'color' => '#075985'], 'approved' => ['bg' => '#dbeafe', 'color' => '#1e40af'], 'in_progress' => ['bg' => '#dbeafe', 'color' => '#1e40af'], 'ready' => ['bg' => '#d1fae5', 'color' => '#065f46'], 'delivered' => ['bg' => '#d1fae5', 'color' => '#065f46'], 'completed' => ['bg' => '#d1fae5', 'color' => '#065f46'], 'declined' => ['bg' => '#fee2e2', 'color' => '#991b1b'], 'cancelled' => ['bg' => '#fee2e2', 'color' => '#991b1b'], ]; $statusKey = strtolower($job['status'] ?? 'pending'); $statusStyle = $statusColors[$statusKey] ?? ['bg' => '#e5e7eb', 'color' => '#374151']; $statusLabel = ucfirst(str_replace('_', ' ', $job['status'] ?? '')); $paymentColors = [ 'paid' => ['bg' => '#d1fae5', 'color' => '#065f46'], 'partial' => ['bg' => '#fef3c7', 'color' => '#92400e'], 'unpaid' => ['bg' => '#fee2e2', 'color' => '#991b1b'], ]; $paymentKey = strtolower($job['payment_status'] ?? 'unpaid'); $paymentStyle = $paymentColors[$paymentKey] ?? ['bg' => '#e5e7eb', 'color' => '#374151']; $cur = $symbol ?? ''; @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.service_job') }}
{{$job['Ref'] ?? '#'.$job['id']}}
{{ __('pdf.date') }}{{ $isRtl ? '' : ':' }} @if(!empty($job['scheduled_date'])) @php $dateFormat = $setting['date_format'] ?? 'YYYY-MM-DD'; $dateTime = \Carbon\Carbon::parse($job['scheduled_date']); $phpDateFormat = str_replace(['YYYY', 'MM', 'DD'], ['Y', 'm', 'd'], $dateFormat); $formattedDate = $dateTime->format($phpDateFormat); @endphp {{$formattedDate}} @else - @endif
{{ __('pdf.status') }}{{ $isRtl ? '' : ':' }} {{$statusLabel}}
Payment: {{ ucfirst($paymentKey) }}
{{ __('pdf.customer') }}
{{$job['client_name']}}
@if(!empty($job['client_phone']) && $job['client_phone'] !== '-')
{{ __('pdf.phone') }}{{ $isRtl ? '' : ':' }} {{$job['client_phone']}}
@endif @if(!empty($job['client_email']) && $job['client_email'] !== '-')
{{ __('pdf.email') }}{{ $isRtl ? '' : ':' }} {{$job['client_email']}}
@endif @if(!empty($job['client_adr']) && $job['client_adr'] !== '-')
{{ __('pdf.address') }}{{ $isRtl ? '' : ':' }} {{$job['client_adr']}}
@endif
COMPANY
{{$setting['CompanyName']}}
Phone: {{$setting['CompanyPhone']}}
Email: {{$setting['email']}}
Address: {{$setting['CompanyAdress']}}
@if(!empty($job['device_brand']) || !empty($job['device_model']) || !empty($job['device_serial']) || !empty($job['device_imei'])) @if(!empty($job['device_brand'])) @endif @if(!empty($job['device_model'])) @endif @if(!empty($job['device_color'])) @endif @if(!empty($job['device_serial'])) @endif @if(!empty($job['device_imei']) || !empty($job['accessories'])) @if(!empty($job['device_imei'])) @endif @if(!empty($job['accessories']) && is_array($job['accessories'])) @endif @endif
Device Information
Brand:
{{$job['device_brand']}}
Model:
{{$job['device_model']}}
Color:
{{$job['device_color']}}
Serial:
{{$job['device_serial']}}
IMEI: {{$job['device_imei']}}Accessories: {{ implode(', ', $job['accessories']) }}
@endif @if(!empty($job['reported_issue']) || !empty($job['diagnosis']) || !empty($job['condition_on_arrival'])) @if(!empty($job['condition_on_arrival'])) @endif @if(!empty($job['reported_issue'])) @endif @if(!empty($job['diagnosis'])) @endif
Condition on Arrival
{{$job['condition_on_arrival']}}
Reported Issue
{{$job['reported_issue']}}
Technician Diagnosis
{{$job['diagnosis']}}
@endif @if(!empty($job['job_type'])) @endif @if(!empty($job['delivered_at'])) @endif @if(!empty($job['warranty_expires_at'])) @endif
{{ __('pdf.job_details') }} {{ __('pdf.value') }}
{{ __('pdf.service_item') }} {{$job['service_item']}}
Job Type {{$job['job_type']}}
{{ __('pdf.technician') }} {{$job['technician_name']}}
Delivered On {{ \Carbon\Carbon::parse($job['delivered_at'])->format('Y-m-d H:i') }}
Warranty Until {{ \Carbon\Carbon::parse($job['warranty_expires_at'])->format('Y-m-d') }}
@if(!empty($job['items']) && count($job['items']) > 0) @foreach($job['items'] as $idx => $row) @endforeach @if(!empty($job['diagnostic_fee']) && (float)$job['diagnostic_fee'] > 0) @endif @if((float)($job['paid_amount'] ?? 0) > 0) @endif
Type Description Qty Unit Price Total
{{ $row['type'] ?? 'part' }} {{ $row['description'] }} {{ $row['quantity'] }} {{ $cur }}{{ number_format((float)$row['unit_price'], 2) }} {{ $cur }}{{ number_format((float)$row['total'], 2) }}
Diagnostic Fee {{ $cur }}{{ number_format((float)$job['diagnostic_fee'], 2) }}
GRAND TOTAL {{ $cur }}{{ number_format((float)$job['total_amount'], 2) }}
Paid {{ $cur }}{{ number_format((float)$job['paid_amount'], 2) }}
Balance Due {{ $cur }}{{ number_format((float)$job['total_amount'] - (float)$job['paid_amount'], 2) }}
@endif @if(!empty($job['payments']) && count($job['payments']) > 0) @foreach($job['payments'] as $idx => $p) @endforeach
Payment History
Reference Date Kind Method Amount
{{ $p['Ref'] }} {{ $p['date'] }} {{ $p['payment_kind'] ?? 'payment' }} {{ $p['payment_method'] ?? '-' }} {{ $cur }}{{ number_format((float)$p['montant'], 2) }}
@endif @if(!empty($job['checklist']) && count($job['checklist']) > 0) @foreach($job['checklist'] as $index => $item) @endforeach
✓ Category Item
{{$item['is_completed'] ? '✓' : '○'}} {{$item['category_name'] ?? '-'}} {{$item['item_name']}}
@endif @if(!empty($job['notes']))
NOTES
{{$job['notes']}}
@endif @if(!empty($job['delivered_at']))
I acknowledge receipt of the device in working condition. Warranty period: {{ $job['warranty_days'] ?? 30 }} days @if(!empty($job['warranty_expires_at'])) (until {{ \Carbon\Carbon::parse($job['warranty_expires_at'])->format('Y-m-d') }}) @endif.
Customer signature{{ !empty($job['pickup_signature']) ? ' — '.$job['pickup_signature'] : '' }}
@endif
@if(!empty($setting['is_invoice_footer']) && !empty($setting['invoice_footer']))

{{$setting['invoice_footer']}}

@endif

Thank you for your business!