@php use App\Support\InspectionChecklist; $answers = $data['answers'] ?? []; $notes = $data['item_notes'] ?? []; $measurements = $data['measurements'] ?? []; $defects = $data['defects'] ?? []; $system = $data['system'] ?? []; $site = $data['site'] ?? []; $declaration = $data['declaration'] ?? []; $review = $data['review'] ?? null; $job = $detail['job'] ?? null; $customer = $job['customer'] ?? null; $jobSite = $job['site'] ?? null; $systemType = collect(InspectionChecklist::systemTypes())->firstWhere('value', $system['type'] ?? ''); $systemLabel = is_array($systemType) ? $systemType['label'] : '—'; $brand = \App\Support\Branding::name(); $accent = \App\Support\Branding::colour() ?? '#f0a020'; $tick = ['pass' => 'Pass', 'fail' => 'Fail', 'na' => 'N/A']; @endphp {{ $report->reference }} — inspection report

{{ $brand }}

{{ $report->purpose->label() }}

{{ $report->reference }} @if ($detail['job']) · job {{ $detail['job']['job_number'] }} @endif @if ($report->inspected_on) · inspected {{ $report->inspected_on->format('j F Y') }} @endif

@if ($report->outcome)

{{ $report->outcome->label() }}

@endif

Site and system

Customer{{ $customer['name'] ?? '—' }}
Site{{ $jobSite['address'] ?? '—' }}
@if ($jobSite)
Suburb{{ $jobSite['suburb'] }} {{ $jobSite['state'] }} {{ $jobSite['postcode'] }}
NMI{{ $jobSite['nmi'] ?: '—' }}
Meter{{ $jobSite['meter_number'] ?: '—' }}
Network{{ $jobSite['dnsp'] ?: '—' }}
Phase{{ $jobSite['phase'] ?? '—' }}
Roof{{ $site['roof_type'] ?? $jobSite['roof'] ?? '—' }}
@endif
System type{{ $systemLabel }}
System size{{ isset($system['kw']) ? $system['kw'].' kW' : '—' }}
Modules{{ $system['modules'] ?? '—' }}
Inverter{{ $system['inverter'] ?? '—' }}
@if (! empty($system['battery']))
Battery{{ $system['battery'] }}
@endif
Installed{{ $system['installed_on'] ?? '—' }}
Switchboard{{ $site['switchboard'] ?? '—' }}
Supply{{ ($site['phase'] ?? '') === 'three' ? 'Three phase' : 'Single phase' }}
Roof condition{{ ucfirst($site['roof_condition'] ?? '—') }}
Tilt / azimuth{{ trim(($site['tilt'] ?? '—').'° / '.($site['azimuth'] ?? '—')) }}
Monitoring{{ $system['monitoring'] ?? '—' }}
@if (! empty($system['serials']))
Serials: {{ $system['serials'] }}
@endif

Checklist

@foreach (InspectionChecklist::sections() as $section) @if ($section['battery_only'] && ! in_array($system['type'] ?? '', ['hybrid', 'battery'], true)) @continue @endif

{{ $section['title'] }} · {{ $section['standard'] }}

@foreach ($section['items'] as $item) @php $value = $answers[$section['key']][$item['key']] ?? null; @endphp @endforeach
{{ $item['label'] }} {{ $tick[$value] ?? '—' }} {{ $notes[$section['key']][$item['key']] ?? '' }}
@endforeach

Test results

@foreach (InspectionChecklist::measurements() as $key => $measurement) @endforeach
{{ $measurement['label'] }} {{ $measurements[$key] ?? '—' }} {{ $measurement['unit'] }}
Test instrument {{ $measurements['instrument'] ?? '—' }} @if (! empty($measurements['calibration_due'])) · calibrated to {{ $measurements['calibration_due'] }} @endif
@if (! empty($defects))

Defects

@foreach ($defects as $defect)
@php $severity = $defect['severity'] ?? 'minor'; $colour = match ($severity) { 'critical' => '#b91c1c', 'major' => '#b45309', default => '#4b5563', }; @endphp

{{ $severity }} @if (! empty($defect['due'])) · due {{ $defect['due'] }} @endif

{{ $defect['title'] ?? '' }}

@if (! empty($defect['description']))

{{ $defect['description'] }}

@endif @if (! empty($defect['action']))

Action: {{ $defect['action'] }}

@endif
@endforeach @endif @if (! empty($data['findings']) || ! empty($data['recommendations']))

Findings

@if (! empty($data['findings']))

{{ $data['findings'] }}

@endif @if (! empty($data['recommendations']))

Recommendations

{{ $data['recommendations'] }}

@endif @endif @if (! empty($data['customer']['comment']))

Customer comments

{{ $data['customer']['comment'] }}

@endif

Declaration

I certify that I carried out this inspection, that the results recorded are the readings I measured on site, and that the work complies with the standards named above except where a defect is listed.

Name{{ $declaration['name'] ?? $report->inspector_name ?? '—' }}
Company{{ $declaration['company'] ?? '—' }}
Licence{{ $declaration['licence'] ?? $report->inspector_licence ?? '—' }}
Date{{ $declaration['date'] ?? '—' }}

Signature images are in the signatures folder of this pack. @if ($review)
Reviewed by {{ $review['by'] ?? '' }} on {{ \Illuminate\Support\Carbon::parse($review['at'] ?? null)->format('j F Y') }}. @if (! empty($review['note']))
{{ $review['note'] }} @endif @endif

Attachments

@forelse ($report->attachments as $attachment) @empty @endforelse
{{ $attachment->original_name }} {{ ucfirst($attachment->kind) }} · {{ $attachment->humanSize() }}
No files attached.