@extends('layouts.app') @section('title', 'Works Order Report') @section('breadcrumb')Reports Works Orders@endsection @section('content')

Works Order Report

All works orders per job with items breakdown

Export PDF
Reset
@forelse($worksOrders as $wo)
{{-- Header --}}

{{ $wo->order_number }} {{ $wo->statusLabel() }}

{{ $wo->job?->job_number }}  ·  {{ $wo->job?->contact?->full_name ?? '—' }}  ·  {{ $wo->job?->site_suburb ?? '—' }}

Type: {{ $wo->works_order_type ?? '—' }}
Issued: {{ $wo->issued_date?->format('d M Y') ?? '—' }}
Target: {{ $wo->target_completion?->format('d M Y') ?? '—' }}
{{-- Details row --}}
Manufacture Date
{{ $wo->manufacture_date?->format('d M Y') ?? '—' }}
Delivery Date
{{ $wo->delivery_date?->format('d M Y') ?? '—' }}
Completion %
{{ $wo->completionPct() }}%
Supervisor
{{ $wo->supervisor?->name ?? '—' }}
@if($wo->scope_of_works)
Scope of Works

{{ $wo->scope_of_works }}

@endif {{-- Items --}} @if($wo->items->isNotEmpty()) @foreach($wo->items as $item) @endforeach
# Description Trade Assignee Est. Hours Status
{{ $loop->iteration }} {{ $item->description }} {{ \App\Models\WorksOrderItem::tradeLabel($item->trade) }} {{ $item->assignee?->name ?? '—' }} {{ $item->estimated_hours ?? '—' }} {{ ucfirst(str_replace('_', ' ', $item->status)) }}
@else

No line items on this works order.

@endif @if($wo->faults->isNotEmpty())
FAULT ITEMS ({{ $wo->faults->count() }})
@foreach($wo->faults as $fault)
{{ $fault->fault_number }} · {{ $fault->fault_type ?? 'Fault' }} ${{ number_format($fault->cost ?? 0) }}
@endforeach
@endif
@empty
No works orders found for the selected criteria.
@endforelse
@endsection