Author: jleroux
Date: Fri Apr 29 12:53:22 2011
New Revision: 1097799
URL:
http://svn.apache.org/viewvc?rev=1097799&view=revLog:
A patch from Pierre Gaudin "Add a parameter to forbid order decimal quantity"
https://issues.apache.org/jira/browse/OFBIZ-4257Fixing patch
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java?rev=1097799&r1=1097798&r2=1097799&view=diff==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java Fri Apr 29 12:53:22 2011
@@ -1180,6 +1180,10 @@ nextProd:
* @throws GenericEntityException to catch
*/
public static Boolean isDecimalQuantityOrderAllowed(Delegator delegator, String poductId, String productStoreId) throws GenericEntityException{
+ //sometime productStoreId may be null (ie PO), then return default value which is TRUE
+ if(UtilValidate.isEmpty(productStoreId)){
+ return Boolean.TRUE;
+ }
String allowDecimalStore = delegator.findOne("ProductStore", Boolean.TRUE, UtilMisc.toMap("productStoreId", productStoreId)).getString("orderDecimalQuantity");
String allowDecimalProduct = delegator.findOne("Product", Boolean.TRUE, UtilMisc.toMap("productId", poductId)).getString("orderDecimalQuantity");