[OFBiz] SVN: r7039 - trunk/applications/product/src/org/ofbiz/product/inventory

jacopo@svn.ofbiz.org jacopo at svn.ofbiz.org
Tue Mar 21 11:14:29 CST 2006


Author: jacopo
Date: 2006-03-21 11:14:23 -0600 (Tue, 21 Mar 2006)
New Revision: 7039

Modified:
   trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
Log:
Fixed bug in inventory tranfers that happened when the inventory item had to be splitted into two ones. In the new one (cloned from the original) the old qoh total and atp total field were not cleaned up and this was messing up the numbers.

Modified: trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
===================================================================
--- trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java	2006-03-21 16:52:31 UTC (rev 7038)
+++ trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java	2006-03-21 17:14:23 UTC (rev 7039)
@@ -115,6 +115,8 @@
                     //       However, the code here should work fine because all the values
                     //       for the new inventory item are inerited from the existing item.
                     newItem = GenericValue.create(inventoryItem);
+                    newItem.set("availableToPromiseTotal", new Double(0));
+                    newItem.set("quantityOnHandTotal", new Double(0));
                     
                     String newSeqId = null;
                     try {
@@ -163,7 +165,7 @@
 
                 inventoryItemToClear.refresh();
                 double atp = inventoryItemToClear.get("availableToPromiseTotal") == null ? 0 : inventoryItemToClear.getDouble("availableToPromiseTotal").doubleValue();
-                if (atp != 0) { 
+                if (atp != 0) {
                     Map createDetailMap = UtilMisc.toMap("availableToPromiseDiff", new Double(-atp), 
                             "inventoryItemId", inventoryItemToClear.get("inventoryItemId"), "userLogin", userLogin);
                     try {



More information about the Svn mailing list