Project

General

Profile

Edit Copy Actions

Support #12261

open

Support #12257: Vendor Management flow Issues

Dual Disconnected Batch Systems (Standalone Collection vs Embedded Array)

Added by Yalavarthi Thriveni 9 days ago. Updated 5 days ago.

Status:
Resolved
Priority:
Normal
Target version:
-
Start date:
11/20/2026
Due date:
% Done:

100%

Estimated time:

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.


Add

Subtasks


Add

Related issues

Edit Copy Actions

Also available in: Atom PDF