Author: jacopoc
Date: Thu Mar 29 08:02:21 2007
New Revision: 523734

URL: http://svn.apache.org/viewvc?view=rev&rev=523734
Log:
Fix for bug in the service that updates the product's low level codes.

Modified:
    ofbiz/trunk/applications/manufacturing/servicedef/services_bom.xml
    
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java

Modified: ofbiz/trunk/applications/manufacturing/servicedef/services_bom.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/servicedef/services_bom.xml?view=diff&rev=523734&r1=523733&r2=523734
==============================================================================
--- ofbiz/trunk/applications/manufacturing/servicedef/services_bom.xml 
(original)
+++ ofbiz/trunk/applications/manufacturing/servicedef/services_bom.xml Thu Mar 
29 08:02:21 2007
@@ -76,7 +76,7 @@
         <attribute mode="IN" name="productId" optional="false" type="String"/>
         <attribute mode="IN" name="fromDate" optional="true" type="String"/>
         <attribute mode="IN" name="bomType" optional="true" type="String"/>
-        <attribute mode="OUT" name="depth" optional="false" type="Integer"/>
+        <attribute mode="OUT" name="depth" optional="false" type="Long"/>
     </service>
 
     <service name="updateLowLevelCode" engine="java"
@@ -85,7 +85,7 @@
         <attribute mode="IN" name="productIdTo" optional="false" 
type="String"/>
         <attribute mode="IN" name="alsoComponents" optional="true" 
type="Boolean"/>
         <attribute mode="IN" name="alsoVariants" optional="true" 
type="Boolean"/>
-        <attribute mode="OUT" name="lowLevelCode" optional="false" 
type="Integer"/>
+        <attribute mode="OUT" name="lowLevelCode" optional="false" 
type="Long"/>
     </service>
 
     <service name="initLowLevelCode" engine="java"

Modified: 
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java?view=diff&rev=523734&r1=523733&r2=523734
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java
 Thu Mar 29 08:02:21 2007
@@ -105,7 +105,7 @@
         } catch(GenericEntityException gee) {
             return ServiceUtil.returnError("Error running max depth algorithm: 
" + gee.getMessage());
         }
-        result.put("depth", new Integer(maxDepth));
+        result.put("depth", new Long(maxDepth));
 
         return result;
     }
@@ -132,11 +132,11 @@
             alsoVariants = Boolean.TRUE;
         }
 
-        Integer llc = null;
+        Long llc = null;
         try {
             GenericValue product = delegator.findByPrimaryKey("Product", 
UtilMisc.toMap("productId", productId));
             Map depthResult = dispatcher.runSync("getMaxDepth", 
UtilMisc.toMap("productId", productId, "bomType", "MANUF_COMPONENT"));
-            llc = (Integer)depthResult.get("depth");
+            llc = (Long)depthResult.get("depth");
             // If the product is a variant of a virtual, then the 
billOfMaterialLevel cannot be 
             // lower than the billOfMaterialLevel of the virtual product.
             List virtualProducts = delegator.findByAnd("ProductAssoc", 
UtilMisc.toMap("productIdTo", productId, "productAssocTypeId", 
"PRODUCT_VARIANT"));
@@ -157,7 +157,7 @@
                     }
                 }
                 if (virtualMaxDepth > llc.intValue()) {
-                    llc = new Integer(virtualMaxDepth);
+                    llc = new Long(virtualMaxDepth);
                 }
             }
             product.set("billOfMaterialLevel", llc);
@@ -175,7 +175,7 @@
                         lev = 
oneProduct.getLong("billOfMaterialLevel").intValue();
                     }
                     if (lev < oneNode.getDepth()) {
-                        oneProduct.set("billOfMaterialLevel", new 
Integer(oneNode.getDepth()));
+                        oneProduct.set("billOfMaterialLevel", new 
Long(oneNode.getDepth()));
                         oneProduct.store();
                     }
                 }


Reply via email to