Author: jacopoc
Date: Wed Dec 14 17:35:17 2011
New Revision: 1214370
URL:
http://svn.apache.org/viewvc?rev=1214370&view=revLog:
Backported from rev. 1214367: OFBIZ-2565: fix for data type mismatch
Modified:
ofbiz/branches/release10.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java
Modified: ofbiz/branches/release10.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release10.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java?rev=1214370&r1=1214369&r2=1214370&view=diff==============================================================================
--- ofbiz/branches/release10.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java (original)
+++ ofbiz/branches/release10.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java Wed Dec 14 17:35:17 2011
@@ -19,6 +19,7 @@
package org.ofbiz.hhfacility;
+import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@@ -106,7 +107,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("productId or facilityId not found");
}
@@ -126,7 +127,7 @@ public class FacilityServices {
Debug.logError(e, "updateProductStocktake failed getting inventory counts", module);
return ServiceUtil.returnError("updateProductStocktake failed getting inventory counts");
}
- 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);