@extends('layouts.app') @section('title','Import Review') @section('content')
ERP / IMPORT REVIEW

Import Review

{{ $batch->original_name }} · {{ $batch->profile }} · effective {{ $batch->effective_date }}

All imports
@if(session('success'))
{{ session('success') }}
@endif @if(session('notice'))
{{ session('notice') }}
@endif @if($errors->any())@endif
Status: {{ $batch->status }}

{{ $batch->row_count }} rows · {{ $remaining }} unresolved rows

@if($batch->profile==='warehouse')

Replace included balances — never add the file quantity to existing stock. Missing products remain unchanged. Later local movements are preserved. Product descriptions and prices are not overwritten.

@if($batch->stock_as_of)

Focus report as of {{ \Carbon\CarbonImmutable::parse($batch->stock_as_of,'UTC')->setTimezone('Asia/Dubai')->format('Y-m-d H:i') }} UAE time (UTC+4).

@endif @if($sourceApplied)

This exact source file has already been applied. Confirming an identical replay has no stock effect.

@endif @else

SOH updates company prices only, including VAT 5%; quantities and product identity stay unchanged.

@endif @if(in_array($batch->status,['queued','analyzing'],true))

Background analysis is queued or running. Refresh to check progress.

Refresh status@if($batch->status==='queued')
@csrf
@endif @endif @if($batch->error)

{{ $batch->error }}

@endif @if($stockConflicts>0)@endif @if($batch->status==='preview')
@csrf
@endif @if($batch->profile==='warehouse' && $batch->status==='confirmed')View warehouse balances & history@endif

Swipe the table sideways to view the balance comparison and review columns.

@if($batch->profile==='warehouse')@endif @forelse($rows as $row) @php($values=json_decode($row->data,true)) @php($issues=json_decode($row->issues,true)) @if($batch->profile==='warehouse')@endif @empty@endforelse
SourceSKU / nameSource valuesBalance comparisonStatus / review
{{ $row->source_sheet }}:{{ $row->source_row }}{{ $row->sku }}
{{ $values['name']??'' }}
{{ $values['barcode']??'' }}
@foreach(['quantity','retail','wholesale','van','clearance'] as $field)@if(isset($values[$field]) && $values[$field]!=='')
{{ ucfirst($field) }}: {{ $values[$field] }}
@endif @endforeach
@if(isset($comparisons[$row->id]))@php($comparison=$comparisons[$row->id])
Current: {{ $comparison['current'] }}
File: {{ $comparison['source'] }}
Later local movements: {{ $comparison['later_movements'] }}
After confirmation: {{ $comparison['target'] }}
Adjustment: {{ $comparison['difference'] }}
@if($comparison['issue'])

{{ $comparison['issue'] }}

@endif @elseif($row->status==='applied')Reconciled; see warehouse movement history.@elseif($row->status==='replayed')Already applied; no new movement.@elseResolve source row first.@endif
{{ $row->status }}@foreach($issues as $issue)

{{ $issue }}

@endforeach @if($batch->status==='preview' && in_array($row->status,['ready','review'],true))
@csrf
@endif
No preview rows available yet.
{{ $rows->links() }}
@endsection