Class PromotableOfferUtilityImpl
java.lang.Object
org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl
- All Implemented Interfaces:
PromotableOfferUtility
@Service("blPromotableOfferUtility")
public class PromotableOfferUtilityImpl
extends Object
implements PromotableOfferUtility
- Author:
- Nick Crum (ncrum)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateSavingsForOrderItem(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItem promotableOrderItem, int qtyToReceiveSavings) protected MoneycomputeAdjustmentValue(Money currentPriceDetailValue, BigDecimal offerUnitValue, BroadleafCurrency currency, OfferDiscountType discountType, PromotionRounding rounding) computeAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup, boolean allowSalePrice) computeAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail, boolean allowSalePrice) protected Tuple<OfferDiscountType,BigDecimal> computeDiscountVariables(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItem promotableOrderItem, int quantity) Computes the discount type and unit value for the given PromotableOrderItem.computeRetailAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup) computeRetailAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail) computeSalesAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup) computeSalesAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail) protected BigDecimaldetermineOfferUnitValue(Offer offer, Integer quantityForTieredOffer) protected OfferPriceDatafindMatchingOfferPriceData(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItem orderItem) booleanitemMatchesOfferPriceData(OfferPriceData offerPriceData, PromotableOrderItem promotableOrderItem)
-
Constructor Details
-
PromotableOfferUtilityImpl
public PromotableOfferUtilityImpl()
-
-
Method Details
-
itemMatchesOfferPriceData
public boolean itemMatchesOfferPriceData(OfferPriceData offerPriceData, PromotableOrderItem promotableOrderItem) - Specified by:
itemMatchesOfferPriceDatain interfacePromotableOfferUtility
-
computeRetailAdjustmentValue
public Money computeRetailAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup) - Specified by:
computeRetailAdjustmentValuein interfacePromotableOfferUtility
-
computeSalesAdjustmentValue
public Money computeSalesAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup) - Specified by:
computeSalesAdjustmentValuein interfacePromotableOfferUtility
-
computeAdjustmentValue
public Money computeAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup, boolean allowSalePrice) - Specified by:
computeAdjustmentValuein interfacePromotableOfferUtility
-
computeRetailAdjustmentValue
public Money computeRetailAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail) - Specified by:
computeRetailAdjustmentValuein interfacePromotableOfferUtility
-
computeSalesAdjustmentValue
public Money computeSalesAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail) - Specified by:
computeSalesAdjustmentValuein interfacePromotableOfferUtility
-
computeAdjustmentValue
public Money computeAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail, boolean allowSalePrice) - Specified by:
computeAdjustmentValuein interfacePromotableOfferUtility
-
calculateSavingsForOrderItem
public Money calculateSavingsForOrderItem(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItem promotableOrderItem, int qtyToReceiveSavings) - Specified by:
calculateSavingsForOrderItemin interfacePromotableOfferUtility
-
computeDiscountVariables
protected Tuple<OfferDiscountType,BigDecimal> computeDiscountVariables(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItem promotableOrderItem, int quantity) Computes the discount type and unit value for the given PromotableOrderItem.- Parameters:
promotableCandidateItemOffer-promotableOrderItem-quantity-- Returns:
-
findMatchingOfferPriceData
protected OfferPriceData findMatchingOfferPriceData(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItem orderItem) -
computeAdjustmentValue
protected Money computeAdjustmentValue(Money currentPriceDetailValue, BigDecimal offerUnitValue, BroadleafCurrency currency, OfferDiscountType discountType, PromotionRounding rounding) -
determineOfferUnitValue
-