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 TypeMethodDescriptionorg.broadleafcommerce.common.money.MoneycalculateSavingsForOrderItem(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItem promotableOrderItem, int qtyToReceiveSavings) protected org.broadleafcommerce.common.money.MoneycomputeAdjustmentValue(org.broadleafcommerce.common.money.Money currentPriceDetailValue, BigDecimal offerUnitValue, org.broadleafcommerce.common.currency.domain.BroadleafCurrency currency, OfferDiscountType discountType, PromotionRounding rounding) org.broadleafcommerce.common.money.MoneycomputeAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup, boolean allowSalePrice) org.broadleafcommerce.common.money.MoneycomputeAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail, boolean allowSalePrice) protected org.broadleafcommerce.common.util.Tuple<OfferDiscountType,BigDecimal> computeDiscountVariables(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItem promotableOrderItem, int quantity) Computes the discount type and unit value for the given PromotableOrderItem.org.broadleafcommerce.common.money.MoneycomputeRetailAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup) org.broadleafcommerce.common.money.MoneycomputeRetailAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail) org.broadleafcommerce.common.money.MoneycomputeSalesAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup) org.broadleafcommerce.common.money.MoneycomputeSalesAdjustmentValue(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 org.broadleafcommerce.common.money.Money computeRetailAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup) - Specified by:
computeRetailAdjustmentValuein interfacePromotableOfferUtility
-
computeSalesAdjustmentValue
public org.broadleafcommerce.common.money.Money computeSalesAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup) - Specified by:
computeSalesAdjustmentValuein interfacePromotableOfferUtility
-
computeAdjustmentValue
public org.broadleafcommerce.common.money.Money computeAdjustmentValue(PromotableCandidateFulfillmentGroupOffer promotableCandidateFulfillmentGroupOffer, PromotableFulfillmentGroup promotableFulfillmentGroup, boolean allowSalePrice) - Specified by:
computeAdjustmentValuein interfacePromotableOfferUtility
-
computeRetailAdjustmentValue
public org.broadleafcommerce.common.money.Money computeRetailAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail) - Specified by:
computeRetailAdjustmentValuein interfacePromotableOfferUtility
-
computeSalesAdjustmentValue
public org.broadleafcommerce.common.money.Money computeSalesAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail) - Specified by:
computeSalesAdjustmentValuein interfacePromotableOfferUtility
-
computeAdjustmentValue
public org.broadleafcommerce.common.money.Money computeAdjustmentValue(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItemPriceDetail orderItemPriceDetail, boolean allowSalePrice) - Specified by:
computeAdjustmentValuein interfacePromotableOfferUtility
-
calculateSavingsForOrderItem
public org.broadleafcommerce.common.money.Money calculateSavingsForOrderItem(PromotableCandidateItemOffer promotableCandidateItemOffer, PromotableOrderItem promotableOrderItem, int qtyToReceiveSavings) - Specified by:
calculateSavingsForOrderItemin interfacePromotableOfferUtility
-
computeDiscountVariables
protected org.broadleafcommerce.common.util.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 org.broadleafcommerce.common.money.Money computeAdjustmentValue(org.broadleafcommerce.common.money.Money currentPriceDetailValue, BigDecimal offerUnitValue, org.broadleafcommerce.common.currency.domain.BroadleafCurrency currency, OfferDiscountType discountType, PromotionRounding rounding) -
determineOfferUnitValue
-