@extends('layouts.app') @section('title', $assignment->order->order_no) @section('content') @php $a = $assignment; $canUpdate = ! $a->isCompleted() && auth()->user()->can('work.update_own'); $max = (int) config('erp.work.max_photos_per_update'); $draftData = $drafts->map(function ($p) { return ['id' => $p->id, 'thumb' => route('work-photos.show', [$p, 'thumb']), 'kb' => (int) round($p->bytes / 1024), 'has_location' => $p->hasLocation()]; })->values(); @endphp {{ $a->isCompleted() ? 'Completed' : $a->progress.'% done' }}
The job
Assigned
{{ $a->assigned_on->format('d M Y') }}
Due by
{{ $a->due_date?->format('d M Y') ?? '—' }}
Vendor
{{ $a->vendor->name }}
@if ($a->order->delivery_date)
Delivery
{{ $a->order->delivery_date->format('d M Y') }}
@endif
Items in this order
    @foreach ($a->order->items as $it)
  • {{ $it->design_name }}{{ collect([$it->sizeText(), $it->color, $it->material])->filter()->join(' · ') }}
    × {{ rtrim(rtrim(number_format((float) $it->quantity, 2, '.', ''), '0'), '.') }}
  • @endforeach
@if ($a->notes)
Notes from the office
{!! nl2br(e($a->notes)) !!}
@endif
@if ($canUpdate)
Post an update
@include('partials.work-form', ['action' => route('my-work.updates.store', $a), 'uploadUrl' => route('my-work.photos.store', $a), 'discardUrl' => route('my-work.photos.destroy', [$a, '__ID__']), 'progress' => $a->progress, 'drafts' => $drafts, 'completeUrl' => route('my-work.complete', $a)])
@elseif ($a->isCompleted())
This work is complete{{ $a->completed_at ? ' · '.$a->completed_at->timezone(config('erp.timezone'))->format('d M Y') : '' }}. Ask the office if it needs reopening.
@endif
History
@include('partials.work-timeline', ['updates' => $a->updates])
@endsection