@php $status = $workOrder->status; $assigned_at = $workOrder->assigned_at; $status_text = "New"; $status_color = "info"; if ($assigned_at !== null) { $overdue_at = new DateTime($assigned_at); $currentDate = new DateTime(); $difference = floor(($overdue_at->getTimestamp() - $currentDate->getTimestamp()) / (60 * 60 * 24)); if ($status == 1 && $difference < 0) { $status_text = __('translation.contents.overdue'); $status_color = "danger"; } else { if($status == 1){ $status_text = __('translation.contents.new'); $status_color = "info"; } else if($status == 2){ $status_text = __('translation.contents.in_progress'); $status_color = "warning"; } else { $status_text = __('translation.contents.completed'); $status_color = "success"; } } } @endphp
#{{ $workOrder->uuid }}
@if ($workOrder->status != 3)
@if(auth()->user()->hasPermissionTo('new', "work_orders.list")) @endif @if(auth()->user()->hasPermissionTo('edit', "work_orders.list")) @endif @if (count($workOrder->WorkOrdersIssuePivot) > 0) @endif
@endif
@include('work_orders.partials.details.assigned_to')
@include('work_orders.partials.details.vehicle')
@if(auth()->user()->hasPermissionTo('edit', "work_orders.list"))
@if ($workOrder->status == 1 && $status_text != "Overdue") @endif @if ($workOrder->status == 2) @endif
@endif