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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user