19. Data Flow: Inventory (Parts & Stok)
Bagaimana sparepart mengalir: masuk (purchase) dan keluar (service/POS), dengan auto journal.
Stok masuk: Purchase Order → Mark Received → StockRecord bertambah → StockHistory → AutoJournal (Debit Inventory, Credit Utang/Kas)
Stok keluar: Service/POS pakai parts → StockRecord berkurang → StockHistory → biaya masuk ke invoice
Stok keluar: Service/POS pakai parts → StockRecord berkurang → StockHistory → biaya masuk ke invoice
- Beli sparepart → Purchase Order ke supplier.
- Mark Received → StockRecord bertambah + StockHistory (type purchase).
- AutoJournal → Debit Inventory (1200), Credit Accounts Payable/Kas.
- Teknisi pakai parts di service → StockRecord berkurang + StockHistory (type usage).
- Jual sparepart via POS → StockRecord berkurang + StockHistory (type pos).
- Stock Adjustment untuk koreksi selisih (approval workflow).
- Reservasi Parts mengunci stok untuk service tertentu (reserved).
/admin/purchases
Stok masuk via purchase order → received → auto tambah stok.
/admin/products
Stok sparepart — harga beli/jual, stok per gudang, reorder alert.
/admin/stock-adjustments
Koreksi stok dengan approval workflow.