{{-- Per-job section for PDF reports. Expects $job (with relations loaded) and $svgTrack. --}} {{-- Customer Info --}} @php $pdfCustomer = $job->customerObject?->customer ?? $job->customer; $pdfObject = $job->customerObject; $addrSource = $pdfObject ?? $pdfCustomer; @endphp
{{ __('job.pdf_section_customer') }}
@if ($pdfObject) @endif @if ($addrSource?->street || $addrSource?->zip || $addrSource?->city) @endif @if ($addrSource?->contact_name) @endif
{{ __('job.detail_customer') }} {{ $pdfCustomer?->name ?? '–' }}
{{ __('job.detail_object') }} {{ $pdfObject->name }}
{{ __('job.pdf_address') }} {{ $addrSource->street }}@if($addrSource->street && ($addrSource->zip || $addrSource->city)),@endif {{ $addrSource->zip }} {{ $addrSource->city }}
{{ __('job.pdf_contact') }} {{ $addrSource->contact_name }}
{{-- Job Details --}}
{{ __('job.pdf_section_job') }}
@if ($job->vehicle) @endif
{{ __('job.detail_type') }} {{ $job->type->label() }} @if ($job->is_manual) {{ __('job.detail_manual_badge') }} @endif
{{ __('job.detail_driver') }} {{ $job->user->displayName() }}
{{ __('job.detail_vehicle') }} {{ $job->vehicle->displayLabel() }}
{{ __('job.detail_started_at') }} {{ $job->localStartedAt()->format('d.m.Y H:i') }}
{{ __('job.detail_ended_at') }} @if ($job->ended_at) {{ $job->localEndedAt()->format('d.m.Y H:i') }} ({{ $job->durationFormatted() }}) @else {{ __('job.status_active') }} @endif
{{-- Notes --}} @if ($job->notes)
{{ __('job.detail_notes') }}
{!! nl2br(e($job->notes)) !!}
@endif {{-- Weather --}} @if ($job->weatherSnapshots->where('fetched_at', '!=', null)->isNotEmpty())
{{ __('job.detail_weather') }}
@foreach ($job->weatherSnapshots->whereNotNull('fetched_at') as $snapshot) @endforeach
{{ __('weather.col_moment') }} {{ __('weather.col_temperature') }} {{ __('weather.col_precipitation') }} {{ __('weather.col_snow_depth') }} {{ __('weather.col_weather') }}
{{ $snapshot->moment->label() }} {{ $snapshot->temperature }} °C {{ $snapshot->precipitation }} mm {{ $snapshot->snow_depth }} cm {{ $snapshot->weatherLabel() }}
@endif {{-- GPS Track --}} @if ($job->gpsPoints->isNotEmpty() && $svgTrack)
{{ __('job.detail_gps_track') }} ({{ $job->gpsPoints->count() }} {{ __('job.pdf_points') }})
{!! $svgTrack !!}
@if (isset($gpsTableData) && $gpsTableData['points']->isNotEmpty()) @if ($gpsTableData['sampled'])

{{ __('job.pdf_gps_sampled', ['shown' => $gpsTableData['points']->count(), 'total' => $gpsTableData['total']]) }}

@endif @foreach ($gpsTableData['points'] as $idx => $point) @endforeach
# {{ __('job.pdf_time') }} {{ __('job.pdf_lat') }} {{ __('job.pdf_lon') }}
{{ $idx + 1 }} {{ \Carbon\Carbon::createFromTimestamp($point->timestamp)->setTimezone(config('app.display_timezone'))->format('H:i:s') }} {{ number_format($point->lat, 5) }} {{ number_format($point->lon, 5) }}
@endif
@endif {{-- Photos --}} @if ($job->jobPhotos->isNotEmpty())
{{ __('job.detail_photos') }} ({{ $job->jobPhotos->count() }})
@foreach ($job->jobPhotos->chunk(2) as $row) @foreach ($row as $photo) @endforeach @endforeach
@php $photoPath = $photo->annotated_path ?? $photo->file_path; $photoAbsPath = storage_path('app/public/' . $photoPath); @endphp @if (file_exists($photoAbsPath)) {{ $photo->caption ?? '' }} @endif @if ($photo->caption)
{{ $photo->caption }}
@endif @if ($photo->taken_at)
{{ $photo->taken_at->setTimezone(config('app.display_timezone'))->format('H:i') }}
@endif
@endif