@extends('inspections.layouts.master') @section('page_content') @php $image_url = $issue->vehicle->version->image_url; $image = strpos($image_url, 'uploads/vehicle/models') !== false ? $baseUrl."/storage/".$image_url : $image_url ?? 'N/A'; @endphp

@lang('translation.sf_menus.inspections.issues')

@lang('translation.contents.vehicle_details')
  • {{ Str::limit($issue->vehicle->name ?: 'N/A', 100, '..') }}
  • {{ Str::upper($issue->vehicle->plate_number) }}
  • {{ Str::upper($issue->vehicle->vin) }}
  • {{$issue->vehicle->version->year->model->brand->name . ' ' . $issue->vehicle->version->year->model->name}}
  • {{ $issue->vehicle->lastFleet->fleet->name ?? 'N/A' }}
@Lang('translation.contents.issue_details')
@Lang('translation.contents.description')

{{$issue->description}}

@if (count($issue->workOrder) > 0) @endif
@Lang('translation.contents.priority') @php $priority = $issue->priority; list('_text' => $text, '_color' => $color, '_icon' => $icon) = $priority === 'low' ? ['_text' => __('translation.contents.priority_low'), '_color' => 'success', '_icon' => 'mdi-chevron-up'] : ($priority === 'medium' ? ['_text' => __('translation.contents.priority_medium'), '_color' => 'warning', '_icon' => 'mdi-chevron-double-up'] : ['_text' => __('translation.contents.priority_high'), '_color' => 'danger', '_icon' => 'mdi-chevron-triple-up']); @endphp {!! $priority ? '' . ' ' . $text . '' : 'N/A' !!}
@Lang('translation.contents.status') @php $overdueDate = $issue->overdue_date; $overdueOdometer = $issue->overdue_odometer; $_text = __('translation.contents.open'); $_color = "info"; if ($overdueDate !== null || $overdueOdometer !== null) { if ($overdueDate !== null) { $overdueDate = new DateTime($overdueDate); $currentDate = new DateTime(); $difference = floor(($overdueDate->getTimestamp() - $currentDate->getTimestamp()) / (60 * 60 * 24)); if ($difference < 0) { $_text = __('translation.contents.overdue'); $_color = "danger"; } } if ($overdueOdometer !== null) { $lastOdometer = $issue->vehicle->lastOdometer->value; $difference = intval($lastOdometer - $overdueOdometer); if ($difference > 0) { $_text = __('translation.contents.overdue'); $_color = "danger"; } } } @endphp {{ $_text }}
@Lang('translation.contents.item') {{$issue->itemValue->item->name ?? '-'}}
@Lang('translation.contents.label') {{$issue->label->name}}
@Lang('translation.contents.reported_by') {{$issue->reportedBy->name}}
@Lang('translation.contents.reported_at') {{$issue->formatted_reported_at}}
{{$issue->odometer != null ? __('translation.contents.odometer') : __('translation.contents.engine_hours')}} {{$issue->odometer != null ? $issue->odometer . ' km': ($issue->engine_hours != null ? $issue->engine_hours : 'N/A')}}
{{$issue->overdue_date != null ? __('translation.contents.overdue_date') : __('translation.contents.overdue_odometer')}} {{$issue->overdue_date != null ? $issue->formatted_overdue_date : ($issue->overdue_odometer != null ? $issue->overdue_odometer . ' km' : 'N/A') }}
@Lang('translation.contents.user') {{$issue->user->name}}
@Lang('translation.contents.work_order') #{{$issue->workOrder->first()->workOrder->uuid}}
@if(auth()->user()->hasPermissionTo('new', "inspections.issues")) @if (count($issue->workOrder) == 0)
@endif @endif
@endsection @section('custom_scripts') @endsection