Import Orders {{-- Toast Notifications --}}
{{-- Filters --}}
{{-- Mobile Toggle --}} {{-- Filters --}}
{{-- Status/Stage Dropdown --}}
{{-- Customer Dropdown --}}
@foreach($this->customers as $c) @endforeach
{{-- Active Filters Summary & Clear --}} @if($this->activeFiltersCount > 0)
{{ $this->activeFiltersCount }} active
@endif
{{-- Content --}}
Loading...
@if($this->orders->isEmpty())

No skeleton orders

Import orders to get started with the approval workflow

Import Orders
@else
@foreach($this->orders as $order) @php $matchPercent = $order->total_lines > 0 ? (int) round(($order->matched_lines / $order->total_lines) * 100) : 0; @endphp @endforeach
Order @if($sortBy === 'id') @endif Source / PO Customer Season Match Lines Imported @if($sortBy === 'imported_at') @endif Workflow Actions
#{{ $order->id }}
{{ $order->source_file ?? $order->customer_po ?? '—' }} @if($order->customer_po && $order->source_file) PO: {{ $order->customer_po }} @endif @if($order->hasSourceFiles())
@foreach($order->source_files as $index => $filePath) {{ Str::limit(basename($filePath), 25) }} @endforeach
@endif
{{ $order->customer?->name ?? '—' }} {{ $order->season?->description ?? '—' }}
{{ $matchPercent }}%
@if($order->unmatched_lines > 0) {{ $order->unmatched_lines }} unmatched @endif
{{ $order->total_lines }} @if($order->imported_at) {{ $order->imported_at->diffForHumans() }} @else @endif @php $currentUser = auth()->user(); $isPdUser = $currentUser?->hasRole('pd') || $currentUser?->hasRole('admin'); $isMerchUser = $currentUser?->hasRole('merch') || $currentUser?->hasRole('admin'); $isAssignedToPd = $order->pd_reviewed_by === $currentUser?->id; // Determine if current user needs to act $needsMyAction = false; if ($order->status === 'skeleton' && $isPdUser) { $needsMyAction = true; // PD can forward } elseif ($order->status === 'pending_pd' && $isPdUser && $isAssignedToPd) { $needsMyAction = true; // Assigned PD needs to review } elseif ($order->status === 'pending_merch' && $isMerchUser) { $needsMyAction = true; // Merch needs to approve } @endphp
@if($order->status === 'skeleton') Awaiting forward @elseif($order->status === 'pending_pd') @if($order->pdReviewedBy) With {{ $order->pdReviewedBy->name }} @else Awaiting PD review @endif @elseif($order->status === 'pending_merch') PD approved, awaiting Merch @endif
@if($order->status === 'skeleton') @elseif($order->status === 'pending_pd') @elseif($order->status === 'pending_merch') @endif
@if($this->orders->hasPages())
{{ $this->orders->links() }}
@endif @endif
{{-- Forward to PD Modal --}} @if($showForwardModal)

Forward to PD

Select a PD user to review this order

@if($this->pdUsers->count() > 0) @else

No PD users configured. Assign the "PD" role to users first.

@endif
@endif {{-- Approval Modal --}} @if($showApprovalModal)

{{ $approvalType === 'pd' ? 'PD Approval' : 'Merch Confirmation' }}

@if($approvalType === 'pd') Approve this order and send to Merch for final confirmation @else Confirm this order to make it a full order @endif

@endif {{-- Order Edit Panel --}} @livewire('commission.order-edit') {{-- Single Order Filter Toast --}} @if($this->order)
Viewing Order #{{ $this->order }} Filtered from import batch
@endif