Interface PromotableOrderItemPriceDetail
- All Known Implementing Classes:
PromotableOrderItemPriceDetailImpl,PromotableOrderItemPriceDetailWrapper
public interface PromotableOrderItemPriceDetail
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the adjustment to the item's adjustment list and discounts the item's prices by the value of the adjustment.voidaddPromotionDiscount(PromotableCandidateItemOffer itemOffer, OfferItemCriteria itemCriteria, int qtyToMarkAsTarget) Adds a promotionDiscount entry to this itemDetail.addPromotionQualifier(PromotableCandidateItemOffer itemOffer, OfferItemCriteria itemCriteria, int qtyToMarkAsQualifier) Adds a promotionQualifier entry to this itemDetail.Creates a key that represents a unique priceDetailorg.broadleafcommerce.common.money.MoneycalculateItemUnitPriceWithAdjustments(boolean allowSalePrice) Returns the price to be used for this priceDetail taking into account whether or not the sales price can be used.org.broadleafcommerce.common.money.MoneyReturns the total adjustment value as the sum of the adjustments times the quantity represented by this PriceDetailvoidThis method will check to see if the salePriceAdjustments or retailPriceAdjustments are better and remove those that should not apply.voidClears target and qualifier quantities that were marked for a promotion that did not have enough qualifiers or targets to get applied.Copies thePromotableOrderItemPriceDetailwith all Finalized Qualifiers, Discounts, and AdjustmentsvoidUpdates the target and qualifier quantities to indicate the number that are being used.org.broadleafcommerce.common.money.MoneyReturns the final total for this item taking into account the finalized adjustments.Return the parent promotableOrderItemReturns the promotion discounts applied to this detail object.Returns the times this item is being used as a promotionQualifierintReturns the quantity associated with this priceDetail.intReturns the quantity of this item that can be used as a qualifier for the passed in itemOfferintReturns the quantity of this item that can be used as a target for the passed in itemOfferbooleanReturns true if this detail has nonCombinable adjustments.booleanbooleanReturns true if a non-combinable offer has been applied to this item.booleanReturns true if a notCombinableOffer or totalitarian offer was applied to this priceDetail.voidRemoves all adjustments from this detail.voidsetAdjustmentsFinalized(boolean adjustmentsFinalized) voidsetQuantity(int quantity) Sets the quantity for this price detail.Copies thePromotableOrderItemPriceDetailwithout Qualifiers, Discounts, or AdjustmentsChecks to see that the discount quantities match the target quantities.booleanReturns true if the sale adjustments should be used.
-
Method Details
-
addCandidateItemPriceDetailAdjustment
Adds the adjustment to the item's adjustment list and discounts the item's prices by the value of the adjustment.- Parameters:
itemAdjustment-
-
getCandidateItemAdjustments
List<PromotableOrderItemPriceDetailAdjustment> getCandidateItemAdjustments()- Returns:
-
hasNonCombinableAdjustments
boolean hasNonCombinableAdjustments()Returns true if this detail has nonCombinable adjustments. Used primarily with legacy offers (prior to 2.0)- Returns:
-
isTotalitarianOfferApplied
boolean isTotalitarianOfferApplied()Returns true if a notCombinableOffer or totalitarian offer was applied to this priceDetail.- Returns:
-
isNonCombinableOfferApplied
boolean isNonCombinableOfferApplied()Returns true if a non-combinable offer has been applied to this item. -
chooseSaleOrRetailAdjustments
void chooseSaleOrRetailAdjustments()This method will check to see if the salePriceAdjustments or retailPriceAdjustments are better and remove those that should not apply. -
removeAllAdjustments
void removeAllAdjustments()Removes all adjustments from this detail. Typically called when it has been determined that another "totalitarian" offer has been applied. -
getPromotionDiscounts
List<PromotionDiscount> getPromotionDiscounts()Returns the promotion discounts applied to this detail object.- Returns:
-
getPromotionQualifiers
List<PromotionQualifier> getPromotionQualifiers()Returns the times this item is being used as a promotionQualifier- Returns:
-
getQuantity
int getQuantity()Returns the quantity associated with this priceDetail.- Returns:
-
setQuantity
void setQuantity(int quantity) Sets the quantity for this price detail.- Parameters:
quantity-
-
getPromotableOrderItem
PromotableOrderItem getPromotableOrderItem()Return the parent promotableOrderItem -
getQuantityAvailableToBeUsedAsQualifier
Returns the quantity of this item that can be used as a qualifier for the passed in itemOffer- Parameters:
itemOffer-- Returns:
-
getQuantityAvailableToBeUsedAsTarget
Returns the quantity of this item that can be used as a target for the passed in itemOffer- Parameters:
itemOffer-- Returns:
-
addPromotionQualifier
PromotionQualifier addPromotionQualifier(PromotableCandidateItemOffer itemOffer, OfferItemCriteria itemCriteria, int qtyToMarkAsQualifier) Adds a promotionQualifier entry to this itemDetail. PromotionQualifiers record the fact that this item has been marked to be used as a qualifier for other items to receive a discount.If other conditions are met this qualifier will be finalized.
- Parameters:
itemOffer-itemCriteria-qtyToMarkAsQualifier-- Returns:
-
addPromotionDiscount
void addPromotionDiscount(PromotableCandidateItemOffer itemOffer, OfferItemCriteria itemCriteria, int qtyToMarkAsTarget) Adds a promotionDiscount entry to this itemDetail. PromotionDiscounts record the fact that this item has been targeted to receive a discount. If other conditions are met this discount will be finalized so that it can then be set on the underlying orderItem.- Parameters:
itemOffer-itemCriteria-qtyToMarkAsTarget-
-
calculateItemUnitPriceWithAdjustments
org.broadleafcommerce.common.money.Money calculateItemUnitPriceWithAdjustments(boolean allowSalePrice) Returns the price to be used for this priceDetail taking into account whether or not the sales price can be used.- Parameters:
allowSalePrice-- Returns:
-
finalizeQuantities
void finalizeQuantities()Updates the target and qualifier quantities to indicate the number that are being used. -
clearAllNonFinalizedQuantities
void clearAllNonFinalizedQuantities()Clears target and qualifier quantities that were marked for a promotion that did not have enough qualifiers or targets to get applied. -
buildDetailKey
String buildDetailKey()Creates a key that represents a unique priceDetail- Returns:
-
getFinalizedTotalWithAdjustments
org.broadleafcommerce.common.money.Money getFinalizedTotalWithAdjustments()Returns the final total for this item taking into account the finalized adjustments. Intended to be called after the adjustments have been finalized with a callchooseSaleOrRetailAdjustments(). -
calculateTotalAdjustmentValue
org.broadleafcommerce.common.money.Money calculateTotalAdjustmentValue()Returns the total adjustment value as the sum of the adjustments times the quantity represented by this PriceDetail- Returns:
-
splitIfNecessary
PromotableOrderItemPriceDetail splitIfNecessary()Checks to see that the discount quantities match the target quantities. If not, splits this item into two.- Returns:
-
useSaleAdjustments
boolean useSaleAdjustments()Returns true if the sale adjustments should be used.- Returns:
-
isAdjustmentsFinalized
boolean isAdjustmentsFinalized() -
setAdjustmentsFinalized
void setAdjustmentsFinalized(boolean adjustmentsFinalized) -
shallowCopy
PromotableOrderItemPriceDetail shallowCopy()Copies thePromotableOrderItemPriceDetailwithout Qualifiers, Discounts, or Adjustments- Returns:
-
copyWithFinalizedData
PromotableOrderItemPriceDetail copyWithFinalizedData()Copies thePromotableOrderItemPriceDetailwith all Finalized Qualifiers, Discounts, and Adjustments- Returns:
-