{{-- resources/views/ui/consumption/create.blade.php --}} @php $today = now()->format('Y-m-d\TH:i'); $oldItems = old('items', [['product_id' => '', 'variant_id' => '', 'quantity' => 1]]); // Nur Ausgang (Verbrauch) Gründe $reasons = [ 'verbrauch_einsatz' => 'Verbrauch – Einsatz', 'verbrauch_uebung' => 'Verbrauch – Übung', 'verbrauch_verfall' => 'Verbrauch – Verfall', 'verbrauch_defekt' => 'Verbrauch – Defekt', ]; $productsJson = $products ->map(function ($p) { return [ 'id' => $p->id, 'name' => $p->name, 'variants' => $p->variants ->where('active', true) ->values() ->map(fn($v) => ['id' => $v->id, 'name' => $v->name]) ->values(), ]; }) ->values(); @endphp
{{-- Header --}}
Verbrauch erfassen
Es wird ausschließlich Ausgang (Verbrauch) gebucht. Bestand darf nicht negativ werden.
Zurück
{{-- Errors --}} @if ($errors->any())
Bitte prüfen:
    @foreach ($errors->all() as $e)
  • {{ $e }}
  • @endforeach
@endif
@csrf {{-- Meta: Zeitpunkt + Grund auf einer Linie --}}
{{-- Zeitpunkt --}}
Optional. Standard: jetzt.
{{-- Grund --}}
{{-- Notiz volle Breite --}}
{{-- Items --}}
Positionen
Menge ist der Verbrauch pro Position (wird vom Bestand abgezogen).
@foreach ($oldItems as $i => $row) @php $oldProductId = $row['product_id'] ?? ''; $oldVariantId = $row['variant_id'] ?? ''; $oldQty = $row['quantity'] ?? 1; @endphp @endforeach
Artikel Variante Menge Aktion
{{-- Submit --}}
Abbrechen