svn commit: r1097799 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java

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

svn commit: r1097799 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java

jleroux@apache.org
Author: jleroux
Date: Fri Apr 29 12:53:22 2011
New Revision: 1097799

URL: http://svn.apache.org/viewvc?rev=1097799&view=rev
Log:
A patch from Pierre Gaudin "Add a parameter to forbid order decimal quantity" https://issues.apache.org/jira/browse/OFBIZ-4257

Fixing 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");