{{-- 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') }}
| {{ __('job.detail_customer') }} |
{{ $pdfCustomer?->name ?? '–' }} |
@if ($pdfObject)
| {{ __('job.detail_object') }} |
{{ $pdfObject->name }} |
@endif
@if ($addrSource?->street || $addrSource?->zip || $addrSource?->city)
| {{ __('job.pdf_address') }} |
{{ $addrSource->street }}@if($addrSource->street && ($addrSource->zip || $addrSource->city)),@endif
{{ $addrSource->zip }} {{ $addrSource->city }}
|
@endif
@if ($addrSource?->contact_name)
| {{ __('job.pdf_contact') }} |
{{ $addrSource->contact_name }} |
@endif
{{-- Job Details --}}
{{ __('job.pdf_section_job') }}
| {{ __('job.detail_type') }} |
{{ $job->type->label() }}
@if ($job->is_manual)
{{ __('job.detail_manual_badge') }}
@endif
|
| {{ __('job.detail_driver') }} |
{{ $job->user->displayName() }} |
@if ($job->vehicle)
| {{ __('job.detail_vehicle') }} |
{{ $job->vehicle->displayLabel() }} |
@endif
| {{ __('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') }}
| {{ __('weather.col_moment') }} |
{{ __('weather.col_temperature') }} |
{{ __('weather.col_precipitation') }} |
{{ __('weather.col_snow_depth') }} |
{{ __('weather.col_weather') }} |
@foreach ($job->weatherSnapshots->whereNotNull('fetched_at') as $snapshot)
| {{ $snapshot->moment->label() }} |
{{ $snapshot->temperature }} °C |
{{ $snapshot->precipitation }} mm |
{{ $snapshot->snow_depth }} cm |
{{ $snapshot->weatherLabel() }} |
@endforeach
@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
| # |
{{ __('job.pdf_time') }} |
{{ __('job.pdf_lat') }} |
{{ __('job.pdf_lon') }} |
@foreach ($gpsTableData['points'] as $idx => $point)
| {{ $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) }} |
@endforeach
@endif
@endif
{{-- Photos --}}
@if ($job->jobPhotos->isNotEmpty())
{{ __('job.detail_photos') }} ({{ $job->jobPhotos->count() }})
@foreach ($job->jobPhotos->chunk(2) as $row)
@foreach ($row as $photo)
@php
$photoPath = $photo->annotated_path ?? $photo->file_path;
$photoAbsPath = storage_path('app/public/' . $photoPath);
@endphp
@if (file_exists($photoAbsPath))
@endif
@if ($photo->caption)
{{ $photo->caption }}
@endif
@if ($photo->taken_at)
{{ $photo->taken_at->setTimezone(config('app.display_timezone'))->format('H:i') }}
@endif
|
@endforeach
@endforeach
@endif