@extends('layouts.admin') @section('title', 'Order ' . $order->order_number) @section('page-title', 'Order ' . $order->order_number) @section('content')
@if (session('error'))
{{ session('error') }}
@endif

Customer: {{ $order->customer->full_name }} · Branch: {{ $order->branch->name }}

Order date: {{ $order->order_date->format('d M Y') }} · Priority: {{ config('order.priorities.'.$order->priority, $order->priority) }}

@if($order->status === 'draft')@can('edit orders')Edit@endcan @endif Print Job Card @can('create orders')
@csrf
@endcan

Items

@foreach($order->items as $item) @endforeach
ItemQtyUnit PriceTotalStatus
{{ $item->display_name }} {{ $item->quantity }} {{ number_format($item->unit_price, 2) }} {{ number_format($item->line_total, 2) }} @if($item->item_status){{ config('order.item_statuses.'.$item->item_status, $item->item_status) }}@else@endif
Subtotal: {{ number_format($order->subtotal, 2) }} Discount: -{{ number_format($order->discount, 2) }} Tax: {{ number_format($order->tax, 2) }} Extra: {{ number_format($order->extra_charges, 2) }} Advance: -{{ number_format($order->advance_paid, 2) }} Due: {{ number_format($order->due_amount, 2) }}
@if($order->design_instructions || $order->stitching_notes || $order->special_notes)

Instructions & Notes

Design
{{ $order->design_instructions ?? '—' }}
Stitching
{{ $order->stitching_notes ?? '—' }}
Special
{{ $order->special_notes ?? '—' }}
@endif

Internal notes

@csrf
    @foreach($order->notes as $note)
  • {{ $note->user->name }} · {{ $note->created_at->format('d M Y H:i') }}
    {{ $note->note }}
  • @endforeach

Attachments

@csrf

Trials

    @forelse($order->trials as $trial)
  • {{ optional($trial->trial_date)->format('d M Y') }} @if($trial->trial_time) · {{ \Carbon\Carbon::parse($trial->trial_time)->format('H:i') }} @endif · {{ ucfirst($trial->status) }}

    @if($trial->orderItem)

    Item: {{ $trial->orderItem->display_name }}

    @endif @if($trial->feedback)

    Feedback: {{ $trial->feedback }}

    @endif @if($trial->alteration_required)

    Alteration required

    @endif
  • @empty
  • No trials recorded.
  • @endforelse

Alterations

    @forelse($order->alterations as $alt)
  • {{ optional($alt->requested_on)->format('d M Y') ?: 'Requested' }} · {{ ucfirst($alt->status) }} @if($alt->sequence > 1) (#{{ $alt->sequence }}) @endif

    @if($alt->orderItem)

    Item: {{ $alt->orderItem->display_name }}

    @endif @if($alt->tailor)

    Tailor: {{ $alt->tailor->name }}

    @endif @if($alt->revised_delivery_date)

    Revised delivery: {{ $alt->revised_delivery_date->format('d M Y') }}

    @endif @if($alt->notes)

    Notes: {{ $alt->notes }}

    @endif
  • @empty
  • No alterations recorded.
  • @endforelse

Status

{{ $statusService->getStatusLabel($order->status) }}

@php $allowed = $statusService->getAllowedTransitions($order); @endphp @if(count($allowed) > 0 && auth()->user()->can('edit orders'))
@csrf
@endif

Status timeline

    @foreach($order->statusHistory as $h)
  • {{ $statusService->getStatusLabel($h->to_status) }}

    {{ $h->changedByUser?->name ?? 'System' }} · {{ $h->created_at->format('d M Y H:i') }}

    @if($h->notes)

    {{ $h->notes }}

    @endif
  • @endforeach

Billing

@php $invoice = $order->invoices()->latest()->first(); @endphp @if($invoice)

Invoice #{{ $invoice->invoice_number }}

Total
{{ number_format($invoice->grand_total, 2) }}
Paid
{{ number_format($invoice->amount_paid, 2) }}
Due
{{ number_format($invoice->amount_due, 2) }}
Status
{{ ucfirst($invoice->status) }}
@else

No invoice yet.

@endif Open invoice
@endsection