{{-- Cover page --}} {{-- Header --}}
@php $companyName = \App\Models\Setting::get('company_name', config('app.name')); $companyStreet = \App\Models\Setting::get('company_street', ''); $companyZip = \App\Models\Setting::get('company_zip', ''); $companyCity = \App\Models\Setting::get('company_city', ''); $companyPhone = \App\Models\Setting::get('company_phone', ''); $companyEmail = \App\Models\Setting::get('company_email', ''); $logoPath = \App\Models\Setting::get('company_logo_path'); $logoAbsPath = $logoPath ? storage_path('app/public/' . $logoPath) : null; @endphp @if ($logoAbsPath && file_exists($logoAbsPath)) @endif @if ($companyName) @endif

{{ __('job.pdf_customer_report_title') }}

{{ __('job.pdf_customer_report_subtitle', ['customer' => $customer->name, 'from' => $from->format('d.m.Y'), 'to' => $to->format('d.m.Y')]) }}
{{ $companyName }}
@if ($companyStreet)
{{ $companyStreet }}
@endif @if ($companyZip || $companyCity)
{{ $companyZip }} {{ $companyCity }}
@endif @if ($companyPhone)
{{ $companyPhone }}
@endif @if ($companyEmail)
{{ $companyEmail }}
@endif
{{-- Customer info --}}
{{ __('job.pdf_section_customer') }}
@php $primaryObject = $customerObject ?? $customer->objects->first(); @endphp @if ($primaryObject && ($primaryObject->street || $primaryObject->zip || $primaryObject->city)) @endif @if ($customer->contact_name) @endif @if ($customer->phone) @endif @if ($customer->email) @endif
{{ __('job.detail_customer') }} {{ $customer->name }}
{{ __('job.pdf_address') }} {{ $primaryObject->street }}@if($primaryObject->street && ($primaryObject->zip || $primaryObject->city)),@endif {{ $primaryObject->zip }} {{ $primaryObject->city }}
{{ __('job.pdf_contact') }} {{ $customer->contact_name }}
{{ __('job.pdf_cover_phone') }} {{ $customer->phone }}
{{ __('job.pdf_cover_email') }} {{ $customer->email }}
@if ($jobs->isEmpty())

{{ __('job.pdf_no_jobs_in_range') }}

@else {{-- Cover Summary --}}
{{ __('job.pdf_cover_summary') }}
{{ __('job.pdf_cover_total_jobs') }} {{ $coverData['totalJobs'] }}
{{ __('job.pdf_cover_total_duration') }} {{ intdiv((int) $coverData['totalMinutes'], 60) }}:{{ str_pad((int) $coverData['totalMinutes'] % 60, 2, '0', STR_PAD_LEFT) }} h
{{-- Job type breakdown --}}
{{ __('job.pdf_cover_job_types') }}
@foreach ($coverData['typeBreakdown'] as $typeLabel => $count) @endforeach
{{ $typeLabel }} {{ $count }}
{{-- Weather aggregation --}}
{{ __('job.pdf_cover_weather_summary') }}
@if ($coverData['weather']['hasData']) @if (! empty($coverData['weather']['topConditions'])) @endif
{{ __('job.pdf_cover_temp_range') }} {{ $coverData['weather']['minTemp'] }} – {{ $coverData['weather']['maxTemp'] }} °C
{{ __('job.pdf_cover_conditions') }} @foreach ($coverData['weather']['topConditions'] as $condition) {{ $condition['label'] }} ({{ $condition['count'] }})@if (! $loop->last), @endif @endforeach
@endif @if ($coverData['weather']['jobsWithoutWeather'] > 0)

{{ trans_choice('job.pdf_cover_no_weather', $coverData['weather']['jobsWithoutWeather'], ['count' => $coverData['weather']['jobsWithoutWeather']]) }}

@endif
{{-- Table of Contents --}}
{{ __('job.pdf_cover_toc') }}
@foreach ($jobs as $index => $job) @endforeach
# {{ __('job.pdf_cover_toc_date') }} {{ __('job.detail_object') }} {{ __('job.pdf_cover_toc_type') }} {{ __('job.pdf_cover_toc_duration') }}
{{ $index + 1 }} {{ $job->localStartedAt()->format('d.m.Y H:i') }} {{ $job->customerObject?->name ?? '–' }} {{ $job->type->label() }} @if ($job->ended_at) {{ $job->durationFormatted() }} @else {{ __('job.pdf_cover_active_marker') }} @endif
@endif {{-- Individual job pages --}} @if ($jobs->isNotEmpty()) @foreach ($jobs as $index => $job)
@include('pdf.partials.job-section', [ 'job' => $job, 'svgTrack' => $jobData[$job->id]['svgTrack'], 'gpsTableData' => $jobData[$job->id]['gpsTableData'], ])
@endforeach @endif