Support #12262
openSupport #12257: Vendor Management flow Issues
Receiving Purchase Order Items Does Not Add Stock to Inventory
0%
Description
Code Location: purchaseOrder.controller.js:L537-L604
What is happening in code: When a delivery truck arrives and warehouse staff click "Mark Items as Received" on a Purchase Order, the code updates the receivedQuantity number on the PO document. However, it never creates a StockBatch, never increases Product.quantity, and never writes to InventoryLedger.
Real-Life Example:
You issue a Purchase Order for 200 sacks of potting soil.
The delivery arrives. The warehouse manager checks the truck, opens the PO screen, and clicks "Receive 200 items".
The PO screen turns green and says "Status: Received".
A customer walks up to the POS register to buy a sack of potting soil.
What breaks: The POS system says: "Cannot sell: Out of Stock (0 Available)"!
Business Impact: Physical stock has arrived and was verified in the warehouse, but it cannot be sold on the POS or website until someone creates a separate vendor invoice.
Simple Fix: In purchaseOrder.controller.js:receiveItems, when items are received:
Increment Product.quantity and variant.stockQuantity.
Create a StockBatch with sourceType: "PURCHASE_ORDER".
Log a ledger entry with type: "IN".
Subtasks
Related issues
No data to display