Class LineItemOfferDetail
- java.lang.Object
-
- com.broadleafcommerce.promotion.offer.web.context.info.LineItemOfferDetail
-
- All Implemented Interfaces:
Serializable
public class LineItemOfferDetail extends Object implements Serializable
DTO containing information about the effects of all theoffer'sapplicable to anEnhancedLineItemeither treating it as aOffer.getTargetItemCriteria()target} or aOffer.getItemQualifierCriteria()qualifier}.- Author:
- Nathan Moore (nathanmoore).
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LineItemOfferDetail()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected OfferQualifieraddNewQualifierAndGet(com.broadleafcommerce.common.extension.TypeFactory offerFactory, CandidateItemOffer itemOffer)protected OfferDiscountaddNewTargetAndGet(com.broadleafcommerce.common.extension.TypeFactory offerFactory, CandidateItemOffer itemOffer)OfferQualifieraddOrUpdateMatchingOfferQualifier(CandidateItemOffer itemOffer, ItemCriteriaRule qualifierCriteria, int qtyToMarkAsQualifier, com.broadleafcommerce.common.extension.TypeFactory offerFactory)Either creates a newOfferQualifieror updates a preexisting one for the givenCandidateItemOffer, marking the quantity of to reserve for use as qualifiers for the givenItemCriteriaRule.voidaddOrUpdateMatchingOfferTarget(CandidateItemOffer itemOffer, ItemCriteriaRule targetCriteria, int qtyToMarkAsTarget, com.broadleafcommerce.common.extension.TypeFactory offerFactory)Either creates a newOfferDiscountor updates a preexisting one for the givenCandidateItemOffer, marking the quantity of to reserve for use as targets for the givenItemCriteriaRule.StringbuildDetailKey()javax.money.MonetaryAmountcalculateAdjustmentValue(javax.money.CurrencyUnit currency, boolean useSaleAdjustments)javax.money.MonetaryAmountcalculateItemUnitPriceWithAdjustments(boolean allowSalePrice)protected javax.money.MonetaryAmountcalculateSaleAdjustmentUnitPrice()protected javax.money.MonetaryAmountcalculateStandardAdjustmentUnitPrice()javax.money.MonetaryAmountcalculateTotalAdjustmentValue(javax.money.CurrencyUnit currency, boolean useSaleAdjustments)protected booleancanEqual(Object other)protected booleancheckStackable(Offer offer, Offer otherOffer)voidchooseSaleOrStandardPrice()This method will check to see if the salePriceAdjustments or standardPriceAdjustments are better and remove those that should not apply.protected voidchooseUnadjustedSaleOrStandardPrice()voidclearAllNonFinalizedQuantities()Clears target and qualifier quantities that were marked for a promotion that did not have enough qualifiers or targets to get applied.protected voidcopyDiscountsAndAdjustmentsToNewDetail(com.broadleafcommerce.common.extension.TypeFactory offerFactory, int discountQty, LineItemOfferDetail newDetail)booleanequals(Object o)protected voidfinalizeAdjustments(boolean useSaleAdjustments)voidfinalizeQuantities()Updates the target and qualifier quantities to indicate the number that are being used.javax.money.MonetaryAmountgetAdjustedTotal()The total value of alladjustmentstimes thequantityof this detail.protected javax.money.MonetaryAmountgetAdjustedTotalUsingSalePrice(javax.money.MonetaryAmount standardAdjustmentPrice)protected javax.money.MonetaryAmountgetAdjustedTotalUsingStandardPrice(javax.money.MonetaryAmount standardAdjustmentPrice)Set<ItemOfferAdjustment>getAdjustments()doublegetBundleRatio()The ratio of the offer discount to apply to this item.doublegetBundleRatioOr1()javax.money.MonetaryAmountgetFinalAdjustmentValue(javax.money.CurrencyUnit currency)javax.money.MonetaryAmountgetFinalAdjustmentValueIncludingFutureDiscounts(javax.money.CurrencyUnit currency)javax.money.MonetaryAmountgetFinalizedTotalWithAdjustments()Returns the final total for this item taking into account the finalized orderAdjustments.javax.money.MonetaryAmountgetFinalTotalAdjustmentValue(javax.money.CurrencyUnit currency)javax.money.MonetaryAmountgetFutureCreditValue(javax.money.CurrencyUnit currency)EnhancedLineItemgetLineItem()TheEnhancedLineItemaffected byoffers.Set<OfferDiscount>getOfferDiscounts()Set<OfferQualifier>getOfferQualifiers()Set<EnhancedProratedItemOfferAdjustment>getProratedAdjustments()TheProratedItemOfferAdjustmentscaused byofferswithDiscount.getProrationType()orProrationType.TARGET_AND_QUALIFIERtreating bothlineItemas a target and the items that qualify it.protected intgetQtyAvailableToBeUsed(CandidateItemOffer offer, boolean isForQualifierQty)Calculates the number oforder itemsnot already exclusively used as targets or qualifiers either by this offer or any other and, therefore, are available to be used as qualifiers or targets by the givenOffer.intgetQtyAvailableToUseAsQualifier(CandidateItemOffer offer)Calculates the number oforder itemsavailable to be used as qualifiers for the providedOffer.intgetQtyAvailableToUseAsTarget(CandidateItemOffer offer)Calculates the number oforder itemsavailable to be used as targets for the providedOffer.intgetQuantity()The quantity of items related to this detail.protected intgetQuantityOfItemsExclusivelyUsedAsQualifiers(CandidateItemOffer thisOffer, Set<OfferQualifier> offerQualifiers, boolean isForQualifierQty)Calculates the number oforder itemsalready exclusively used as qualifiers.protected intgetQuantityOfItemsExclusivelyUsedAsTargets(CandidateItemOffer thisOffer, Set<OfferDiscount> offerDiscounts, boolean isForQualifierQty)Calculates the number oforder itemsalready exclusively used as targets.inthashCode()protected booleanhasOrderItemAdjustments()booleanisAdjustmentsFinalized()Whether theadjustmentsare the orderAdjustments to actually use rather than being potential or incomplete.protected Predicate<ItemOfferAdjustment>isDiscountCurrentOrder()protected booleanisNonCombinableOfferApplied()protected booleanisStackable(Offer offer, Offer otherOffer)booleanisTotalitarianOfferApplied()booleanisUseSaleAdjustments()Whether to useEnhancedLineItem.getSalePrice()in price adjustment calculations.protected Optional<OfferQualifier>lookupOfferQualifierByOffer(CandidateItemOffer itemOffer)protected Optional<OfferDiscount>lookupOfferTargetByOffer(CandidateItemOffer itemOffer)voidremoveAllAdjustments()Removes all orderAdjustments from this detail.protected voidremoveStandardOnlyAdjustments()protected voidremoveZeroDollarAdjustments(boolean useSalePrice)voidsetAdjustedTotal(javax.money.MonetaryAmount adjustedTotal)The total value of alladjustmentstimes thequantityof this detail.voidsetAdjustments(Set<ItemOfferAdjustment> adjustments)voidsetAdjustmentsFinalized(boolean adjustmentsFinalized)Whether theadjustmentsare the orderAdjustments to actually use rather than being potential or incomplete.voidsetBundleRatio(double bundleRatio)The ratio of the offer discount to apply to this item.voidsetLineItem(EnhancedLineItem lineItem)TheEnhancedLineItemaffected byoffers.voidsetOfferDiscounts(Set<OfferDiscount> offerDiscounts)voidsetOfferQualifiers(Set<OfferQualifier> offerQualifiers)voidsetProratedAdjustments(Set<EnhancedProratedItemOfferAdjustment> proratedAdjustments)TheProratedItemOfferAdjustmentscaused byofferswithDiscount.getProrationType()orProrationType.TARGET_AND_QUALIFIERtreating bothlineItemas a target and the items that qualify it.voidsetQuantity(int quantity)The quantity of items related to this detail.voidsetUseSaleAdjustments(boolean useSaleAdjustments)Whether to useEnhancedLineItem.getSalePrice()in price adjustment calculations.protected LineItemOfferDetailsplit(com.broadleafcommerce.common.extension.TypeFactory offerFactory, int discountQty, String offerId, boolean hasQualifiers)Deprecated.since 1.6, in favor ofsplit(TypeFactory, OfferDiscount).protected LineItemOfferDetailsplit(com.broadleafcommerce.common.extension.TypeFactory offerFactory, OfferDiscount offerDiscount)Splits this item into twoLineItemOfferDetailsand returns the newly createdLineItemOfferDetail.Optional<LineItemOfferDetail>splitIfNecessary(com.broadleafcommerce.common.extension.TypeFactory offerFactory)Checks to see that the discount quantities match the target quantities.StringtoString()
-
-
-
Method Detail
-
finalizeQuantities
public void finalizeQuantities()
Updates the target and qualifier quantities to indicate the number that are being used.
-
clearAllNonFinalizedQuantities
public void clearAllNonFinalizedQuantities()
Clears target and qualifier quantities that were marked for a promotion that did not have enough qualifiers or targets to get applied.
-
addOrUpdateMatchingOfferQualifier
@NonNull public OfferQualifier addOrUpdateMatchingOfferQualifier(@NonNull CandidateItemOffer itemOffer, @NonNull ItemCriteriaRule qualifierCriteria, int qtyToMarkAsQualifier, @NonNull com.broadleafcommerce.common.extension.TypeFactory offerFactory)
Either creates a newOfferQualifieror updates a preexisting one for the givenCandidateItemOffer, marking the quantity of to reserve for use as qualifiers for the givenItemCriteriaRule.- Parameters:
itemOffer- theCandidateItemOfferfor which to either create a newOfferQualifieror update a preexisting one.qualifierCriteria- theOffer.getItemQualifierCriteria()matched by thelineItemqtyToMarkAsQualifier- the number of items to mark as reserved for use as item qualifiersofferFactory- theTypeFactoryused to create a newOfferQualifierif needed- Returns:
- the new or updated
OfferQualifierDTO related to the givenCandidateItemOffer
-
addOrUpdateMatchingOfferTarget
public void addOrUpdateMatchingOfferTarget(@NonNull CandidateItemOffer itemOffer, @NonNull ItemCriteriaRule targetCriteria, int qtyToMarkAsTarget, @NonNull com.broadleafcommerce.common.extension.TypeFactory offerFactory)Either creates a newOfferDiscountor updates a preexisting one for the givenCandidateItemOffer, marking the quantity of to reserve for use as targets for the givenItemCriteriaRule.- Parameters:
itemOffer- theCandidateItemOfferfor which to either create a newOfferDiscountor update a preexisting one.targetCriteria- theOffer.getTargetItemCriteria()matched by thelineItemqtyToMarkAsTarget- the number of items to mark as reserved for use as target itemsofferFactory- theTypeFactoryused to create a newOfferDiscountif needed
-
isNonCombinableOfferApplied
protected boolean isNonCombinableOfferApplied()
- Returns:
- whether any
ItemOfferAdjustment.getOffer()adjustment's offer} doesn't have aOffer.getCombinabilityType()ofCombinabilityType.ANY.
-
isTotalitarianOfferApplied
public boolean isTotalitarianOfferApplied()
- Returns:
- whether any
ItemOfferAdjustment.getOffer()adjustment's offer} has aOffer.getCombinabilityType()ofCombinabilityType.NONE.
-
getQtyAvailableToUseAsTarget
public int getQtyAvailableToUseAsTarget(CandidateItemOffer offer)
Calculates the number oforder itemsavailable to be used as targets for the providedOffer.Checks if the provided
Offeriscombinableand if all offers already applied tothe related order itemare also combinable, then returns the result of#getQtyAvailableToBeUsed(Offer, boolean). If this or an already applied offer arenon-combinableortotalitarian, then returns 0.- Parameters:
offer- the offer for which we are counting the number of possible targets- Returns:
- the number of
orderLineItemsnot already exclusively used as targets or qualifiers
-
getQtyAvailableToUseAsQualifier
public int getQtyAvailableToUseAsQualifier(CandidateItemOffer offer)
Calculates the number oforder itemsavailable to be used as qualifiers for the providedOffer.- Parameters:
offer- the offer for which we are counting the number of possible qualifiers- Returns:
- the number of
orderLineItemsnot already exclusively used as targets or qualifiers
-
getFinalizedTotalWithAdjustments
public javax.money.MonetaryAmount getFinalizedTotalWithAdjustments()
Returns the final total for this item taking into account the finalized orderAdjustments. CallschooseSaleOrStandardPrice()to finalize the orderAdjustments before returning them.- Returns:
- the final total for this item taking into account the finalized orderAdjustments.
-
splitIfNecessary
@NonNull public Optional<LineItemOfferDetail> splitIfNecessary(@NonNull com.broadleafcommerce.common.extension.TypeFactory offerFactory)
Checks to see that the discount quantities match the target quantities. If not, splits this item into two.- Returns:
- the item created by splitting
-
calculateItemUnitPriceWithAdjustments
public javax.money.MonetaryAmount calculateItemUnitPriceWithAdjustments(boolean allowSalePrice)
- Parameters:
allowSalePrice- whether to use the sale price in the calculation- Returns:
- the price to be used for this priceDetail taking into account whether or not the sales price can be used.
-
chooseSaleOrStandardPrice
public void chooseSaleOrStandardPrice()
This method will check to see if the salePriceAdjustments or standardPriceAdjustments are better and remove those that should not apply.
-
buildDetailKey
@NonNull public String buildDetailKey()
- Returns:
- a key that represents a unique offer detail
-
getFinalTotalAdjustmentValue
public javax.money.MonetaryAmount getFinalTotalAdjustmentValue(javax.money.CurrencyUnit currency)
- Returns:
- the finalized adjustment value multiplied by the quantity
-
calculateTotalAdjustmentValue
public javax.money.MonetaryAmount calculateTotalAdjustmentValue(javax.money.CurrencyUnit currency, boolean useSaleAdjustments)
-
calculateAdjustmentValue
public javax.money.MonetaryAmount calculateAdjustmentValue(javax.money.CurrencyUnit currency, boolean useSaleAdjustments)
-
getFinalAdjustmentValue
public javax.money.MonetaryAmount getFinalAdjustmentValue(javax.money.CurrencyUnit currency)
-
isDiscountCurrentOrder
protected Predicate<ItemOfferAdjustment> isDiscountCurrentOrder()
-
getFinalAdjustmentValueIncludingFutureDiscounts
public javax.money.MonetaryAmount getFinalAdjustmentValueIncludingFutureDiscounts(javax.money.CurrencyUnit currency)
-
removeAllAdjustments
public void removeAllAdjustments()
Removes all orderAdjustments from this detail. Typically called when it has been determined that another "totalitarian" offer has been applied.
-
getQuantityOfItemsExclusivelyUsedAsTargets
protected int getQuantityOfItemsExclusivelyUsedAsTargets(CandidateItemOffer thisOffer, Set<OfferDiscount> offerDiscounts, boolean isForQualifierQty)
Calculates the number oforder itemsalready exclusively used as targets.For qualifiers, his will include:
- The number of items already used as targets by this offer
- The number of items already used as targets by another offer if
Offer.isQualifiersCanBeTargets()is false for this offer or the other
For targets, his will include:
- The number of items already used as targets by this offer
- The number of items already used as targets by another offer if
Offer#isTargetsCanBeTargets()is false for that offerr
- Parameters:
thisOffer- the offer for which we are counting the number of possible qualifiersofferDiscounts- theOfferDiscountDTOs containing information about items already used as targets- Returns:
- the number of
orderLineItemsnot already exclusively used as targets
-
getQuantityOfItemsExclusivelyUsedAsQualifiers
protected int getQuantityOfItemsExclusivelyUsedAsQualifiers(CandidateItemOffer thisOffer, Set<OfferQualifier> offerQualifiers, boolean isForQualifierQty)
Calculates the number oforder itemsalready exclusively used as qualifiers.For qualifiers, this will include:
- The number of items already used as qualifiers by this offer
- The number of items already used as qualifiers by another offer if
Offer.isQualifiersCanBeQualifiers()is false for this offer or the other offer
For targets, this will include:
- The number of items already used as qualifiers by this offer
- The number of items already used as qualifiers by another offer if
Offer.isQualifiersCanBeTargets()is false that offer
- Parameters:
thisOffer- the offer for which we are counting the number of possible qualifiersofferQualifiers- theOfferQualifierDTOs containing information about items already used as qualifiers- Returns:
- the number of
orderLineItemsalready exclusively used as qualifiers
-
hasOrderItemAdjustments
protected boolean hasOrderItemAdjustments()
-
chooseUnadjustedSaleOrStandardPrice
protected void chooseUnadjustedSaleOrStandardPrice()
-
calculateSaleAdjustmentUnitPrice
protected javax.money.MonetaryAmount calculateSaleAdjustmentUnitPrice()
-
calculateStandardAdjustmentUnitPrice
protected javax.money.MonetaryAmount calculateStandardAdjustmentUnitPrice()
-
getAdjustedTotalUsingSalePrice
protected javax.money.MonetaryAmount getAdjustedTotalUsingSalePrice(javax.money.MonetaryAmount standardAdjustmentPrice)
-
getAdjustedTotalUsingStandardPrice
protected javax.money.MonetaryAmount getAdjustedTotalUsingStandardPrice(javax.money.MonetaryAmount standardAdjustmentPrice)
-
removeStandardOnlyAdjustments
protected void removeStandardOnlyAdjustments()
-
removeZeroDollarAdjustments
protected void removeZeroDollarAdjustments(boolean useSalePrice)
-
finalizeAdjustments
protected void finalizeAdjustments(boolean useSaleAdjustments)
-
split
protected LineItemOfferDetail split(com.broadleafcommerce.common.extension.TypeFactory offerFactory, OfferDiscount offerDiscount)
Splits this item into twoLineItemOfferDetailsand returns the newly createdLineItemOfferDetail.- Parameters:
offerFactory- theTypeFactoryused to create a newOfferDiscountif neededofferDiscount- theOfferDiscountto split- Returns:
- the
LineItemOfferDetailcreated by splitting
-
split
@Deprecated protected LineItemOfferDetail split(com.broadleafcommerce.common.extension.TypeFactory offerFactory, int discountQty, String offerId, boolean hasQualifiers)
Deprecated.since 1.6, in favor ofsplit(TypeFactory, OfferDiscount).Splits this item into twoLineItemOfferDetailsand returns the newly createdLineItemOfferDetail.- Parameters:
offerFactory- theTypeFactoryused to create a newOfferDiscountif neededdiscountQty- the discount quantity to splitofferId- the offer id of theOfferDiscount.getOffer()hasQualifiers- whether or not theOfferDiscount.getOffer()has qualifiers- Returns:
- the
LineItemOfferDetailcreated by splitting
-
copyDiscountsAndAdjustmentsToNewDetail
protected void copyDiscountsAndAdjustmentsToNewDetail(com.broadleafcommerce.common.extension.TypeFactory offerFactory, int discountQty, LineItemOfferDetail newDetail)- Parameters:
offerFactory- theTypeFactoryused to create a newOfferDiscountif neededdiscountQty- quantity to split the discountnewDetail- the newLineItemOfferDetailto copy theOfferDiscountsandItemOfferAdjustmentsto
-
addNewQualifierAndGet
protected OfferQualifier addNewQualifierAndGet(com.broadleafcommerce.common.extension.TypeFactory offerFactory, CandidateItemOffer itemOffer)
-
lookupOfferQualifierByOffer
protected Optional<OfferQualifier> lookupOfferQualifierByOffer(CandidateItemOffer itemOffer)
-
getQtyAvailableToBeUsed
protected int getQtyAvailableToBeUsed(CandidateItemOffer offer, boolean isForQualifierQty)
Calculates the number oforder itemsnot already exclusively used as targets or qualifiers either by this offer or any other and, therefore, are available to be used as qualifiers or targets by the givenOffer.Items that are not available to be qualifiers will be:
- Items already used as targets by the given offer
- Items already used as qualifiers by the given offer
- Items already used as targets by another offer if
Offer.isQualifiersCanBeTargets()is false for the given offer - Items already used as qualifiers by another offer if
Offer.isQualifiersCanBeQualifiers()is false for the given offer or for the other offer
Items that are not available to be targets will be:
- Items already used as targets by the given offer
- Items already used as qualifiers by the given offer
- Items already used as targets by another offer if
Offer#isTargetsCanBeTargets()is false for the given offer - Items already used as qualifiers by another offer if
Offer.isQualifiersCanBeTargets()is false for the given offer or for the other offer
- Parameters:
offer- the offer for which we are counting the number of possible qualifiers and targetsisForQualifierQty- Whether this calculation is for qualifiers available or targets.- Returns:
- the number of
orderLineItemsnot already exclusively used as targets or qualifiers
-
addNewTargetAndGet
protected OfferDiscount addNewTargetAndGet(com.broadleafcommerce.common.extension.TypeFactory offerFactory, CandidateItemOffer itemOffer)
-
lookupOfferTargetByOffer
protected Optional<OfferDiscount> lookupOfferTargetByOffer(CandidateItemOffer itemOffer)
-
getFutureCreditValue
public javax.money.MonetaryAmount getFutureCreditValue(javax.money.CurrencyUnit currency)
-
getBundleRatioOr1
public double getBundleRatioOr1()
-
getLineItem
public EnhancedLineItem getLineItem()
TheEnhancedLineItemaffected byoffers.- Returns:
- The
EnhancedLineItemaffected byoffers.
-
getAdjustments
public Set<ItemOfferAdjustment> getAdjustments()
- Returns:
- The
ItemOfferAdjustmentscaused byofferstreating thelineItemas a target.
-
getProratedAdjustments
public Set<EnhancedProratedItemOfferAdjustment> getProratedAdjustments()
TheProratedItemOfferAdjustmentscaused byofferswithDiscount.getProrationType()orProrationType.TARGET_AND_QUALIFIERtreating bothlineItemas a target and the items that qualify it.- Returns:
- The
ProratedItemOfferAdjustmentscaused byofferswithDiscount.getProrationType()orProrationType.TARGET_AND_QUALIFIERtreating bothlineItemas a target and the items that qualify it.
-
getOfferDiscounts
public Set<OfferDiscount> getOfferDiscounts()
Additional info for all theofferstreating thelineItemas a target. Whileadjustmentsare the price orderAdjustments, offer discounts track whichOffer.getTargetItemCriteria()matched thelineItemand how many were matched.
-
getOfferQualifiers
public Set<OfferQualifier> getOfferQualifiers()
Additional information about theoffersusing thelineItemas item qualifiers. This includes the quantity used and and theOffer.getItemQualifierCriteria()an order item matched.
-
getQuantity
public int getQuantity()
The quantity of items related to this detail.- Returns:
- The quantity of items related to this detail.
-
isUseSaleAdjustments
public boolean isUseSaleAdjustments()
Whether to useEnhancedLineItem.getSalePrice()in price adjustment calculations. Default is false.- Returns:
- Whether to use
EnhancedLineItem.getSalePrice()in price adjustment calculations.
-
isAdjustmentsFinalized
public boolean isAdjustmentsFinalized()
Whether theadjustmentsare the orderAdjustments to actually use rather than being potential or incomplete.- Returns:
- Whether the
adjustmentsare the orderAdjustments to actually use rather than being potential or incomplete.
-
getAdjustedTotal
public javax.money.MonetaryAmount getAdjustedTotal()
The total value of alladjustmentstimes thequantityof this detail.- Returns:
- The total value of all
adjustmentstimes thequantityof this detail.
-
getBundleRatio
public double getBundleRatio()
The ratio of the offer discount to apply to this item. Used for bundle offers like buy 3 for a fixed price of $10.- Returns:
- The ratio of the offer discount to apply to this item
-
setLineItem
public void setLineItem(EnhancedLineItem lineItem)
TheEnhancedLineItemaffected byoffers.- Parameters:
item- TheEnhancedLineItemaffected byoffers.
-
setAdjustments
public void setAdjustments(Set<ItemOfferAdjustment> adjustments)
- Parameters:
orderAdjustments- TheItemOfferAdjustmentscaused byofferstreating thelineItemas a target.
-
setProratedAdjustments
public void setProratedAdjustments(Set<EnhancedProratedItemOfferAdjustment> proratedAdjustments)
TheProratedItemOfferAdjustmentscaused byofferswithDiscount.getProrationType()orProrationType.TARGET_AND_QUALIFIERtreating bothlineItemas a target and the items that qualify it.- Parameters:
proratedAdjustments- TheProratedItemOfferAdjustmentscaused byofferswithDiscount.getProrationType()orProrationType.TARGET_AND_QUALIFIERtreating bothlineItemas a target and the items that qualify it.
-
setOfferDiscounts
public void setOfferDiscounts(Set<OfferDiscount> offerDiscounts)
Additional info for all theofferstreating thelineItemas a target. Whileadjustmentsare the price orderAdjustments, offer discounts track whichOffer.getTargetItemCriteria()matched thelineItemand how many were matched.
-
setOfferQualifiers
public void setOfferQualifiers(Set<OfferQualifier> offerQualifiers)
Additional information about theoffersusing thelineItemas item qualifiers. This includes the quantity used and and theOffer.getItemQualifierCriteria()an order item matched.
-
setQuantity
public void setQuantity(int quantity)
The quantity of items related to this detail.- Parameters:
quantity- The quantity of items related to this detail.
-
setUseSaleAdjustments
public void setUseSaleAdjustments(boolean useSaleAdjustments)
Whether to useEnhancedLineItem.getSalePrice()in price adjustment calculations. Default is false.- Parameters:
useSaleAdjustments- Whether to useEnhancedLineItem.getSalePrice()in price adjustment calculations.
-
setAdjustmentsFinalized
public void setAdjustmentsFinalized(boolean adjustmentsFinalized)
Whether theadjustmentsare the orderAdjustments to actually use rather than being potential or incomplete.- Parameters:
adjustmentsFinalized- Whether theadjustmentsare the orderAdjustments to actually use rather than being potential or incomplete.
-
setAdjustedTotal
public void setAdjustedTotal(javax.money.MonetaryAmount adjustedTotal)
The total value of alladjustmentstimes thequantityof this detail.- Parameters:
adjustedTotal- The total value of alladjustmentstimes thequantityof this detail.
-
setBundleRatio
public void setBundleRatio(double bundleRatio)
The ratio of the offer discount to apply to this item. Used for bundle offers like buy 3 for a fixed price of $10.- Parameters:
bundleRatio- Fraction of the offer discount amount to use for this item detail
-
canEqual
protected boolean canEqual(Object other)
-
-