HGV Inspection Sheet
Sheet #{{ $inspectionSheet->id }}
| DVSA Ref |
Defect / Check |
Mark |
Dangerous |
Remarks |
@php
$rows = $inspectionSheet->itemResults->sortBy(function ($row) {
return ($row->inspectionItem?->inspectionCategory?->im_number ?? 9999).'-'.($row->inspectionItem?->code ?? '');
});
$currentCategory = null;
@endphp
@foreach($rows as $row)
@php
$category = $row->inspectionItem?->inspectionCategory;
$categoryName = $category ? ($category->im_number.' - '.$category->name) : 'Uncategorised';
@endphp
@if($currentCategory !== $categoryName)
| {{ $categoryName }} |
@php $currentCategory = $categoryName; @endphp
@endif
| {{ $row->inspectionItem?->code ?? '-' }} |
{{ $row->inspectionItem?->deficiency ?? '-' }}
{{ $row->inspectionItem?->description ?? '' }}
|
{{ $markingLabels[$row->marking_code] ?? 'Not marked' }} |
{{ $row->is_dangerous ? 'Yes' : 'No' }} |
{{ $row->remarks ?: '-' }} |
@endforeach