{{-- Documento del informe. Se usa en: - la vista previa en vivo del editor ($pdf = false) - el PDF generado con DomPDF ($pdf = true) Recibe: $doc (array), $settings (array), $pdf (bool), $logoSrc (?string) --}} @php use App\Support\DocumentAsset; $pdf = $pdf ?? false; $sections = $doc['sections'] ?? []; $date = $doc['service_date'] ?? null; $dateText = $date ? $date->locale('es')->translatedFormat('d \d\e F \d\e Y') : '—'; $signature = $doc['signature'] ?? null; @endphp
|
{{ $settings['company_name'] }}
|
@endif
@if ($settings['show_code'])
{{ $doc['code'] ?? 'INF-XXXX-XXXX' }} {{ $dateText }} |
@endif
| {{ $settings['client_label'] }} | {{ $doc['client_name'] ?: '—' }} | Fecha | {{ $dateText }} |
| {{ $settings['location_label'] }} | {{ $doc['client_location'] ?: '—' }} | ||
{{ $section['description'] }}
@endif @switch($section['type']) @case('richtext') @if (filled($content['html'] ?? null))Escribe el contenido de esta sección…
@endif @break @case('key_value')| {{ $col }} | @endforeach
|---|
| {{ $cell }} | @endforeach
|
• {{ trim($label.' '.($i + 1)) }}@if (filled($item['title'])) - {{ $item['title'] }}@endif:
{{ $item['caption'] }}
@if ($src)
Sin imagen
@endif
|
@endforeach
@for ($k = count($chunk); $k < $cols; $k++)
@endfor |
Agrega secciones para ver aquí la vista previa del informe.
@endunless @endforelse @php // Firmas: técnico (izquierda) y cliente (derecha), en la misma fila. $signatures = []; if (($settings['show_signature'] ?? true) && $signature) { $signatures[] = [ 'label' => $settings['technician_signature_label'] ?? 'Técnico responsable', 'name' => $signature['name'] ?? '', 'position' => $signature['position'] ?? null, 'src' => DocumentAsset::src($signature['path'] ?? null, $pdf), ]; } if ($settings['show_client_signature'] ?? true) { $clientSignature = $doc['client_signature'] ?? []; $signatures[] = [ 'label' => $settings['client_signature_label'] ?? 'Conformidad del cliente', 'name' => ($clientSignature['name'] ?? null) ?: ($doc['client_name'] ?? ''), 'position' => $clientSignature['position'] ?? null, 'src' => DocumentAsset::src($clientSignature['path'] ?? null, $pdf), ]; } @endphp @if (count($signatures))|
@if ($sig['src'])
{{ $sig['name'] ?: ' ' }}
@if (filled($sig['position']))
{{ $sig['position'] }}
@endif
@if (filled($sig['label']))
{{ $sig['label'] }}
@endif
|
@endforeach