@extends('layouts.admin') @section('title', 'Inventaire') @section('page-title', 'Stock') @section('content')

Inventaire {{ $inventory->month }}

Magasin: {{ $inventory->store->name ?? '-' }}

@if($errors->any())
@endif
Statut
@if($inventory->status === 'VALIDE') Valide @else En cours @endif
Mois
{{ $inventory->month }}
Validation
{{ $inventory->validated_at ? $inventory->validated_at->format('d/m/Y H:i') : '-' }}
Lignes
{{ $lines->count() }}
@if($lines->isEmpty())

Aucune ligne pour cet inventaire.

@else
@csrf
@foreach($lines as $line) @php $realQtyInput = old('real_qty.' . $line->id, $line->real_qty); $gapValue = $line->gap; if ($gapValue === null && $realQtyInput !== null && $realQtyInput !== '') { $gapValue = (int)$realQtyInput - (int)$line->theoretical_qty; } $gapClass = $gapValue === null ? 'text-gray-500' : ($gapValue < 0 ? 'text-red-600' : ($gapValue > 0 ? 'text-green-600' : 'text-gray-700')); $variantLabel = $line->variant->size ?? ($line->variant->name ?? '-'); @endphp @endforeach
Produit Variante Stock theorique Stock reel Ecart
{{ $line->product->name ?? '-' }} {{ $variantLabel }} {{ $line->theoretical_qty }} @if($inventory->status === 'EN_COURS') @else {{ $line->real_qty ?? '-' }} @endif {{ $gapValue === null ? '-' : $gapValue }}
@if($inventory->status === 'EN_COURS')
@endif
@endif
@endsection