@extends('layouts.app') @section('content')

View service work order:


Service:

{{ csrf_field() }} id}}> @php $count_remain_qty = 0; @endphp @foreach ($workorder->insservice->equipment as $ins_eq) id}}> pivot->id}}> pivot->remain_qty}}> @endforeach
# Equipment Duration Total Qty Remaining Qty Task Qty
{{ $workorder->insservice->id }} {{ $ins_eq->name }} {{ $ins_eq->duration }} {{$ins_eq->pivot->qty}} {{$ins_eq->pivot->remain_qty}} @php $count_remain_qty += $ins_eq->pivot->remain_qty; @endphp pivot->remain_qty}} min=0 max={{$ins_eq->pivot->remain_qty}}>
@php $disable_add_task_btn = $count_remain_qty ==0 ? "disabled" : ""; @endphp

Workorder Created Tasks:

@foreach($workorder->instask()->orderBy('created_at','desc')->get() as $instask) @endforeach
# Equipment (Qty) Task Qty Jobs Progress Work Date Start Time End Time Assigned Engineers Finished Related task / job Created At Action
{{$instask->id}}
    @foreach ($instask->equipment as $ins_eq)
  • {{$ins_eq->name}}
  • @endforeach
    @foreach ($instask->equipment as $ins_eq)
  • {{$ins_eq->pivot->qty}}
  • @endforeach
@php if(array_key_exists($instask->id,$task_progress)){ $task_progress_val = $task_progress[$instask->id]; }else{ $task_progress_val = 0; } @endphp
{{$task_progress_val}}%
    @foreach ($instask->instasktime as $ins_time)
  • {{$ins_time->work_day}}
  • @endforeach
    @foreach ($instask->instasktime as $ins_time)
  • {{$ins_time->start_time}}
  • @endforeach
    @foreach ($instask->instasktime as $ins_time)
  • {{$ins_time->end_time}}
  • @endforeach
    @foreach ($instask->user as $ins_user) @if($ins_user->pivot->active_task_user==1)
  • @if ($ins_user->pivot->primary_task_user==1) Primary: {{$ins_user->name}} @else {{$ins_user->name}} @endif
  • @endif @endforeach
@php if($instask->finished == 1) { echo "Yes"; }else{ echo "No"; } @endphp @php if($instask->related_job_id != 0) { echo ( " $instask->related_task_id " ." / ".$instask->related_job_id); }else{ echo "NA"; } @endphp {{$instask->created_at}} @php $inprogress = 0; if($instask->finished==0 && $task_progress_val < 100) // task is not finished so you can reassign the engineers { foreach ($instask->insjobs as $t_j) { if($t_j->finished == 0){ // if there is job in progress, disallow re-assign $inprogress = 1; break; }else{ $inprogress = 0; } } if($inprogress == 0){ echo( 'Reassign Engineers' ); } } @endphp View Task @can('inspection_task_delete') @if($instask->insjobs()->count() == 0)
@csrf {{ method_field('DELETE') }}
@endif @endcan
@endsection