| 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
|
Select a PD user to review this order
No PD users configured. Assign the "PD" role to users first.
@endif@if($approvalType === 'pd') Approve this order and send to Merch for final confirmation @else Confirm this order to make it a full order @endif