@Override public boolean updateSaleAndRetailPrices() { boolean salePriceUpdated = updateSalePrice(); boolean retailPriceUpdated = updateRetailPrice(); if (!isRetailPriceOverride() && !isSalePriceOverride()) { if (salePrice != null && salePrice.compareTo(retailPrice) <= 0) { price = salePrice; } else { price = retailPrice; } } return salePriceUpdated || retailPriceUpdated; }
protected boolean updateRetailPrice() { if (isRetailPriceOverride()) { return false; } Money skuRetailPrice = getSku().getRetailPrice(); // Override retail/sale prices from skuBundle. if (skuBundleItem != null) { if (skuBundleItem.getRetailPrice() != null) { skuRetailPrice = skuBundleItem.getRetailPrice(); } } boolean updated = false; //use the sku prices - the retail and sale prices could be null if (skuRetailPrice != null && !skuRetailPrice.getAmount().equals(retailPrice)) { baseRetailPrice = skuRetailPrice.getAmount(); retailPrice = skuRetailPrice.getAmount(); updated = true; } // Adjust prices by adding in fees if they are attached. if (getDiscreteOrderItemFeePrices() != null) { for (DiscreteOrderItemFeePrice fee : getDiscreteOrderItemFeePrices()) { Money returnPrice = convertToMoney(retailPrice); retailPrice = returnPrice.add(fee.getAmount()).getAmount(); } } return updated; }