{{-- Header --}}

@if($currentFile) Review File @else Batch Files: {{ $batch->batch_name }} @endif

Customer: {{ $batch->customer_name }} @if(!$currentFile) | Files: {{ $batch->total_files }} total Auto-refreshing @endif

@if($currentFile) Back to File List @else Back to Batches @endif
@if (session()->has('success')) @endif @if (session()->has('error')) @endif @if($currentFile) {{-- File Header --}}
{{ $currentFile->original_filename }}
{{ ucfirst($currentFile->status) }}
@if($currentFile->hasFailed())
Extraction Failed

{{ $currentFile->error_message }}

@elseif($currentFile->isImported())
This file has already been imported.
@elseif($currentFile->isReadyForReview()) {{-- Season Selection --}}

Orders: {{ $currentFile->total_orders }} | Lines: {{ $currentFile->total_lines }} | Total Qty: {{ $currentFile->total_quantity }}

{{-- Quantity Warning --}} @if(!empty($currentFile->metadata['total_warning']))
{{ $currentFile->metadata['total_warning'] }}
@endif {{-- Preview Table --}}
Preview Data
@forelse($this->previewData as $item) @empty @endforelse @if(!empty($this->previewData)) @endif
PO Number Order Date Style Number Colour Ex-Factory Total Qty Size / Qty / Price Set All Prices
{{ $item['purchase_order'] }} {{ $item['order_date'] }} {{ $item['total_qty'] }}
@foreach($item['quantities'] as $sizeIndex => $qty)
{{ $qty['size'] ?? 'N/A' }} {{ $qty['qty'] ?? 0 }}
{{ $this->getCurrencySymbol() }}
@endforeach
{{ $this->getCurrencySymbol() }}
No data to preview
GRAND TOTAL: {{ collect($this->previewData)->sum('total_qty') }} {{ count($this->previewData) }} line(s)
{{-- Action Buttons --}}
{{-- Skip File Modal --}} {{-- Loading Overlay (only show during import) --}}
Loading...
Importing Data...

Please wait while we process your order.

@else
File is still being processed. Please wait...
@endif @else {{-- File List View (when no specific file selected) --}}
Files in this Batch
@forelse($batch->files as $file) @empty @endforelse
Filename Status Orders Lines Quantity Action
{{ $file->original_filename }} {{ ucfirst($file->status) }} @if($file->status === 'skipped' && $file->skip_reason)
{{ $file->skip_reason }} @endif
{{ $file->total_orders ?? 0 }} {{ $file->total_lines ?? 0 }} {{ $file->total_quantity ?? 0 }} @if($file->status === 'extracted') @elseif($file->status === 'imported') @elseif($file->status === 'skipped') @elseif($file->status === 'failed')
{{ $file->error_message }}
@else Processing... @endif
No files in this batch.
@endif