@extends('layouts.erp') @section('title', 'Stocks') @section('page_title', 'Stocks & Logistique') @section('page_sub', $items->total().' références · Toutes boutiques') @section('content') @php $all = \App\Models\Product::with('stockLevels')->get(); $valeur = $all->sum(fn ($p) => $p->total_stock * (float) $p->purchase_price); $ruptures = $all->filter(fn ($p) => $p->stockStatus() === 'rupture')->count(); $transferts = \App\Models\StockTransfer::whereIn('status', ['en_attente','valide','expedie'])->count(); $fmt = fn ($n) => number_format($n, 0, ',', ' ').' F'; @endphp
| Produit | Catégorie | Stock | Prix de vente | Statut | |
|---|---|---|---|---|---|
|
{{ strtoupper(substr($item->reference, 0, 3)) }}
{{ $item->name }}
Réf. {{ $item->reference }}{{ $item->brand ? ' · '.$item->brand : '' }}
|
{{ $item->category->name ?? '—' }} | {{ $item->total_stock }} | {{ $fmt($item->sale_price) }} | @if($st === 'ok')En stock @elseif($st === 'faible')Faible @elseif($st === 'critique')Critique @elseRupture@endif |
|
Aucun article. | |||||