@extends('layouts.app') @section('title', 'Inventory') @section('content') @php $productMap = $products->keyBy('id'); $materialMap = $materials->keyBy('id'); $branchMap = $branches->keyBy('id'); $formatNumber = fn ($value) => rtrim(rtrim(number_format((float) $value, 2, ',', '.'), '0'), ','); $stockUnitPayload = $units->map(fn ($unit) => ['id' => $unit->id, 'name' => $unit->name, 'symbol' => $unit->symbol, 'base_unit_id' => $unit->base_unit_id, 'conversion_factor' => $unit->conversion_factor]); $stockItemPayload = $materials->map(fn ($item) => ['type' => 'material', 'id' => $item->id, 'name' => $item->name, 'code' => $item->code, 'base_unit_id' => $item->base_unit_id, 'purchase_unit_id' => $item->purchase_unit_id, 'purchase_conversion_factor' => $item->purchase_conversion_factor]) ->concat($products->map(fn ($item) => ['type' => 'product', 'id' => $item->id, 'name' => $item->name, 'code' => $item->code, 'base_unit_id' => $item->sale_unit_id, 'purchase_unit_id' => $item->purchase_unit_id, 'purchase_conversion_factor' => $item->purchase_conversion_factor]))->values(); $stockBalancePayload = $stockBalanceValues->mapWithKeys(fn ($balance) => [$balance->branch_id.':'.($balance->product_id ? 'product' : 'material').':'.($balance->product_id ?: $balance->raw_material_id) => $balance->quantity]); @endphp
Pilih pekerjaan stok yang akan dilakukan.
Aturan ini berlaku pada transaksi kasir di cabang yang dipilih.
Jumlah selalu tersimpan dalam satuan kecil masing-masing item.
| Cabang | Item | Jenis | Jumlah |
|---|---|---|---|
| {{ $branchMap[$row->branch_id]?->name }} | {{ $row->product_id ? $productMap[$row->product_id]?->name : $materialMap[$row->raw_material_id]?->name }} | {{ $row->product_id ? 'Non-BOM / stok langsung' : 'Bahan BOM' }} | {{ $formatNumber($row->quantity) }} {{ $row->product_id ? $productMap[$row->product_id]?->saleUnit?->symbol : $materialMap[$row->raw_material_id]?->baseUnit?->symbol }} |
| Belum ada saldo stok. | |||
Cari lalu tambahkan bahan atau produk yang benar-benar diterima.
Cari item, lalu isi perubahan dalam satuan kecil. Positif menambah, negatif mengurangi.
Hitung stok fisik bahan yang dipakai dalam resep BOM aktif.
| Nomor | Tanggal | Status | Jumlah bahan BOM | Aksi |
|---|---|---|---|---|
| {{ $row->number }} | {{ $row->opname_date }} | {{ $row->status }} | {{ $row->items->whereNotNull('raw_material_id')->count() }} | Buka |
| Belum ada sesi opname tersimpan. | ||||
Jumlah input dan hasil konversi ke satuan kecil dicatat bersama.
| Nomor | Tanggal | Cabang | Item | Jumlah input | Menjadi stok | Supplier / dokumen | Catatan | |
|---|---|---|---|---|---|---|---|---|
| {{ $row->number }} | {{ $row->receipt_date }} | {{ $row->branch }} | {{ $row->item }} | {{ $formatNumber($row->quantity) }} {{ $row->unit }} | {{ $formatNumber($row->base_quantity) }} {{ $row->base_unit }} | {{ $row->supplier ?: '-' }}{{ $row->document_number ? ' · '.$row->document_number : '' }} | {{ $row->notes ?: '-' }} | |
| Belum ada stok masuk. | ||||||||
| Nomor | Tanggal | Cabang | Item | Sebelum | Perubahan | Sesudah | Alasan | Catatan |
|---|---|---|---|---|---|---|---|---|
| {{ $row->number }} | {{ $row->adjustment_date }} | {{ $row->branch }} | {{ $row->item }} | {{ $formatNumber($row->quantity_before) }} | {{ $formatNumber($row->adjustment_quantity) }} | {{ $formatNumber($row->quantity_after) }} | {{ $row->reason }} | {{ $row->notes ?: '-' }} |
| Belum ada penyesuaian stok. | ||||||||
| Waktu | Cabang | Item | Jenis | Sebelum | Perubahan | Sesudah | Catatan |
|---|---|---|---|---|---|---|---|
| {{ \Carbon\Carbon::parse($row->moved_at)->format('d/m/Y H:i') }} | {{ $row->branch }} | {{ $row->item }} | {{ str_replace('_', ' ', $row->type) }} | {{ $formatNumber($row->quantity_before) }} | {{ $formatNumber($row->quantity) }} | {{ $formatNumber($row->quantity_after) }} | {{ $row->notes ?: '-' }} |
| Belum ada pergerakan stok. | |||||||