logic to check negative on-hand for warehouse don't work 100% if IsDisallowNegativeInv change sometime
Description
Environment
None
Attachments
1
Activity
Show:
Won't Fix
Details
Details
Assignee
Unassigned
UnassignedReporter

Labels
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
2. when do a movement, idempiere check "Disallow Negative Inventory" per locator
logic at MStorageOnHand.addQtyOnHand
=======
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.