Won't Fix
Details
Assignee
UnassignedUnassignedReporter
Hiep LqHiep LqLabels
Components
Affects versions
Priority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
Hiep Lq
Hiep LqLabels
Components
Affects versions
Priority
Created June 28, 2017 at 11:06 AM
Updated January 19, 2018 at 5:28 PM
Resolved January 19, 2018 at 5:28 PM
1. when we change "Disallow Negative Inventory" of warehouse from false to true idempiere check quality per warehouse
logic at MWarehouse.beforeSave
SELECT M_Product_ID FROM M_StorageOnHand s WHERE s.M_Locator_ID IN (SELECT M_Locator_ID FROM M_Locator l WHERE M_Warehouse_ID=? ) GROUP BY M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID, C_OrderLine_ID HAVING SUM(s.QtyOnHand) < 0
2. when do a movement, idempiere check "Disallow Negative Inventory" per locator
logic at MStorageOnHand.addQtyOnHand
if (getQtyOnHand().signum() == -1) {
=======
suppose we have two StorageOnHand record and warehouse is allow negative
onhand_1 record quality = -100
onhand_2 record quality = 200
now we change warehouse to disallow negative. it's ok because total on warehouse > 0
issue 1:
do a warehouse movement in quality = 50, by logic it choose record onhand_1 to auto balancing
logic on MStorageOnHand.addQtyOnHand will raise NegativeInventoryDisallowed exception
issue 2:
do a warehouse movement out quality = 150, by logic it choose record onhand_2 to process, so after that we have
onhand_1 record quality = -100
onhand_2 record quality = 50
so now total quality on warehouse is negative, conflict with properties "Disallow Negative Inventory"
, , wdyt?
i description it base on status of my data. but it can be get test case to redo. i will provide test case late.