@extends('layouts.app') @section('title', __('app.work_order.technician_index.title') . ' - PMMS') @section('content')

{{ __('app.work_order.technician_index.heading') }}

{{-- requirements.md ยง47 - Search, Filter, Sorting, Pagination --}}
@php $sortLink = fn ($col) => route('technician.work-orders.index', array_merge(request()->query(), [ 'sort' => $col, 'direction' => (request('sort') === $col && request('direction') === 'asc') ? 'desc' : 'asc', ])); @endphp
@forelse ($workOrders as $workOrder) @empty @endforelse
{{ __('app.work_order.technician_index.table.no') }} {{ __('app.work_order.technician_index.table.complaint_no') }} {{ __('app.work_order.technician_index.table.tenant') }} {{ __('app.work_order.technician_index.table.project_unit') }} {{ __('app.work_order.technician_index.table.category') }} {{ __('app.work_order.technician_index.table.responsibility') }} {{ __('app.work_order.technician_index.table.assigned_to') }} {{ __('app.work_order.technician_index.table.priority') }} {{ __('app.work_order.technician_index.table.status') }} {{ __('app.work_order.technician_index.table.created') }}
{{ $workOrder->work_order_no }} {{ $workOrder->complaint->complaint_no }} {{ $workOrder->complaint->tenant?->name ?? __('app.complaint.technician_index.vacant_unit') }} {{ $workOrder->complaint->project->project_name }} / {{ $workOrder->complaint->unit->unit_no }} {{ $workOrder->category?->name ?? '-' }} {{ $workOrder->responsibility_type ?? '-' }} @if ($workOrder->currentAssignment?->assignedUser) {{ $workOrder->currentAssignment->assignedUser->name }} @elseif ($workOrder->currentAssignment?->contractor) {{ $workOrder->currentAssignment->contractor->company_name }} @elseif ($workOrder->currentAssignment?->jmb) {{ $workOrder->currentAssignment->jmb->name }} @else - @endif {{ $workOrder->priority ?? '-' }} {{ $workOrder->status }} {{ $workOrder->created_at->format('d/m/Y H:i') }}
{{ __('app.work_order.technician_index.empty') }}
{{ $workOrders->links() }} @endsection