@if($appLogo) @php $path = storage_path('app/public/' . $appLogo); $type = pathinfo($path, PATHINFO_EXTENSION); if(file_exists($path)) { $data = file_get_contents($path); $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data); echo ''; } @endphp @else
{{ $companyName }}
@endif

Datos del Cliente:

@if($workOrder->inventory_item_id) @php $company = optional(optional($workOrder->inventoryItem)->branch)->company; @endphp
{{ $company->name ?? 'N/A' }}
@if(optional($company)->nit)
NIT: {{ $company->nit }}
@endif @if(optional($company)->address)
{{ $company->address }}
@endif @if(optional($company)->phone)
Tel: {{ $company->phone }}
@endif @if(optional($company)->email)
Email: {{ $company->email }}
@endif @else
{{ $workOrder->client_name }}
@if($workOrder->client_document)
NIT/CC: {{ $workOrder->client_document }}
@endif @if($workOrder->client_phone)
Tel: {{ $workOrder->client_phone }}
@endif @if($workOrder->client_email)
Email: {{ $workOrder->client_email }}
@endif @endif

Orden de Servicio

# {{ $workOrder->order_number }}
Fecha de Ingreso:
{{ $workOrder->received_at->format('d/m/Y h:i A') }}

Estado:
{{ $workOrder->status }}
DATOS DEL EQUIPO
@if($workOrder->inventory_item_id) @else @endif
Equipo: {{ optional($workOrder->inventoryItem)->name ?? 'N/A' }} Tipo: {{ optional($workOrder->inventoryItem)->type ?? 'N/A' }}
Marca / Modelo: {{ optional($workOrder->inventoryItem)->brand ?? 'N/A' }} / {{ optional($workOrder->inventoryItem)->model ?? 'N/A' }} Serial / S/N: {{ optional($workOrder->inventoryItem)->serial_number ?? 'N/A' }}
Tipo: {{ $workOrder->device_type }} Marca / Modelo: {{ $workOrder->device_brand ?? 'N/A' }} / {{ $workOrder->device_model ?? 'N/A' }}
Serial / S/N: {{ $workOrder->device_serial ?? 'N/A' }}
ESTADO DE RECEPCIÓN
Técnico Asignado: {{ optional($workOrder->technician)->name ?? 'Sin asignar' }}
Motivo / Falla: {!! nl2br(e($workOrder->issue_description)) !!}
Condición Física: {{ $workOrder->physical_condition ?: 'Sin observaciones.' }}
Accesorios: {{ $workOrder->accessories_included ?: 'Ninguno.' }}
@php $hasMarkersOrStrokes = false; $markersArray = []; $strokesArray = []; if ($workOrder->device_markers) { if (isset($workOrder->device_markers['markers']) || isset($workOrder->device_markers['strokes'])) { $markersArray = $workOrder->device_markers['markers'] ?? []; $strokesArray = $workOrder->device_markers['strokes'] ?? []; } else { $markersArray = $workOrder->device_markers; } $hasMarkersOrStrokes = count($markersArray) > 0 || count($strokesArray) > 0; } @endphp @if($hasMarkersOrStrokes)
MAPA GRÁFICO DE DAÑOS
@php $type = $workOrder->device_type_for_mapper; // Build markers SVG $markersSvg = ''; foreach($markersArray as $marker) { $char = 'X'; if($marker['type'] === 'scratch') $char = 'R'; if($marker['type'] === 'dent') $char = 'G'; if($marker['type'] === 'crack') $char = 'C'; if($marker['type'] === 'missing') $char = 'P'; if($marker['type'] === 'key') $char = 'T'; $cx = ($marker['x'] / 100) * 800; $cy = ($marker['y'] / 100) * 400; $markersSvg .= ''; $markersSvg .= ''.$char.''; } $svgContent = ''; if($type === 'Laptop') { $svgContent = '' . $markersSvg . ''; } elseif(in_array($type, ['Desktop', 'All-in-One', 'Servidor'])) { $svgContent = '' . $markersSvg . ''; } elseif($type === 'Impresora') { $svgContent = '' . $markersSvg . ''; } else { $svgContent = ''; foreach($strokesArray as $stroke) { $points = collect($stroke)->map(function($p) { return ($p['x'] * 800 / 100) . ',' . ($p['y'] * 400 / 100); })->implode(' '); $svgContent .= ''; } $svgContent .= $markersSvg . ''; } $base64Svg = 'data:image/svg+xml;base64,' . base64_encode($svgContent); @endphp
Leyenda de Daños: [R] Rayón | [G] Golpe | [C] Cristal/Pantalla Rota | [P] Pieza Faltante | [T] Tecla Faltante
@endif @if($workOrder->diagnostic || $workOrder->solution)
INFORME TÉCNICO
Diagnóstico: {!! nl2br(e($workOrder->diagnostic ?: 'Pendiente...')) !!}
Solución: {!! nl2br(e($workOrder->solution ?: 'Pendiente...')) !!}
Fecha de Entrega: {{ $workOrder->delivered_at ? $workOrder->delivered_at->format('d/m/Y h:i A') : 'Pendiente' }} Garantía (Días): {{ $workOrder->warranty_days ?: '0' }}
@endif @if($workOrder->final_cost > 0 || $workOrder->estimated_cost > 0)
COSTOS DEL SERVICIO
Costo Estimado: ${{ number_format($workOrder->estimated_cost, 0) }} Costo Final: ${{ number_format($workOrder->final_cost, 0) }}
@endif
@if($workOrder->reception_signature) @else
@endif
Firma de Recepción (Cliente)
Acepto las condiciones y términos del taller.
@if($workOrder->delivery_signature) @else
@endif
Firma de Entrega (Cliente)
Recibo a entera satisfacción y acepto la garantía.
@if(!empty($workOrder->photos) && count($workOrder->photos) > 0)
@if($appLogo) @php $logoPath2 = storage_path('app/public/' . $appLogo); if(file_exists($logoPath2)) { $logoType2 = pathinfo($logoPath2, PATHINFO_EXTENSION); $logoData2 = file_get_contents($logoPath2); echo ''; } @endphp @else

{{ $appName }}

@endif
Evidencia Fotográfica
Anexo Orden {{ $workOrder->order_number }}
GALERÍA DE EVIDENCIAS
@foreach($workOrder->photos as $photo) @if(is_string($photo) && !empty($photo) && Storage::disk('public')->exists($photo)) @php $photoPath = storage_path('app/public/' . $photo); $photoType = pathinfo($photoPath, PATHINFO_EXTENSION); $photoData = file_get_contents($photoPath); $photoBase64 = 'data:image/' . $photoType . ';base64,' . base64_encode($photoData); @endphp
Evidencia
@endif @endforeach
@endif