A slightly modified patch from Eric De Maulde "Display price with VAT for configurable goods in cart." https://issues.apache.org/jira/browse/OFBIZ-2190 - OFBIZ-2190

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@744714 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2009-02-15 18:20:46 +00:00
parent b27e4791b1
commit 113c33134d
@@ -1176,7 +1176,16 @@ public class ShoppingCartItem implements java.io.Serializable {
if (configWrapper != null) {
// TODO: for configurable products need to do something to make them VAT aware... for now base and display prices are the same
this.setBasePrice(configWrapper.getTotalPrice());
this.setDisplayPrice(configWrapper.getTotalPrice());
// Check if price display with taxes
GenericValue productStore = ProductStoreWorker.getProductStore(cart.getProductStoreId(), delegator);
if (UtilValidate.isNotEmpty(productStore) && productStore.get("showPricesWithVatTax").equals("Y")){
BigDecimal totalPrice = configWrapper.getTotalPrice();
// Get Taxes
Map totalPriceWithTaxMap = dispatcher.runSync("calcTaxForDisplay", UtilMisc.toMap("basePrice", totalPrice, "productId", this.productId, "productStoreId", cart.getProductStoreId()));
this.setDisplayPrice((BigDecimal) totalPriceWithTaxMap.get("priceWithTax"));
}else{
this.setDisplayPrice(configWrapper.getTotalPrice());
}
}
// no try to do a recurring price calculation; not all products have recurring prices so may be null