org.broadleafcommerce.core.offer.service.discount.domain
Interface PromotableOrderItem

All Superinterfaces:
Serializable
All Known Implementing Classes:
PromotableOrderItemImpl

public interface PromotableOrderItem
extends Serializable


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
 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.
 

Method Detail

updateRuleVariables

void updateRuleVariables(Map<String,Object> ruleVars)
Adds the item to the rule variables map.

Parameters:
ruleVars -

resetPriceDetails

void resetPriceDetails()
Called by pricing engine to reset the state of this item.


isDiscountingAllowed

boolean isDiscountingAllowed()
Returns true if this item can receive item level discounts.

Returns:

isOrderItemContainer

boolean isOrderItemContainer()
Returns true if this PromotableOrderItem contains other items


getOrderItemContainer

OrderItemContainer getOrderItemContainer()
Returns an OrderItemContainer for this OrderItem or null if this item is not an instance of OrderItemContainer.


getSalePriceBeforeAdjustments

Money getSalePriceBeforeAdjustments()
Returns the salePrice without adjustments


getRetailPriceBeforeAdjustments

Money getRetailPriceBeforeAdjustments()
Returns the retailPrice without adjustments


isOnSale

boolean isOnSale()
Returns true if the item has a sale price that is lower than the retail price.


getPromotableOrderItemPriceDetails

List<PromotableOrderItemPriceDetail> getPromotableOrderItemPriceDetails()
Returns the list of priceDetails associated with this item.

Returns:

getPriceBeforeAdjustments

Money getPriceBeforeAdjustments(boolean applyToSalePrice)
Return the salePriceBeforeAdjustments if the passed in param is true. Otherwise return the retailPriceBeforeAdjustments.

Returns:

getCurrentBasePrice

Money getCurrentBasePrice()
Returns the basePrice of the item (baseSalePrice or baseRetailPrice)

Returns:

getQuantity

int getQuantity()
Returns the quantity for this orderItem

Returns:

getCurrency

BroadleafCurrency getCurrency()
Returns the currency of the related order.

Returns:

removeAllItemAdjustments

void removeAllItemAdjustments()
Effectively deletes all priceDetails associated with this item and r


mergeLikeDetails

void mergeLikeDetails()
Merges any priceDetails that share the same adjustments.


getOrderItemId

Long getOrderItemId()
Returns the id of the contained OrderItem


calculateTotalAdjustmentValue

Money calculateTotalAdjustmentValue()
Returns the value of all adjustments.


calculateTotalWithAdjustments

Money calculateTotalWithAdjustments()
Returns the final total for this item taking into account the finalized adjustments. Intended to be called after the adjustments have been finalized.


calculateTotalWithoutAdjustments

Money calculateTotalWithoutAdjustments()
Returns the total for this item if not adjustments applied.


createNewDetail

PromotableOrderItemPriceDetail createNewDetail(int quantity)
Creates a new detail with the associated quantity. Intended for use as part of the PriceDetail split.

Parameters:
quantity -
Returns:

getOrderItem

OrderItem getOrderItem()
Returns the underlying orderItem. Manipulation of the underlying orderItem is not recommended. This method is intended for unit test and read only access although that is not strictly enforced.

Returns:


Copyright © 2013. All Rights Reserved.