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

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1583040 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2014-03-29 18:42:06 +00:00
parent f23822cdca
commit c045d83fa0
@@ -141,9 +141,11 @@ public class OfbizCurrencyTransform implements TemplateTransformModel {
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;