@extends('layouts.layout-2') @section('content') @include('admin.inventory.partials.table-actions-style') @php $statusBadge = match ($status) { 'critical' => '' . __('Kritisch') . '', 'critical_ordered' => '' . __('Kritisch · bereits bestellt') . '', 'warning' => '' . __('Bald nachbestellen') . '', default => '' . __('Ausreichend') . '', }; @endphp
{{ __('Rohstoffbestellung') }}: {{ $ingredient->name }} {!! $statusBadge !!} {{ __('Zurück') }}
{{ __('Qualität') }}
{{ $ingredient->materialQuality?->name ?? '—' }}
{{ __('Gesamtbestand') }}
{{ \App\Services\Util::formatNumber($remaining, 0) }} g
{{ __('Offen bestellt') }}
@if($openTotal > 0) {{ \App\Services\Util::formatNumber($openTotal, 0) }} g @else — @endif
{{ __('Verbrauch / Tag') }}
@if($daily !== null && $daily > 0) {{ \App\Services\Util::formatNumber($daily, 0) }} g @else — @endif
{{ __('Voraussichtlich auf Null') }}
@if($expectedEmpty !== null) {{ $expectedEmpty->format('d.m.Y') }} ({{ $daysUntilEmpty }} {{ trans_choice('Tag|Tagen', $daysUntilEmpty) }}) @else — @endif
@if($ingredient->min_stock_alert !== null)
{{ __('Meldebestand') }}: {{ \App\Services\Util::formatNumber($ingredient->min_stock_alert, 0) }} g
@endif
{{ __('Enthalten in') }}
@forelse($ingredient->products as $product) @empty @endforelse
{{ __('Produkt') }} {{ __('Produktbestand') }} {{ __('Rezeptur-Anteil (g/Stück)') }}
{{ $product->name }} {{ \App\Services\Util::formatNumber($productStock[$product->id] ?? 0, 0) }} {{ __('Stück') }} @if($product->pivot->gram !== null && $product->pivot->gram !== '') {{ \App\Services\Util::formatNumber($product->pivot->gram, 2) }} g @else @endif
{{ __('Dieser Rohstoff wird in keiner aktiven Rezeptur verwendet.') }}
{{ __('Lieferanten & Bestellung') }}
@forelse($ingredient->suppliers as $supplier) @php $deliveryTime = $ingredient->delivery_time ?: $supplier->delivery_time; $lastPrice = $lastPriceBySupplier[$supplier->id] ?? null; $orderUrl = $supplier->order_url ?: $supplier->url; $orderEmail = $supplier->order_email ?: $supplier->email; @endphp @empty @endforelse
{{ __('Lieferant') }} {{ __('Lieferzeit') }} {{ __('Letzter Einkauf (Netto/kg)') }}
{{ $supplier->name }} @if($supplier->pivot->preferred) {{ __('bevorzugt') }} @endif @if($supplier->pivot->supplier_sku)
{{ __('Art.-Nr.') }}: {{ $supplier->pivot->supplier_sku }}
@endif
{{ $deliveryTime ?: '—' }} @if($lastPrice !== null) {{ \App\Services\Util::formatNumber($lastPrice, 2) }} € @else @endif @if($supplier->order_method === 'online_shop' && $orderUrl) {{ __('Zum Shop') }} @elseif($orderEmail) {{ __('Per Mail') }} @elseif($orderUrl) {{ __('Zum Shop') }} @else @endif
{{ __('Diesem Rohstoff ist kein Lieferant zugeordnet.') }}
@if(Auth::user()->isAdmin()) @endif
{{ __('Offene Bestellungen / unterwegs') }}
@forelse($openOrders as $order) @empty @endforelse
{{ __('Bestellt am') }} {{ __('Lieferant') }} {{ __('Lagerort') }} {{ __('Bestellte Menge') }}
{{ $order->ordered_at?->format('d.m.Y') ?? '—' }} {{ $order->supplier?->name ?? '—' }} {{ $order->location?->name ?? '—' }} {{ \App\Services\Util::formatNumber($order->ordered_quantity, 0) }} g
{{ __('Keine offenen Bestellungen.') }}
@if($openOrders->isNotEmpty()) @endif
{{ __('Verfügbare Chargen') }}
@forelse($charges as $charge) @empty @endforelse @if($charges->isNotEmpty() && count($remainingByLocation) > 0) @foreach($locations as $location) @if(isset($remainingByLocation[$location->id]) && $remainingByLocation[$location->id] > 0) @endif @endforeach @endif
{{ __('Charge') }} {{ __('Lieferant') }} {{ __('Lagerort') }} {{ __('MHD') }} {{ __('Restbestand') }}
{{ $charge->batch_number ?: '#' . $charge->id }} {{ $charge->supplier?->name ?? '—' }} {{ $charge->location?->name ?? '—' }} {{ $charge->best_before?->format('d.m.Y') ?? '—' }} {{ \App\Services\Util::formatNumber($charge->getAttribute('remaining_quantity'), 0) }} g
{{ __('Kein Restbestand vorhanden.') }}
{{ __('Bestand') }} {{ $location->name }} {{ \App\Services\Util::formatNumber($remainingByLocation[$location->id], 0) }} g
@endsection