No functional change, these "WIP" should not have been committed with r1816033

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1816034 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2017-11-22 10:57:48 +00:00
parent 8cb7d8d4bd
commit c635e62fb2
2 changed files with 4 additions and 7 deletions
@@ -20,5 +20,3 @@ under the License.
def localeMap = []
org.apache.ofbiz.base.util.UtilMisc.availableLocales().each { localeMap.add(localeId:it.toString()) }
parameters.localeList = localeMap
EntityQuery.use(delegator).from("ExampleTypeView").queryList()
@@ -19,7 +19,6 @@
package org.apache.ofbiz.solr;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -200,21 +199,21 @@ public final class ProductUtil {
if (product != null && "AGGREGATED".equals(product.getString("productTypeId"))) {
ProductConfigWrapper configWrapper = new ProductConfigWrapper(delegator, dispatcher, productId, null, null, null, null, locale, userLogin);
String listPrice = configWrapper.getTotalListPrice().setScale(2, RoundingMode.HALF_DOWN).toString();
String listPrice = configWrapper.getTotalListPrice().setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
if (listPrice != null)
dispatchContext.put("listPrice", listPrice);
String defaultPrice = configWrapper.getTotalListPrice().setScale(2, RoundingMode.HALF_DOWN).toString();
String defaultPrice = configWrapper.getTotalListPrice().setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
if (defaultPrice != null)
dispatchContext.put("defaultPrice", defaultPrice);
} else {
Map<String, GenericValue> priceContext = UtilMisc.toMap("product", product);
Map<String, Object> priceMap = dispatcher.runSync("calculateProductPrice", priceContext);
if (priceMap.get("listPrice") != null) {
String listPrice = ((BigDecimal) priceMap.get("listPrice")).setScale(2, RoundingMode.HALF_DOWN).toString();
String listPrice = ((BigDecimal) priceMap.get("listPrice")).setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
dispatchContext.put("listPrice", listPrice);
}
if (priceMap.get("defaultPrice") != null) {
String defaultPrice = ((BigDecimal) priceMap.get("defaultPrice")).setScale(2, RoundingMode.HALF_DOWN).toString();
String defaultPrice = ((BigDecimal) priceMap.get("defaultPrice")).setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
if (defaultPrice != null)
dispatchContext.put("defaultPrice", defaultPrice);
}