Feature #5398
openImplement Vendor-wise Stock Batches for Product Inventory
Description
As an Inventory Manager
I want the system to maintain stock in batches based on vendor purchase price and quantity
So that each batch of inventory reflects its own cost, and sales/consumption deduct stock from the correct vendor batch instead of overwriting purchase price globally.
Business Requirements
Each incoming purchase should create a separate Stock Batch with:
Vendor
Purchase Price
Quantity Received
Quantity Remaining
Received Date
Product’s global purchasePrice and qty must not be overwritten when new stock arrives.
Sales/consumption flows must deduct quantity in FIFO order (oldest batch first) or based on future custom rules.
UI should show all batches for a product with vendor, price, and remaining qty.
Sale price should reflect the active batch (optional rule).
API should handle stock receipts, consumption, and retrieval of batches.
Adding stock creates a new batch record, not updating existing product purchase price.
When quantity is consumed, it is deducted from the earliest batch with remaining quantity.
System must show correct remaining qty per batch after sales.
Product total quantity updates correctly as the sum of batch qtys.
UI displays all batches for each product.
No overwrite of older purchase prices when new vendor stock arrives.
Batch history visible (who created, when).
API responses follow consistent schema.
Related issues