|
||||||||||
| 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.PromotableOrderItemImpl
public class PromotableOrderItemImpl
| Field Summary | |
|---|---|
protected boolean |
includeAdjustments
|
protected PromotableItemFactory |
itemFactory
|
protected List<PromotableOrderItemPriceDetail> |
itemPriceDetails
|
protected OrderItem |
orderItem
|
protected PromotableOrder |
promotableOrder
|
| Constructor Summary | |
|---|---|
PromotableOrderItemImpl(OrderItem orderItem,
PromotableOrder promotableOrder,
PromotableItemFactory itemFactory,
boolean includeAdjustments)
|
|
| Method Summary | |
|---|---|
Money |
calculateTotalAdjustmentValue()
Returns the value of all adjustments. |
Money |
calculateTotalWithAdjustments()
Returns the final total for this item taking into account the finalized adjustments. |
Money |
calculateTotalWithoutAdjustments()
Returns the total for this item if not adjustments applied. |
PromotableOrderItemPriceDetail |
createNewDetail(int quantity)
Creates a new detail with the associated quantity. |
BroadleafCurrency |
getCurrency()
Returns the currency of the related order. |
Money |
getCurrentBasePrice()
Returns the basePrice of the item (baseSalePrice or baseRetailPrice) |
OrderItem |
getOrderItem()
Returns the underlying orderItem. |
OrderItemContainer |
getOrderItemContainer()
Returns an OrderItemContainer for this OrderItem or null if this item is not an instance of OrderItemContainer. |
Long |
getOrderItemId()
Returns the id of the contained OrderItem |
Money |
getPriceBeforeAdjustments(boolean applyToSalePrice)
Return the salePriceBeforeAdjustments if the passed in param is true. |
List<PromotableOrderItemPriceDetail> |
getPromotableOrderItemPriceDetails()
Returns the list of priceDetails associated with this item. |
int |
getQuantity()
Returns the quantity for this orderItem |
Money |
getRetailPriceBeforeAdjustments()
Returns the retailPrice without adjustments |
Money |
getSalePriceBeforeAdjustments()
Returns the salePrice without adjustments |
boolean |
isDiscountingAllowed()
Returns true if this item can receive item level discounts. |
boolean |
isOnSale()
Returns true if the item has a sale price that is lower than the retail price. |
boolean |
isOrderItemContainer()
Returns true if this PromotableOrderItem contains other items |
protected void |
mergeDetails(PromotableOrderItemPriceDetail firstDetail,
PromotableOrderItemPriceDetail secondDetail)
|
void |
mergeLikeDetails()
Merges any priceDetails that share the same adjustments. |
void |
removeAllItemAdjustments()
Effectively deletes all priceDetails associated with this item and r |
void |
resetPriceDetails()
Called by pricing engine to reset the state of this item. |
void |
updateRuleVariables(Map<String,Object> ruleVars)
Adds the item to the rule variables map. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PromotableOrder promotableOrder
protected OrderItem orderItem
protected PromotableItemFactory itemFactory
protected List<PromotableOrderItemPriceDetail> itemPriceDetails
protected boolean includeAdjustments
| Constructor Detail |
|---|
public PromotableOrderItemImpl(OrderItem orderItem,
PromotableOrder promotableOrder,
PromotableItemFactory itemFactory,
boolean includeAdjustments)
| Method Detail |
|---|
public void resetPriceDetails()
PromotableOrderItem
resetPriceDetails in interface PromotableOrderItempublic void updateRuleVariables(Map<String,Object> ruleVars)
updateRuleVariables in interface PromotableOrderItemruleVars - public boolean isDiscountingAllowed()
PromotableOrderItem
isDiscountingAllowed in interface PromotableOrderItempublic boolean isOrderItemContainer()
PromotableOrderItem
isOrderItemContainer in interface PromotableOrderItempublic OrderItemContainer getOrderItemContainer()
PromotableOrderItem
getOrderItemContainer in interface PromotableOrderItempublic List<PromotableOrderItemPriceDetail> getPromotableOrderItemPriceDetails()
PromotableOrderItem
getPromotableOrderItemPriceDetails in interface PromotableOrderItempublic Money getSalePriceBeforeAdjustments()
PromotableOrderItem
getSalePriceBeforeAdjustments in interface PromotableOrderItempublic Money getRetailPriceBeforeAdjustments()
PromotableOrderItem
getRetailPriceBeforeAdjustments in interface PromotableOrderItempublic Money getPriceBeforeAdjustments(boolean applyToSalePrice)
PromotableOrderItem
getPriceBeforeAdjustments in interface PromotableOrderItempublic Money getCurrentBasePrice()
PromotableOrderItem
getCurrentBasePrice in interface PromotableOrderItempublic int getQuantity()
PromotableOrderItem
getQuantity in interface PromotableOrderItempublic boolean isOnSale()
PromotableOrderItem
isOnSale in interface PromotableOrderItempublic BroadleafCurrency getCurrency()
PromotableOrderItem
getCurrency in interface PromotableOrderItempublic void removeAllItemAdjustments()
PromotableOrderItem
removeAllItemAdjustments in interface PromotableOrderItem
protected void mergeDetails(PromotableOrderItemPriceDetail firstDetail,
PromotableOrderItemPriceDetail secondDetail)
public void mergeLikeDetails()
PromotableOrderItem
mergeLikeDetails in interface PromotableOrderItempublic Long getOrderItemId()
PromotableOrderItem
getOrderItemId in interface PromotableOrderItempublic Money calculateTotalWithAdjustments()
PromotableOrderItem
calculateTotalWithAdjustments in interface PromotableOrderItempublic Money calculateTotalWithoutAdjustments()
PromotableOrderItem
calculateTotalWithoutAdjustments in interface PromotableOrderItempublic Money calculateTotalAdjustmentValue()
PromotableOrderItem
calculateTotalAdjustmentValue in interface PromotableOrderItempublic PromotableOrderItemPriceDetail createNewDetail(int quantity)
PromotableOrderItem
createNewDetail in interface PromotableOrderItempublic OrderItem getOrderItem()
PromotableOrderItem
getOrderItem in interface PromotableOrderItem
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||