@php $customer = $workOrder->customer; $deadline = $workOrder->deadlineState(); $days = $workOrder->isOpen() ? $workOrder->daysUntilDeadline() : null; @endphp
{{ $workOrder->priority->label() }} priority @if ($workOrder->external_order_number)Vendor order #{{ $workOrder->external_order_number }}@endif
Print @can('update', $workOrder) Edit @endcan
{{-- Key facts --}}

Customer

{{ $customer?->displayName() }}

Vendor

{{ $workOrder->vendor_name_snapshot }}

Seller

{{ $workOrder->seller?->fullName() }}

Work order date

{{ format_date($workOrder->work_order_date) }}

$deadline === \App\Enums\DeadlineState::Overdue])>

Deadline

{{ format_date($workOrder->deadline_date) }}

@if ($days !== null)

{{ $days < 0 ? abs($days).' day(s) overdue' : ($days === 0 ? 'Due today' : 'In '.$days.' day(s)') }}

@endif
{{-- Status actions --}} @if ($transitions)
Next step: @foreach ($transitions as $to) @php($danger = in_array($to, [\App\Enums\WorkOrderStatus::Cancelled, \App\Enums\WorkOrderStatus::Failed], true)) @php($success = $to === \App\Enums\WorkOrderStatus::Completed) $danger])> {{ $workOrder->status->actionLabel($to) }} @endforeach
@elseif ($workOrder->status === \App\Enums\WorkOrderStatus::Completed) This work order is closed. {{ $deadline === \App\Enums\DeadlineState::CompletedOnTime ? 'It was completed on time.' : 'It was completed after the deadline.' }} @elseif ($workOrder->status === \App\Enums\WorkOrderStatus::Cancelled) {{ $workOrder->cancellation_reason }} @endif
{{-- Customer & service address --}}
@can('view', $customer) {{ $customer->displayName() }} @else {{ $customer?->displayName() }} @endcan {{ $customer?->customer_number }} {{ format_phone($customer?->phone) }}@if ($customer?->email){{ $customer->email }}@endif

Service address (as ordered)

{{ $workOrder->serviceStreetLine() }}
{{ $workOrder->serviceCityLine() }} @if ($workOrder->service_county)
{{ $workOrder->service_county }} County@endif
@if ($customer?->serviceAddress && ($customer->serviceAddress->streetLine() !== $workOrder->serviceStreetLine() || $customer->serviceAddress->zip !== $workOrder->service_zip))

The customer's current address differs: {{ $customer->serviceAddress->streetLine() }}, {{ $customer->serviceAddress->cityLine() }}

@endif
{{-- Package & services --}}

{{ $workOrder->package_name_snapshot }}

{{ $workOrder->package_code_snapshot }} · {{ $workOrder->vendor_name_snapshot }}

@if ($workOrder->package_description_snapshot)

{{ $workOrder->package_description_snapshot }}

@endif
@foreach ($workOrder->services as $item)

{{ $item->service_name }}

@php($lines = \App\Services\Packages\ServiceDetailSchema::describe($item->service_category, $item->details)) @if ($lines)
@foreach ($lines as $label => $value)
{{ $label }}
{{ $value }}
@endforeach
@endif
@endforeach
{{-- Internal notes --}} @can('addNote', $workOrder)
@error('note')

{{ $message }}

@enderror
Add note
@endcan
    @forelse ($workOrder->notes as $entry)
  • {{ $entry->author?->name ?? 'Unknown' }} · {{ format_datetime($entry->created_at) }}

    {{ $entry->body }}

  • @empty
  • No internal notes yet.
  • @endforelse
{{-- Attachments --}} @can('uploadAttachment', $workOrder)
Upload
Uploading file...
@error('upload')

{{ $message }}

@enderror @endcan
    @forelse ($workOrder->attachments as $attachment)
  • {{ $attachment->original_name }}

    {{ strtoupper($attachment->extension) }} · {{ number_format($attachment->size / 1024, 0) }} KB · {{ $attachment->uploader?->name }} · {{ format_datetime($attachment->created_at) }}

    Download {{ $attachment->original_name }} @can('delete', $attachment) @endcan
  • @empty
  • No attachments.
  • @endforelse
{{-- Activity --}}
    @foreach ($activity as $entry)
  • {{ \Illuminate\Support\Str::headline(str_replace('work_order.', '', $entry->event)) }} by {{ $entry->actor_name ?? 'System' }} @if ($entry->description){{ \Illuminate\Support\Str::limit($entry->description, 160) }}@endif
  • @endforeach
{{-- Pricing --}}

{{ format_money($workOrder->monthly_price ?? $workOrder->package_price) }}{{ $workOrder->monthly_price !== null ? '/mo' : $workOrder->price_frequency->suffix() }}

Package price
{{ format_money($workOrder->package_price) }} {{ $workOrder->price_frequency->label() }}
@if ($workOrder->promotional_price !== null)
Promotional price
{{ format_money($workOrder->promotional_price) }}@if ($workOrder->promotion_end_date)until {{ format_date($workOrder->promotion_end_date) }}@endif
@endif
Installation
{{ format_money($workOrder->installation_charge) }}
Activation
{{ format_money($workOrder->activation_charge) }}

Informational only. No payments are collected in this portal.

{{-- Dates --}}
@if ($workOrder->submitted_at)@endif @if ($workOrder->completion_date)@endif @if ($workOrder->completion_notes)@endif
{{-- Handling --}}
@if (auth()->user()->hasMultipleOrganizations())@endif @if ($workOrder->customer_notes){{ $workOrder->customer_notes }}@endif
{{-- Status timeline --}}
    @foreach ($workOrder->statusHistories as $history)
  1. @if ($history->from_status){{ $history->from_status->label() }} → @endif{{ $history->to_status->label() }}

    {{ format_datetime($history->created_at) }} · {{ $history->changedBy?->name ?? 'System' }}

    @if ($history->remarks)

    {{ $history->remarks }}

    @endif
  2. @endforeach
{{-- Status change dialog --}} @if ($target)
@if ($target === \App\Enums\WorkOrderStatus::Scheduled)
@elseif ($target === \App\Enums\WorkOrderStatus::Completed) @elseif ($target === \App\Enums\WorkOrderStatus::Cancelled) Cancelling stops all work on this order. It can only be reopened by users with the recovery permission. @elseif ($workOrder->status->isRecoveryTransition($target)) Reopening returns the order to Submitted. This recovery action is recorded in the audit log. @elseif (in_array($target, [\App\Enums\WorkOrderStatus::OnHold, \App\Enums\WorkOrderStatus::Failed], true)) @else @endif @error('status'){{ $message }}@enderror @error('general'){{ $message }}@enderror @endif Close {{ $target ? $workOrder->status->actionLabel($target) : 'Confirm' }}