Support #12261
openSupport #12257: Vendor Management flow Issues
Dual Disconnected Batch Systems (Standalone Collection vs Embedded Array)
100%
Description
Code Location:
stockBatch-model.js
vs
nursery.product.js:L94
&
VariantBatchModal.tsx
What is happening in code: The system has two completely separate batch systems that do not talk to each other:
System A: The standalone StockBatch collection (used by Vendor Invoices and FIFO stock deduction).
System B: An embedded array called inventoryBatches inside each variant in the product document (used by the Inventory Batch UI modal).
Real-Life Example:
You receive a vendor invoice for 100 units of Organic Rose Food (Batch #LOT-999).
An invoice record is created in System A (StockBatch collection). FIFO uses this to deduct stock when sales occur.
Your warehouse manager opens the Product Inventory Management Screen and clicks "View Batches" (
VariantBatchModal.tsx
).
What breaks: The modal reads System B (product.variants.inventoryBatches), which is empty!
Business Impact: Warehouse staff believe no batches exist for this product and create a duplicate manual batch, causing inventory duplication and confusion.
Simple Fix: Eliminate System B. Point
VariantBatchModal.tsx
to fetch and manage data from the single source of truth: the StockBatch collection via /api/vendor-invoices/batches.
Subtasks
Related issues
Updated by Divya Inapakurthi 5 days ago
- Status changed from New to Resolved
- Assignee set to Divya Inapakurthi
- % Done changed from 0 to 100