@extends('layouts.app') @section('titre', 'Commandes') @section('contenu')

Commandes {{ $type === 'prevision' ? '— prévisions (simulation)' : 'clients' }} @if($type === 'reelle' && $date > now()->toDateString()) Préparation J+1 @endif

Import fichier CSV — colonnes : code_produit;quantite;unite(caisse|sachet|individuel)[;code_client]

Formats acceptés : sans en-tête code;quantite;unite[;code_client], ou avec en-tête nommé (colonnes code, designation, quantite, unite — le code prime). Trame « commandes clients » prête à remplir (une ligne par produit, sans client) : modèle Excel · modèle CSV.

@csrf
@if($imports->isNotEmpty())

Derniers imports du {{ \Carbon\Carbon::parse($date)->format('d/m/Y') }}

@foreach($imports as $imp) @endforeach
HeureFichierParImportéesRejets
{{ $imp->created_at->format('H:i') }} {{ $imp->fichier }} {{ $imp->user?->name ?? '—' }} {{ $imp->lignes_importees }} @if($imp->rejets)
    @foreach($imp->rejets as $r)
  • {{ $r }}
  • @endforeach
@else — @endif
@endif

Commandes du {{ \Carbon\Carbon::parse($date)->translatedFormat('l d/m/Y') }}

La quantité commandée sert au calcul du besoin de production ; la quantité prise (ce qui est réellement sorti) sert au stock disponible J+1. Laisser la quantité prise vide = « tout le commandé a été pris ».

@forelse($commandes as $c) @empty @endforelse
Produit finiClientCommandéeUnité Prise≈ UVC priseSource
{{ $c->produitFini->designation }} {{ $c->client?->nom ?? '—' }} {{ $c->quantite + 0 }} {{ \App\Models\Commande::UNITES[$c->unite] }}
@csrf
{{ number_format($c->quantitePriseUvc(), 0, ',', ' ') }} {{ $c->source }}
@csrf @method('DELETE')
Aucune commande pour cette date.

Saisie / correction manuelle

@csrf
@endsection