{{-- Tabel Gabungan Bahan & Sparepart dengan Checklist Variables: $production, $allItems (dari controller) --}} @php $orderQty = $production->quantity ?? $production->order->quantity ?? 1; $canCheckReceived = $production->planning_status === 'approved' && in_array($production->status, ['menunggu', 'dalam_proses']); @endphp

Daftar Bahan & Sparepart

Total {{ $allItems->count() }} item untuk {{ $orderQty }} unit produk

@if($canCheckReceived)
@endif
@if($allItems->count() > 0)
@if($canCheckReceived) @endif @foreach($allItems as $item) @if($canCheckReceived) @endif @endforeach
Terima Tipe Nama Item Jml/Unit Satuan Total Kebutuhan Stok Harga Satuan Total Harga Status
@if($item['type'] === 'material') Bahan @else Sparepart @endif @if($item['is_additional']) Tambahan @endif
{{ $item['name'] }}
{{ $item['quantity'] }} {{ $item['unit'] }} {{ $item['total_needed'] }} {{ $item['unit'] }}
({{ $item['quantity'] }} × {{ $orderQty }} unit)
{{ $item['current_stock'] }} Rp {{ number_format($item['unit_cost'], 0, ',', '.') }} Rp {{ number_format($item['total_cost'], 0, ',', '.') }} @if($item['stock_status'] === 'available') Tersedia @else Perlu Beli @endif @if($item['is_received'])
Diterima
@endif
Total Biaya: Rp {{ number_format($allItems->sum('total_cost'), 0, ',', '.') }}
@else

Belum ada bahan atau sparepart yang ditambahkan.

@endif
{{-- Script untuk toggle checklist --}}