org.broadleafcommerce.core.offer.service.discount.domain
Class PromotableOrderItemImpl
java.lang.Object
org.broadleafcommerce.core.offer.service.discount.domain.PromotableOrderItemImpl
- All Implemented Interfaces:
- PromotableOrderItem
public class PromotableOrderItemImpl
- extends Object
- implements PromotableOrderItem
retailAdjustmentPrice
protected BigDecimal retailAdjustmentPrice
saleAdjustmentPrice
protected BigDecimal saleAdjustmentPrice
promotionDiscounts
protected List<PromotionDiscount> promotionDiscounts
promotionQualifiers
protected List<PromotionQualifier> promotionQualifiers
delegate
protected DiscreteOrderItem delegate
order
protected PromotableOrder order
itemFactory
protected PromotableItemFactory itemFactory
PromotableOrderItemImpl
public PromotableOrderItemImpl(DiscreteOrderItem orderItem,
PromotableOrder order,
PromotableItemFactory itemFactory)
getDelegate
public DiscreteOrderItem getDelegate()
- Specified by:
getDelegate in interface PromotableOrderItem
setDelegate
public void setDelegate(DiscreteOrderItem discreteOrderItem)
- Specified by:
setDelegate in interface PromotableOrderItem
reset
public void reset()
- Specified by:
reset in interface PromotableOrderItem
assignFinalPrice
public void assignFinalPrice()
- Specified by:
assignFinalPrice in interface PromotableOrderItem
getCurrentPrice
public Money getCurrentPrice()
- Specified by:
getCurrentPrice in interface PromotableOrderItem
computeAdjustmentPrice
public void computeAdjustmentPrice()
- Specified by:
computeAdjustmentPrice in interface PromotableOrderItem
resetAdjustmentPrice
public void resetAdjustmentPrice()
- Specified by:
resetAdjustmentPrice in interface PromotableOrderItem
addOrderItemAdjustment
public void addOrderItemAdjustment(PromotableOrderItemAdjustment orderItemAdjustment)
- Description copied from interface:
PromotableOrderItem
- Adds the adjustment to the order item's adjustment list and discounts the
order item's adjustment price by the value of the adjustment.
- Specified by:
addOrderItemAdjustment in interface PromotableOrderItem
removeAllAdjustments
public int removeAllAdjustments()
- Specified by:
removeAllAdjustments in interface PromotableOrderItem
getRetailAdjustmentPrice
public Money getRetailAdjustmentPrice()
- Description copied from interface:
PromotableOrderItem
- The price after discounts if all applicable discounts are applied
to the retail price.
- Specified by:
getRetailAdjustmentPrice in interface PromotableOrderItem
- Returns:
setRetailAdjustmentPrice
public void setRetailAdjustmentPrice(Money retailAdjustmentPrice)
- Specified by:
setRetailAdjustmentPrice in interface PromotableOrderItem
getSaleAdjustmentPrice
public Money getSaleAdjustmentPrice()
- Description copied from interface:
PromotableOrderItem
- The price after discounts if all applicable discounts are applied
to the sale price.
- Specified by:
getSaleAdjustmentPrice in interface PromotableOrderItem
setSaleAdjustmentPrice
public void setSaleAdjustmentPrice(Money saleAdjustmentPrice)
- Specified by:
setSaleAdjustmentPrice in interface PromotableOrderItem
isNotCombinableOfferApplied
public boolean isNotCombinableOfferApplied()
- Specified by:
isNotCombinableOfferApplied in interface PromotableOrderItem
isHasOrderItemAdjustments
public boolean isHasOrderItemAdjustments()
- Specified by:
isHasOrderItemAdjustments in interface PromotableOrderItem
getPromotionDiscounts
public List<PromotionDiscount> getPromotionDiscounts()
- Specified by:
getPromotionDiscounts in interface PromotableOrderItem
setPromotionDiscounts
public void setPromotionDiscounts(List<PromotionDiscount> promotionDiscounts)
- Specified by:
setPromotionDiscounts in interface PromotableOrderItem
getPromotionQualifiers
public List<PromotionQualifier> getPromotionQualifiers()
- Specified by:
getPromotionQualifiers in interface PromotableOrderItem
setPromotionQualifiers
public void setPromotionQualifiers(List<PromotionQualifier> promotionQualifiers)
- Specified by:
setPromotionQualifiers in interface PromotableOrderItem
getQuantityAvailableToBeUsedAsQualifier
public int getQuantityAvailableToBeUsedAsQualifier(Offer promotion)
- Specified by:
getQuantityAvailableToBeUsedAsQualifier in interface PromotableOrderItem
getQuantityAvailableToBeUsedAsTarget
public int getQuantityAvailableToBeUsedAsTarget(Offer promotion)
- Specified by:
getQuantityAvailableToBeUsedAsTarget in interface PromotableOrderItem
addPromotionQualifier
public void addPromotionQualifier(PromotableCandidateItemOffer candidatePromotion,
OfferItemCriteria itemCriteria,
int quantity)
- Specified by:
addPromotionQualifier in interface PromotableOrderItem
addPromotionDiscount
public void addPromotionDiscount(PromotableCandidateItemOffer candidatePromotion,
Set<OfferItemCriteria> itemCriteria,
int quantity)
- Specified by:
addPromotionDiscount in interface PromotableOrderItem
lookupOrCreatePromotionQualifier
public PromotionQualifier lookupOrCreatePromotionQualifier(PromotableCandidateItemOffer candidatePromotion)
- Specified by:
lookupOrCreatePromotionQualifier in interface PromotableOrderItem
lookupOrCreatePromotionDiscount
public PromotionDiscount lookupOrCreatePromotionDiscount(PromotableCandidateItemOffer candidatePromotion)
- Specified by:
lookupOrCreatePromotionDiscount in interface PromotableOrderItem
clearAllNonFinalizedQuantities
public void clearAllNonFinalizedQuantities()
- Specified by:
clearAllNonFinalizedQuantities in interface PromotableOrderItem
clearAllDiscount
public void clearAllDiscount()
- Specified by:
clearAllDiscount in interface PromotableOrderItem
clearAllQualifiers
public void clearAllQualifiers()
- Specified by:
clearAllQualifiers in interface PromotableOrderItem
clearAllNonFinalizedDiscounts
public void clearAllNonFinalizedDiscounts()
- Specified by:
clearAllNonFinalizedDiscounts in interface PromotableOrderItem
clearAllNonFinalizedQualifiers
public void clearAllNonFinalizedQualifiers()
- Specified by:
clearAllNonFinalizedQualifiers in interface PromotableOrderItem
finalizeQuantities
public void finalizeQuantities()
- Specified by:
finalizeQuantities in interface PromotableOrderItem
getPromotionDiscountMismatchQuantity
public int getPromotionDiscountMismatchQuantity()
- Specified by:
getPromotionDiscountMismatchQuantity in interface PromotableOrderItem
split
public List<PromotableOrderItem> split()
- Specified by:
split in interface PromotableOrderItem
getQuantity
public int getQuantity()
- Specified by:
getQuantity in interface PromotableOrderItem
setQuantity
public void setQuantity(int quantity)
- Specified by:
setQuantity in interface PromotableOrderItem
getSku
public Sku getSku()
- Specified by:
getSku in interface PromotableOrderItem
getPriceBeforeAdjustments
public Money getPriceBeforeAdjustments(boolean allowSalesPrice)
- Specified by:
getPriceBeforeAdjustments in interface PromotableOrderItem
getSalePrice
public Money getSalePrice()
- Specified by:
getSalePrice in interface PromotableOrderItem
getRetailPrice
public Money getRetailPrice()
- Specified by:
getRetailPrice in interface PromotableOrderItem
addCandidateItemOffer
public void addCandidateItemOffer(PromotableCandidateItemOffer candidateItemOffer)
- Specified by:
addCandidateItemOffer in interface PromotableOrderItem
getSplitParentItemId
public Long getSplitParentItemId()
- Description copied from interface:
PromotableOrderItem
- If the system automatically split an item to accommodate the promotion logic (e.g. buy one get one free),
then this value is set to the originalItemId.
Returns null otherwise.
- Specified by:
getSplitParentItemId in interface PromotableOrderItem
- Returns:
setSplitParentItemId
public void setSplitParentItemId(Long id)
- Specified by:
setSplitParentItemId in interface PromotableOrderItem
clone
public PromotableOrderItem clone()
- Specified by:
clone in interface PromotableOrderItem- Overrides:
clone in class Object
fixAdjustments
public int fixAdjustments(boolean useSaleAdjustments)
- Removes all zero based adjustments and sets the adjusted price on the delegate.
For remaining adjustments sets the value to the retail or sale price.
- Specified by:
fixAdjustments in interface PromotableOrderItem
- Parameters:
useSaleAdjustments -
- Returns:
Copyright © 2013. All Rights Reserved.