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:43:16 UTC

svn commit: r1583041 - in /ofbiz/branches/release13.07: ./ framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java

Author: jleroux
Date: Sat Mar 29 18:43:16 2014
New Revision: 1583041

URL: http://svn.apache.org/r1583041
Log:
"Applied fix from trunk for revision: 1583040  " 
------------------------------------------------------------------------
r1583040 | jleroux | 2014-03-29 19:42:06 +0100 (sam. 29 mars 2014) | 5 lignes

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/branches/release13.07/   (props changed)
    ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java

Propchange: ofbiz/branches/release13.07/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1583040

Modified: ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java?rev=1583041&r1=1583040&r2=1583041&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java (original)
+++ ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java Sat Mar 29 18:43:16 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;