{{-- Tabel Gabungan Bahan & Sparepart dengan Status Ketersediaan - ADMIN Variables: $production, $allItems (dari controller) --}} @php $orderQty = $production->quantity ?? $production->order->quantity ?? 1; $hasInsufficientStock = $allItems->where('stock_status', 'insufficient')->count() > 0; @endphp
Total {{ $allItems->count() }} item untuk {{ $orderQty }} unit produk
| Tipe | Nama Item | Jml/Unit | Satuan | Total Kebutuhan | Stok Tersedia | Kekurangan | Harga Satuan | Total Harga | Status | Aksi |
|---|---|---|---|---|---|---|---|---|---|---|
| @if($item['type'] === 'material') Bahan @else Sparepart @endif @if($item['is_additional']) Tambahan @endif |
{{ $item['name'] }}
|
{{ $item['quantity'] }} | {{ $item['unit'] }} |
{{ $item['total_needed'] }}
({{ $item['quantity'] }} × {{ $orderQty }})
|
{{ $item['current_stock'] }} | @if($item['shortage'] > 0) -{{ $item['shortage'] }} @else - @endif | 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 Teknisi
@endif
|
@if($item['stock_status'] === 'insufficient') Beli @else - @endif |
| Total Biaya: | Rp {{ number_format($allItems->sum('total_cost'), 0, ',', '.') }} | |||||||||
Belum ada bahan atau sparepart yang ditambahkan.