Author: jleroux
Date: Thu Jun 3 04:28:27 2010
New Revision: 950870
URL: http://svn.apache.org/viewvc?rev=950870&view=rev
Log:
A patch from Eric De Maulde 'Config price context doesn't refer to a product
store id / product store group id'
https://issues.apache.org/jira/browse/OFBIZ-3770 - OFBIZ-3770
For AGGREGATED product, the service "calculateProductPrice" doesn't refer to a
product store, in order to select the right registered product price between
different productStoreGroupId.
This patch add productStoreId to the price context in order to select the right
registered product price
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java?rev=950870&r1=950869&r2=950870&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java
Thu Jun 3 04:28:27 2010
@@ -542,8 +542,7 @@ public class ProductConfigWrapper implem
BigDecimal listPrice = BigDecimal.ZERO;
BigDecimal price = BigDecimal.ZERO;
// Get the component's price
- Map<String, Object> fieldMap = UtilMisc.toMap("product",
oneComponent.getRelatedOne("ProductProduct"), "prodCatalogId", catalogId,
"webSiteId", webSiteId,
- "currencyUomId", currencyUomId,
"productPricePurposeId", "COMPONENT_PRICE", "autoUserLogin", autoUserLogin);
+ Map<String, Object> fieldMap = UtilMisc.toMap("product",
oneComponent.getRelatedOne("ProductProduct"), "prodCatalogId", catalogId,
"webSiteId", webSiteId, "currencyUomId", currencyUomId,
"productPricePurposeId", "COMPONENT_PRICE", "autoUserLogin", autoUserLogin,
"productStoreId",productStoreId);
Map<String, Object> priceMap =
dispatcher.runSync("calculateProductPrice", fieldMap);
BigDecimal componentListPrice = (BigDecimal)
priceMap.get("listPrice");
BigDecimal componentPrice = (BigDecimal) priceMap.get("price");
@@ -607,8 +606,7 @@ public class ProductConfigWrapper implem
}
// Get the component's price
- Map<String, Object> fieldMap = UtilMisc.toMap("product",
oneComponentProduct, "prodCatalogId", pcw.catalogId, "webSiteId", pcw.webSiteId,
- "currencyUomId", pcw.currencyUomId,
"productPricePurposeId", "COMPONENT_PRICE", "autoUserLogin", pcw.autoUserLogin);
+ Map<String, Object> fieldMap = UtilMisc.toMap("product",
oneComponentProduct, "prodCatalogId", pcw.catalogId, "webSiteId",
pcw.webSiteId, "currencyUomId", pcw.currencyUomId, "productPricePurposeId",
"COMPONENT_PRICE", "autoUserLogin", pcw.autoUserLogin,
"productStoreId",productStoreId);
Map<String, Object> priceMap =
dispatcher.runSync("calculateProductPrice", fieldMap);
BigDecimal componentListPrice = (BigDecimal)
priceMap.get("listPrice");
BigDecimal componentPrice = (BigDecimal) priceMap.get("price");