@if($showDetailModal && $this->detailBatch)
{{-- Header --}}
{{-- Content --}}
{{-- Batch Info --}}
Customer
{{ $this->detailBatch->customer_name }}
Season
{{ $this->detailBatch->season?->description ?? 'N/A' }}
Uploaded By
{{ $this->detailBatch->user?->name ?? 'Unknown' }}
Uploaded
{{ $this->detailBatch->created_at->format('d M Y H:i') }}
Status
@if($this->detailBatch->status === 'completed_with_warnings')
@endif
{{ ucfirst(str_replace('_', ' ', $this->detailBatch->status)) }}
Progress
{{ $this->detailBatch->processed_files ?? 0 }} / {{ $this->detailBatch->total_files }} files
@if($this->detailBatch->failed_files > 0)
({{ $this->detailBatch->failed_files }} failed)
@endif
@if($this->detailBatch->error_message)
Error
{{ $this->detailBatch->error_message }}
@endif
{{-- Files --}}
Files
@foreach($this->detailBatch->files as $file)
@if(Str::endsWith($file->original_filename, '.pdf'))
@else
@endif
{{ $file->original_filename }}
@if($file->status === 'pending')
Pending
@elseif($file->status === 'processing')
Processing
@elseif($file->status === 'extracted')
Extracted
@elseif($file->status === 'matched')
Matched
@elseif($file->status === 'verified')
Verified
@elseif($file->status === 'completed')
Completed
@elseif($file->status === 'failed')
Failed
@endif
@if($file->status === 'failed')
@endif
@if($file->error_message)
{{ $file->error_message }}
@endif
@endforeach
{{-- AI Processing Results --}}
@if($this->detailBatch->agent1_result || $this->detailBatch->agent2_result || $this->detailBatch->agent3_result)
AI Processing
@if($this->detailBatch->agent1_result)
Agent 1 (Extraction)
{{ ucfirst($this->detailBatch->agent1_result['status'] ?? 'Pending') }}
@if(isset($this->detailBatch->agent1_result['orders_found']))
{{ $this->detailBatch->agent1_result['orders_found'] }} orders found
@endif
@endif
@if($this->detailBatch->agent2_result)
Agent 2 (Matching)
{{ ucfirst($this->detailBatch->agent2_result['status'] ?? 'Pending') }}
@if(isset($this->detailBatch->agent2_result['matched_lines']))
{{ $this->detailBatch->agent2_result['matched_lines'] }}/{{ $this->detailBatch->agent2_result['total_lines'] ?? '?' }} matched
@endif
@endif
@if($this->detailBatch->agent3_result)
Agent 3 (Verification)
{{ ucfirst($this->detailBatch->agent3_result['status'] ?? 'Pending') }}
@if(isset($this->detailBatch->agent3_result['confidence']))
{{ $this->detailBatch->agent3_result['confidence'] }}% confidence
@endif
@endif
@endif
{{-- Created Orders --}}
@if($this->detailBatch->commissionOrders->count() > 0)
Created Orders ({{ $this->detailBatch->commissionOrders->count() }})
@foreach($this->detailBatch->commissionOrders as $order)
{{ $order->customer_po }}
#{{ $order->id }}
{{ ucfirst(str_replace('_', ' ', $order->status)) }}
{{ $order->lines->count() }} lines
@endforeach
@elseif($this->detailBatch->commissionOrder)
{{-- Fallback for legacy single order link --}}
Created Order
Order #{{ $this->detailBatch->commissionOrder->id }}
{{ ucfirst(str_replace('_', ' ', $this->detailBatch->commissionOrder->status)) }}
{{ $this->detailBatch->commissionOrder->lines->count() }} lines
@endif