svn commit: r1214368 - /ofbiz/branches/release11.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1214368 - /ofbiz/branches/release11.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java

jacopoc
Author: jacopoc
Date: Wed Dec 14 17:34:05 2011
New Revision: 1214368

URL: http://svn.apache.org/viewvc?rev=1214368&view=rev
Log:
Backported from rev. 1214367: OFBIZ-2565: fix for data type mismatch

Modified:
    ofbiz/branches/release11.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java

Modified: ofbiz/branches/release11.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java?rev=1214368&r1=1214367&r2=1214368&view=diff
==============================================================================
--- ofbiz/branches/release11.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java (original)
+++ ofbiz/branches/release11.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java Wed Dec 14 17:34:05 2011
@@ -19,6 +19,7 @@
 
 package org.ofbiz.hhfacility;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -107,7 +108,7 @@ public class FacilityServices {
         String facilityId = (String) context.get("facilityId");
         String productId = (String) context.get("productId");
         String locationSeqId = (String) context.get("locationSeqId");
-        Double quantity = (Double) context.get("quantity");
+        BigDecimal quantity = (BigDecimal) context.get("quantity");
         if (UtilValidate.isEmpty(productId) || UtilValidate.isEmpty(facilityId)) {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ProductIdOrFacilityIdNotFound", locale));
         }
@@ -127,7 +128,7 @@ public class FacilityServices {
             Debug.logError(e, "updateProductStocktake failed getting inventory counts", module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ProductErrorUpdateProductStockTake", locale));
         }
-        int qoh = ((Double)invAvailability.get("quantityOnHandTotal")).intValue();
+        int qoh = ((BigDecimal)invAvailability.get("quantityOnHandTotal")).intValue();
         if (quantity.intValue() == qoh) {
             // No change required.
             Debug.logInfo("updateProductStocktake No change required quantity("+quantity+") = qoh("+qoh+")", module);