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

URL: http://svn.apache.org/r1583042
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/release12.04/   (props changed)
    
ofbiz/branches/release12.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1583040

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


Reply via email to