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

Stock

Nouveau
Réinitialiser
@if(!empty($stats))
Total items: {{ $stats['total_items'] }}
Quantité: {{ $stats['total_quantity'] }}
Réservé: {{ $stats['total_reserved'] }}
Stock faible: {{ $stats['low_stock_count'] }}
@endif

Vue par magasin

@if($stockItems->isEmpty())

Aucun stock.

@else
@foreach($stockItems as $item) @php $available = (int)$item->quantity - (int)$item->reserved_quantity; $threshold = (int)($item->alert_threshold ?? 0); $availableClass = 'text-green-600'; if ($available <= 0) { $availableClass = 'text-red-600'; } elseif ($available <= $threshold) { $availableClass = 'text-orange-600'; } @endphp @endforeach
Magasin Produit Variante Stock disponible Stock réservé Stock total
{{ optional($item->store)->name ?? '-' }} {{ optional($item->product)->name ?? '-' }} {{ optional($item->variant)->size ?? (optional($item->variant)->name ?? '-') }} {{ $available }} {{ $item->reserved_quantity }} {{ $item->quantity }}
{{ $stockItems->links() }}
@endif

Vue globale

@if($globalStock->isEmpty())

Aucun stock global.

@else
@foreach($globalStock as $row) @php $totalAvailable = (int)$row->total_available; $threshold = (int)($row->min_alert_threshold ?? 0); $totalClass = 'text-green-600'; if ($totalAvailable <= 0) { $totalClass = 'text-red-600'; } elseif ($totalAvailable <= $threshold) { $totalClass = 'text-orange-600'; } $product = $globalProducts[$row->product_id] ?? null; $variant = $globalVariants[$row->variant_id] ?? null; $productName = $product ? $product->name : '-'; $variantName = $variant ? ($variant->size ?? ($variant->name ?? '-')) : '-'; @endphp @endforeach
Produit Variante Stock total
{{ $productName }} {{ $variantName }}
{{ $row->total_quantity }}
Disponible: {{ $row->total_available }} · Réservé: {{ $row->total_reserved }}
@endif
@endsection