Author: jacopoc
Date: Thu May 10 23:59:24 2007
New Revision: 537119
URL:
http://svn.apache.org/viewvc?view=rev&rev=537119Log:
This change to the inventory balance routine will take into account the scenario where the (negative) atp of an existing inventory item with backorders on it is set > 0 by a manual inventory variance.
The trick is to always add the current item to the list of items to rebalance.
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml?view=diff&rev=537119&r1=537118&r2=537119==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml Thu May 10 23:59:24 2007
@@ -569,9 +569,15 @@
<condition-expr field-name="availableToPromiseTotal" operator="equals" value=""/>
<condition-expr field-name="availableToPromiseTotal" operator="less" value="0"/>
</condition-list>
+ <!-- Exclude the current item from the selection, because it will be added to the list anyway -->
+ <condition-expr field-name="inventoryItemId" operator="not-equals" env-name="inventoryItem.inventoryItemId"/>
</condition-list>
<!-- TODO: order the list of inventory items in a useful way, since operations occur below based on the first item -->
</entity-condition>
+ <!-- the current item is added to the list, even if its atp is greater than zero, because there could be
+ negative reservations (backorders) on it, if the atp has been increased by an inventory variance -->
+ <field-to-list field-name="inventoryItem" list-name="inventoryItems"/>
+
<!-- find their current reservations -->
<iterate list-name="inventoryItems" entry-name="item">
<!-- If quantityOnHandTotal is not equal to availableToPromiseTotal this means that