|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.core.offer.service.discount.domain.PromotableOrderItemPriceDetailImpl
public class PromotableOrderItemPriceDetailImpl
| Field Summary | |
|---|---|
protected Money |
adjustedTotal
|
protected boolean |
adjustmentsFinalized
|
protected PromotableOrderItem |
promotableOrderItem
|
protected List<PromotableOrderItemPriceDetailAdjustment> |
promotableOrderItemPriceDetailAdjustments
|
protected List<PromotionDiscount> |
promotionDiscounts
|
protected List<PromotionQualifier> |
promotionQualifiers
|
protected int |
quantity
|
protected boolean |
useSaleAdjustments
|
| Constructor Summary | |
|---|---|
PromotableOrderItemPriceDetailImpl(PromotableOrderItem promotableOrderItem,
int quantity)
|
|
| Method Summary | |
|---|---|
void |
addCandidateItemPriceDetailAdjustment(PromotableOrderItemPriceDetailAdjustment itemAdjustment)
Adds the adjustment to the item's adjustment list and discounts the item's prices by the value of the adjustment. |
void |
addPromotionDiscount(PromotableCandidateItemOffer itemOffer,
Set<OfferItemCriteria> itemCriteria,
int qtyToMarkAsTarget)
Adds a promotionDiscount entry to this itemDetail. |
void |
addPromotionQualifier(PromotableCandidateItemOffer itemOffer,
OfferItemCriteria itemCriteria,
int qtyToMarkAsQualifier)
Adds a promotionQualifier entry to this itemDetail. |
String |
buildDetailKey()
Creates a key that represents a unique priceDetail |
protected Money |
calculateAdjustmentsUnitValue()
|
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. |
Money |
calculateRetailAdjustmentUnitPrice()
|
Money |
calculateSaleAdjustmentUnitPrice()
|
Money |
calculateTotalAdjustmentValue()
Returns the total adjustment value as the sum of the adjustments times the quantity represented by this PriceDetail |
void |
chooseSaleOrRetailAdjustments()
This method will check to see if the salePriceAdjustments or retailPriceAdjustments are better and remove those that should not apply. |
void |
clearAllNonFinalizedQuantities()
Clears target and qualifier quantities that were marked for a promotion that did not have enough qualifiers or targets to get applied. |
protected void |
finalizeAdjustments(boolean useSaleAdjustments)
|
void |
finalizeQuantities()
Updates the target and qualifier quantities to indicate the number that are being used. |
List<PromotableOrderItemPriceDetailAdjustment> |
getCandidateItemAdjustments()
|
Money |
getFinalizedTotalWithAdjustments()
Returns the final total for this item taking into account the finalized adjustments. |
PromotableOrderItem |
getPromotableOrderItem()
Return the parent promotableOrderItem |
List<PromotionDiscount> |
getPromotionDiscounts()
Returns the promotion discounts applied to this detail object. |
List<PromotionQualifier> |
getPromotionQualifiers()
Returns the times this item is being used as a promotionQualifier |
int |
getQuantity()
Returns the quantity associated with this priceDetail. |
int |
getQuantityAvailableToBeUsedAsQualifier(PromotableCandidateItemOffer itemOffer)
Returns the quantity of this item that can be used as a qualifier for the passed in itemOffer |
int |
getQuantityAvailableToBeUsedAsTarget(PromotableCandidateItemOffer itemOffer)
Returns the quantity of this item that can be used as a target for the passed in itemOffer |
boolean |
hasNonCombinableAdjustments()
Returns true if this detail has nonCombinable adjustments. |
protected boolean |
hasOrderItemAdjustments()
|
boolean |
isNonCombinableOfferApplied()
Returns true if a non-combinable offer has been applied to this item. |
boolean |
isTotalitarianOfferApplied()
Returns true if a notCombinableOffer or totalitarian offer was applied to this priceDetail. |
PromotionDiscount |
lookupOrCreatePromotionDiscount(PromotableCandidateItemOffer candidatePromotion)
|
PromotionQualifier |
lookupOrCreatePromotionQualifier(PromotableCandidateItemOffer candidatePromotion)
|
void |
removeAllAdjustments()
Removes all adjustments from this detail. |
protected void |
removeRetailOnlyAdjustments()
Removes retail only adjustments. |
protected void |
removeZeroDollarAdjustments(boolean useSalePrice)
If removeUnusedAdjustments is s |
void |
setQuantity(int quantity)
Sets the quantity for this price detail. |
protected PromotableOrderItemPriceDetail |
split(int discountQty,
Long offerId)
|
PromotableOrderItemPriceDetail |
splitIfNecessary()
Checks to see that the discount quantities match the target quantities. |
boolean |
useSaleAdjustments()
Returns true if the sale adjustments should be used. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PromotableOrderItem promotableOrderItem
protected List<PromotableOrderItemPriceDetailAdjustment> promotableOrderItemPriceDetailAdjustments
protected List<PromotionDiscount> promotionDiscounts
protected List<PromotionQualifier> promotionQualifiers
protected int quantity
protected boolean useSaleAdjustments
protected boolean adjustmentsFinalized
protected Money adjustedTotal
| Constructor Detail |
|---|
public PromotableOrderItemPriceDetailImpl(PromotableOrderItem promotableOrderItem,
int quantity)
| Method Detail |
|---|
public void addCandidateItemPriceDetailAdjustment(PromotableOrderItemPriceDetailAdjustment itemAdjustment)
PromotableOrderItemPriceDetail
addCandidateItemPriceDetailAdjustment in interface PromotableOrderItemPriceDetailpublic List<PromotableOrderItemPriceDetailAdjustment> getCandidateItemAdjustments()
getCandidateItemAdjustments in interface PromotableOrderItemPriceDetailpublic boolean hasNonCombinableAdjustments()
PromotableOrderItemPriceDetail
hasNonCombinableAdjustments in interface PromotableOrderItemPriceDetailprotected boolean hasOrderItemAdjustments()
public boolean isTotalitarianOfferApplied()
PromotableOrderItemPriceDetail
isTotalitarianOfferApplied in interface PromotableOrderItemPriceDetailpublic boolean isNonCombinableOfferApplied()
PromotableOrderItemPriceDetail
isNonCombinableOfferApplied in interface PromotableOrderItemPriceDetailpublic Money calculateSaleAdjustmentUnitPrice()
public Money calculateRetailAdjustmentUnitPrice()
public void chooseSaleOrRetailAdjustments()
chooseSaleOrRetailAdjustments in interface PromotableOrderItemPriceDetailpublic void removeAllAdjustments()
PromotableOrderItemPriceDetail
removeAllAdjustments in interface PromotableOrderItemPriceDetailprotected void finalizeAdjustments(boolean useSaleAdjustments)
protected void removeRetailOnlyAdjustments()
protected void removeZeroDollarAdjustments(boolean useSalePrice)
useSaleAdjustments - public PromotableOrderItem getPromotableOrderItem()
PromotableOrderItemPriceDetail
getPromotableOrderItem in interface PromotableOrderItemPriceDetailpublic List<PromotionDiscount> getPromotionDiscounts()
PromotableOrderItemPriceDetail
getPromotionDiscounts in interface PromotableOrderItemPriceDetailpublic List<PromotionQualifier> getPromotionQualifiers()
PromotableOrderItemPriceDetail
getPromotionQualifiers in interface PromotableOrderItemPriceDetailpublic int getQuantity()
PromotableOrderItemPriceDetail
getQuantity in interface PromotableOrderItemPriceDetailpublic void setQuantity(int quantity)
PromotableOrderItemPriceDetail
setQuantity in interface PromotableOrderItemPriceDetailpublic int getQuantityAvailableToBeUsedAsTarget(PromotableCandidateItemOffer itemOffer)
PromotableOrderItemPriceDetail
getQuantityAvailableToBeUsedAsTarget in interface PromotableOrderItemPriceDetailpublic PromotionQualifier lookupOrCreatePromotionQualifier(PromotableCandidateItemOffer candidatePromotion)
public PromotionDiscount lookupOrCreatePromotionDiscount(PromotableCandidateItemOffer candidatePromotion)
public void addPromotionQualifier(PromotableCandidateItemOffer itemOffer,
OfferItemCriteria itemCriteria,
int qtyToMarkAsQualifier)
PromotableOrderItemPriceDetail
addPromotionQualifier in interface PromotableOrderItemPriceDetail
public void addPromotionDiscount(PromotableCandidateItemOffer itemOffer,
Set<OfferItemCriteria> itemCriteria,
int qtyToMarkAsTarget)
PromotableOrderItemPriceDetail
addPromotionDiscount in interface PromotableOrderItemPriceDetailpublic void finalizeQuantities()
PromotableOrderItemPriceDetail
finalizeQuantities in interface PromotableOrderItemPriceDetailpublic void clearAllNonFinalizedQuantities()
PromotableOrderItemPriceDetail
clearAllNonFinalizedQuantities in interface PromotableOrderItemPriceDetailpublic int getQuantityAvailableToBeUsedAsQualifier(PromotableCandidateItemOffer itemOffer)
PromotableOrderItemPriceDetail
getQuantityAvailableToBeUsedAsQualifier in interface PromotableOrderItemPriceDetailpublic Money calculateItemUnitPriceWithAdjustments(boolean allowSalePrice)
PromotableOrderItemPriceDetail
calculateItemUnitPriceWithAdjustments in interface PromotableOrderItemPriceDetailprotected Money calculateAdjustmentsUnitValue()
public String buildDetailKey()
buildDetailKey in interface PromotableOrderItemPriceDetailpublic Money getFinalizedTotalWithAdjustments()
PromotableOrderItemPriceDetailPromotableOrderItemPriceDetail.chooseSaleOrRetailAdjustments().
getFinalizedTotalWithAdjustments in interface PromotableOrderItemPriceDetailpublic Money calculateTotalAdjustmentValue()
PromotableOrderItemPriceDetail
calculateTotalAdjustmentValue in interface PromotableOrderItemPriceDetail
protected PromotableOrderItemPriceDetail split(int discountQty,
Long offerId)
public PromotableOrderItemPriceDetail splitIfNecessary()
PromotableOrderItemPriceDetail
splitIfNecessary in interface PromotableOrderItemPriceDetailpublic boolean useSaleAdjustments()
PromotableOrderItemPriceDetail
useSaleAdjustments in interface PromotableOrderItemPriceDetail
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||