@extends('layouts.app') @section('title','Import Stock') @section('page_title','Import Stock') @section('content')

Bulk Stock Import

Download CSV TemplateBack to Inventory
@if(session('status'))
{{ session('status') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif

Safe Stock Correction Import

Product MatchProduct name must already exist
DirectionUse add or remove for count corrections
Costing RulePurchased deliveries must use Receive Stock so average cost is updated
Audit TrailEvery row creates a stock-correction movement
@if(empty($previewRows))
@csrf
Maximum 500 rows per import.
@else
Total Rows{{ count($previewRows) }}
Valid Rows{{ $summary['valid'] ?? 0 }}
Invalid Rows{{ $summary['invalid'] ?? 0 }}
@foreach($previewRows as $row)@endforeach
LineStatusProductDirectionQuantityPiecesBeforeAfterMessage
{{ $row['line'] }}{{ $row['valid']?'Valid':'Invalid' }}{{ $row['product_name'] }}{{ ucfirst($row['direction']) }}{{ number_format($row['quantity']) }} {{ $row['unit_type'] }}{{ number_format($row['quantity_pieces']) }}{{ number_format($row['before_stock']) }}{{ number_format($row['after_stock']) }}{{ $row['valid']?($row['note'] ?: 'Ready'):implode(' ', $row['errors']) }}
@foreach($previewRows as $row)
{{ $row['direction']==='remove' ? '−' : '+' }}

{{ $row['product_name'] }}

Line {{ $row['line'] }} · {{ ucfirst($row['direction']) }}
{{ $row['valid']?'Valid':'Invalid' }}
{{ number_format($row['quantity']) }} {{ $row['unit_type'] }}{{ number_format($row['quantity_pieces']) }} pieces
{{ number_format($row['before_stock']) }} → {{ number_format($row['after_stock']) }}{{ $row['valid']?($row['note'] ?: 'Ready'):implode(' ', $row['errors']) }}
@endforeach
@csrf @method('DELETE')
@if(($summary['invalid'] ?? 0)===0)
@csrf
@endif
@endif @endsection