@extends('adminlte::page') @section('title', 'Sipariş Hazırla #' . $order->id) @section('content') @php $typeColors = ['daily' => '#27ae60', 'weekly' => '#2980b9', 'manual' => '#8e44ad']; $color = $typeColors[$order->type] ?? '#e67e22'; $status = $statuses[$order->status] ?? ['label' => $order->status, 'badge' => 'secondary']; @endphp
{{-- Başlık --}}
Sipariş Hazırla #{{ $order->id }}
{{ optional($order->fromBranch)->name }} {{ optional($order->toBranch)->name }} · {{ $order->order_date?->format('d.m.Y') }}
{{ $status['label'] }}
@if(session('error'))
{{ session('error') }}
@endif @if($order->note)
{{ $order->note }}
@endif
@csrf @foreach($order->items as $itemIndex => $item) @php $lots = $productLots[$item->product_id] ?? collect(); $alreadySent= $item->quantity_sent_kg > 0; @endphp
{{ optional($item->product)->name }} İstenen: {{ $item->quantity_ordered }} {{ optional($item->packageType)->name }} @if($item->quantity_ordered_kg) (≈ {{ number_format($item->quantity_ordered_kg, 1) }} kg) @endif @if($alreadySent) Önceki: {{ number_format($item->quantity_sent_kg, 1) }} kg gönderildi @endif
@if($lots->isEmpty()) Stok Yok @else Toplam: {{ number_format($lots->sum('current_total_quantity'), 1) }} kg stok @endif
@if($lots->isEmpty())
Bu ürün için stokta lot bulunamadı.
@else {{-- Lot satırları --}}
{{-- İlk lot satırı varsayılan olarak FIFO --}} @php $firstLot = $lots->first(); @endphp
Maks: {{ number_format($firstLot->current_total_quantity, 1) }} kg
{{-- Lot ekle --}} {{-- Lot şablonu (JS için) --}} @endif
@endforeach
Miktar girilmeyen ürünler gönderilmez.
Geri
@section('js') @endsection @endsection