Import Prices from CSV

@if (session()->has('success')) @endif @if (session()->has('error')) @endif @if (session()->has('warning')) @endif @if (session()->has('info')) @endif @if(config('app.debug'))
Debug Info:
File: {{ $csvFile ? 'Uploaded' : 'None' }}
Season: {{ $selectedSeason ?: 'None' }}
Styles Available: {{ count($styles) }}
@if(count($styles) > 0) First Style: ID={{ $styles->first()->id }}, customer_ref="{{ $styles->first()->customer_ref }}"
@endif Import Data: {{ count($importData) }} rows
Processed Data: {{ count($processedData) }} rows
Show Preview: {{ $showPreview ? 'Yes' : 'No' }}
@endif @if (!$importComplete)
@error('selectedSeason')
{{ $message }}
@enderror
@error('csvFile')
{{ $message }}
@enderror
Upload a comma-separated CSV file with columns: Season, Style, Size, CMT, Quote
@if($csvFile && $selectedSeason)
@if(config('app.debug')) @endif
@elseif($csvFile && !$selectedSeason)
Please select a season before processing the file.
@if(config('app.debug')) @endif
@endif
@if($showPreview && count($processedData) > 0)
Preview Import Data

Review the data below and select correct styles for any unmatched entries (highlighted in red).

@foreach($processedData as $index => $row) @endforeach
Line Season Style Size CMT Quote Match Status Select Style
{{ $row['original_line'] }} {{ $row['season'] }} {{ $row['style'] }} {{ $row['size'] ?: 'N/A' }} {{ $row['cmt'] }} {{ $row['quote'] }} @if($row['has_match']) Matched @else No Match @endif @if(!$row['has_match']) @else {{ $row['matched_style']->customer_ref ?? 'N/A' }} @endif
@endif @else

Import Complete!

The prices have been successfully imported.

@endif
@push('scripts') @endpush