You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/03/29 19:42:06 UTC

svn commit: r1583040 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java

Author: jleroux
Date: Sat Mar 29 18:42:06 2014
New Revision: 1583040

URL: http://svn.apache.org/r1583040
Log:
A patch from Deepak Dixit for "ofbizCurrency transform does not honor the rounding passed in ofbizCurrency macro." https://issues.apache.org/jira/browse/OFBIZ-5591

ofbizCurrency transform does not honor the rounding passed in ofbizCurrency macro. OfbizCurrency transform always used the default rounding set in general.properties file.

jleroux:I apply Deepak's patch,  seems good to me. If someone thinks there might be a better solution, please reopen

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java?rev=1583040&r1=1583039&r2=1583040&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java Sat Mar 29 18:42:06 2014
@@ -141,9 +141,11 @@ public class OfbizCurrencyTransform impl
             Delegator delegator = (Delegator) request.getAttribute("delegator");
             // Get rounding from SystemProperty
             if (UtilValidate.isNotEmpty(delegator)) {
-                String roundingString = EntityUtilProperties.getPropertyValue("general.properties", "currency.rounding.default", "10", delegator);
                 scaleEnabled = EntityUtilProperties.getPropertyValue("general.properties", "currency.scale.enabled", "N", delegator);
-                if (UtilValidate.isInteger(roundingString)) roundingNumber = Integer.parseInt(roundingString);
+                if (UtilValidate.isEmpty(roundingNumber)) {
+                    String roundingString = EntityUtilProperties.getPropertyValue("general.properties", "currency.rounding.default", "10", delegator);
+                    if (UtilValidate.isInteger(roundingString)) roundingNumber = Integer.parseInt(roundingString);
+                }
             }
         }
         if (roundingNumber == null) roundingNumber = 10;