Author: jacopoc
Date: Wed Dec 14 17:35:40 2011
New Revision: 1214372
URL:
http://svn.apache.org/viewvc?rev=1214372&view=revLog:
Backported from rev. 1214367: OFBIZ-2565: fix for data type mismatch
Modified:
ofbiz/branches/release09.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java
Modified: ofbiz/branches/release09.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release09.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java?rev=1214372&r1=1214371&r2=1214372&view=diff==============================================================================
--- ofbiz/branches/release09.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java (original)
+++ ofbiz/branches/release09.04/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java Wed Dec 14 17:35:40 2011
@@ -19,6 +19,7 @@
package org.ofbiz.hhfacility;
+import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
@@ -116,7 +117,7 @@ public class FacilityServices {
String productId = (String) context.get("productId");
String locationSeqId = (String) context.get("locationSeqId");
String locationSeqIdNew = (String) context.get("locationSeqIdNew");
- 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");
}
@@ -136,8 +137,8 @@ public class FacilityServices {
Debug.logError(e, "updateProductStocktake failed getting inventory counts", module);
return ServiceUtil.returnError("updateProductStocktake failed getting inventory counts");
}
- int atp = ((Double)invAvailability.get("availableToPromiseTotal")).intValue();
- int qoh = ((Double)invAvailability.get("quantityOnHandTotal")).intValue();
+ int atp = ((BigDecimal)invAvailability.get("availableToPromiseTotal")).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);