Class PromotableOrderImpl
java.lang.Object
org.broadleafcommerce.core.offer.service.discount.domain.PromotableOrderImpl
- All Implemented Interfaces:
Serializable,PromotableOrder
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<PromotableOrderItem>protected List<PromotableOrderAdjustment>protected booleanprotected List<PromotableOrderItem>protected List<PromotableFulfillmentGroup>protected booleanprotected PromotableItemFactoryprotected Order -
Constructor Summary
ConstructorsConstructorDescriptionPromotableOrderImpl(Order order, PromotableItemFactory itemFactory, boolean includeOrderAndItemAdjustments) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCandidateOrderAdjustment(PromotableOrderAdjustment orderAdjustment) Adds the adjustment to the order's adjustment list and discounts the order's adjustment price by the value of the adjustment.protected voidaddPromotableOrderItem(OrderItem orderItem, List<PromotableOrderItem> discountableOrderItems) protected List<PromotableOrderItem>org.broadleafcommerce.common.money.MoneyCalculates the total adjustment to be received from the item adjustments.org.broadleafcommerce.common.money.MoneyCalculates the total adjustment to be received from the order adjustments.org.broadleafcommerce.common.money.MoneyReturns the price of the order with adjustments.org.broadleafcommerce.common.money.MoneyReturns the price of the order without adjustments.booleanReturns true if this order can apply another order promotion.protected voidBring over the order adjustments.Returns all OrderItems for the order wrapped with PromotableOrderItemReturns all of the price detail items for this order.Returns the list of orderAdjustments being proposed for the order.Returns all OrderItems that can receive discounts.getDiscountableOrderItems(boolean applyDiscountToSalePrice) Returns all OrderItems that can receive discounts.Map available to implementations to store data needed for custom logic.Returns the fulfillmentGroups associated with the order after converting them to promotableFulfillmentGroups.getOrder()Returns the associated order.org.broadleafcommerce.common.currency.domain.BroadleafCurrencyReturns theBroadleafCurrencyfor the current order.booleanReturns true if this promotableOrder has any order adjustments.booleanReturns true if this order was created in a way that existing order and item adjustments were copied over to this item.protected booleanbooleanbooleanbooleanReturns true if a totalitarian offer has been applied.booleanvoidRemoves all adjustments from the order's fulfillment items and resets the adjustment price for each item.voidRemoves all adjustments from the order's order items and resets the adjustment price for each item.voidRemoves all order, order item, and fulfillment adjustments from the order and resets the adjustment price.voidRemoves all order adjustments from the order and resets the adjustment price.voidSets the order subTotal to the sum of item total prices without adjustments.voidSets the order subTotal to the sum of item total prices without adjustments.voidsetTotalFufillmentCharges(org.broadleafcommerce.common.money.Money totalFulfillmentCharges) Sets the total fulfillmentCharges the order.voidupdateRuleVariables(Map<String, Object> ruleVars) Adds the underlying order to the rule variable map.
-
Field Details
-
itemFactory
-
order
-
allOrderItems
-
discountableOrderItems
-
currentSortParam
protected boolean currentSortParam -
fulfillmentGroups
-
candidateOrderOfferAdjustments
-
includeOrderAndItemAdjustments
protected boolean includeOrderAndItemAdjustments -
extraDataMap
-
-
Constructor Details
-
PromotableOrderImpl
public PromotableOrderImpl(Order order, PromotableItemFactory itemFactory, boolean includeOrderAndItemAdjustments)
-
-
Method Details
-
createExistingOrderAdjustments
protected void createExistingOrderAdjustments()Bring over the order adjustments. Intended to be used when processing fulfillment orders. -
setOrderSubTotalToPriceWithoutAdjustments
public void setOrderSubTotalToPriceWithoutAdjustments()Description copied from interface:PromotableOrderSets the order subTotal to the sum of item total prices without adjustments.- Specified by:
setOrderSubTotalToPriceWithoutAdjustmentsin interfacePromotableOrder
-
setOrderSubTotalToPriceWithAdjustments
public void setOrderSubTotalToPriceWithAdjustments()Description copied from interface:PromotableOrderSets the order subTotal to the sum of item total prices without adjustments.- Specified by:
setOrderSubTotalToPriceWithAdjustmentsin interfacePromotableOrder
-
getAllOrderItems
Description copied from interface:PromotableOrderReturns all OrderItems for the order wrapped with PromotableOrderItem- Specified by:
getAllOrderItemsin interfacePromotableOrder- Returns:
-
getDiscountableOrderItems
Description copied from interface:PromotableOrderReturns all OrderItems that can receive discounts.- Specified by:
getDiscountableOrderItemsin interfacePromotableOrder- Returns:
-
getDiscountableOrderItems
Description copied from interface:PromotableOrderReturns all OrderItems that can receive discounts. Sorts the results by SalePrice or RetailPrice depending upon the passed in variable.- Specified by:
getDiscountableOrderItemsin interfacePromotableOrder- Returns:
-
buildPromotableOrderItemsList
-
addPromotableOrderItem
protected void addPromotableOrderItem(OrderItem orderItem, List<PromotableOrderItem> discountableOrderItems) -
getFulfillmentGroups
Description copied from interface:PromotableOrderReturns the fulfillmentGroups associated with the order after converting them to promotableFulfillmentGroups.- Specified by:
getFulfillmentGroupsin interfacePromotableOrder- Returns:
-
isHasOrderAdjustments
public boolean isHasOrderAdjustments()Description copied from interface:PromotableOrderReturns true if this promotableOrder has any order adjustments.- Specified by:
isHasOrderAdjustmentsin interfacePromotableOrder- Returns:
-
getCandidateOrderAdjustments
Description copied from interface:PromotableOrderReturns the list of orderAdjustments being proposed for the order. This will be converted to actual order adjustments on completion of the offer processing.- Specified by:
getCandidateOrderAdjustmentsin interfacePromotableOrder- Returns:
-
addCandidateOrderAdjustment
Description copied from interface:PromotableOrderAdds the adjustment to the order's adjustment list and discounts the order's adjustment price by the value of the adjustment.- Specified by:
addCandidateOrderAdjustmentin interfacePromotableOrder
-
removeAllCandidateOfferAdjustments
public void removeAllCandidateOfferAdjustments()Description copied from interface:PromotableOrderRemoves all order, order item, and fulfillment adjustments from the order and resets the adjustment price.- Specified by:
removeAllCandidateOfferAdjustmentsin interfacePromotableOrder
-
removeAllCandidateOrderOfferAdjustments
public void removeAllCandidateOrderOfferAdjustments()Description copied from interface:PromotableOrderRemoves all order adjustments from the order and resets the adjustment price.- Specified by:
removeAllCandidateOrderOfferAdjustmentsin interfacePromotableOrder
-
removeAllCandidateItemOfferAdjustments
public void removeAllCandidateItemOfferAdjustments()Description copied from interface:PromotableOrderRemoves all adjustments from the order's order items and resets the adjustment price for each item.- Specified by:
removeAllCandidateItemOfferAdjustmentsin interfacePromotableOrder
-
removeAllCandidateFulfillmentOfferAdjustments
public void removeAllCandidateFulfillmentOfferAdjustments()Description copied from interface:PromotableOrderRemoves all adjustments from the order's fulfillment items and resets the adjustment price for each item.- Specified by:
removeAllCandidateFulfillmentOfferAdjustmentsin interfacePromotableOrder
-
updateRuleVariables
Description copied from interface:PromotableOrderAdds the underlying order to the rule variable map.- Specified by:
updateRuleVariablesin interfacePromotableOrder
-
getOrder
Description copied from interface:PromotableOrderReturns the associated order.- Specified by:
getOrderin interfacePromotableOrder
-
isTotalitarianOfferApplied
public boolean isTotalitarianOfferApplied()Description copied from interface:PromotableOrderReturns true if a totalitarian offer has been applied. A totalitarian offer is an offer that does not allow any other offers to be used at the same time. As opposed to a "non-combinable" offer which can't be used with other offers of the same type but can be used with other offers of a different type (e.g. a non-combinable order offer can be used with a non-combinable item offer).- Specified by:
isTotalitarianOfferAppliedin interfacePromotableOrder- Returns:
-
isTotalitarianOrderOfferApplied
public boolean isTotalitarianOrderOfferApplied()- Specified by:
isTotalitarianOrderOfferAppliedin interfacePromotableOrder
-
isTotalitarianItemOfferApplied
public boolean isTotalitarianItemOfferApplied()- Specified by:
isTotalitarianItemOfferAppliedin interfacePromotableOrder
-
isTotalitarianFgOfferApplied
public boolean isTotalitarianFgOfferApplied()- Specified by:
isTotalitarianFgOfferAppliedin interfacePromotableOrder
-
calculateOrderAdjustmentTotal
public org.broadleafcommerce.common.money.Money calculateOrderAdjustmentTotal()Description copied from interface:PromotableOrderCalculates the total adjustment to be received from the order adjustments.- Specified by:
calculateOrderAdjustmentTotalin interfacePromotableOrder- Returns:
-
calculateItemAdjustmentTotal
public org.broadleafcommerce.common.money.Money calculateItemAdjustmentTotal()Description copied from interface:PromotableOrderCalculates the total adjustment to be received from the item adjustments.- Specified by:
calculateItemAdjustmentTotalin interfacePromotableOrder- Returns:
-
getAllPromotableOrderItemPriceDetails
Description copied from interface:PromotableOrderReturns all of the price detail items for this order.- Specified by:
getAllPromotableOrderItemPriceDetailsin interfacePromotableOrder- Returns:
-
getOrderCurrency
public org.broadleafcommerce.common.currency.domain.BroadleafCurrency getOrderCurrency()Description copied from interface:PromotableOrderReturns theBroadleafCurrencyfor the current order.- Specified by:
getOrderCurrencyin interfacePromotableOrder- Returns:
-
setTotalFufillmentCharges
public void setTotalFufillmentCharges(org.broadleafcommerce.common.money.Money totalFulfillmentCharges) Description copied from interface:PromotableOrderSets the total fulfillmentCharges the order.- Specified by:
setTotalFufillmentChargesin interfacePromotableOrder
-
isNotCombinableOrderOfferApplied
protected boolean isNotCombinableOrderOfferApplied() -
canApplyOrderOffer
Description copied from interface:PromotableOrderReturns true if this order can apply another order promotion. Returns false if a totalitarian or not-combinable offer has already been applied Returns false if the passed in order is not-combinable or totalitarian and this order already has adjustments- Specified by:
canApplyOrderOfferin interfacePromotableOrder
-
calculateSubtotalWithoutAdjustments
public org.broadleafcommerce.common.money.Money calculateSubtotalWithoutAdjustments()Description copied from interface:PromotableOrderReturns the price of the order without adjustments.- Specified by:
calculateSubtotalWithoutAdjustmentsin interfacePromotableOrder- Returns:
-
calculateSubtotalWithAdjustments
public org.broadleafcommerce.common.money.Money calculateSubtotalWithAdjustments()Description copied from interface:PromotableOrderReturns the price of the order with adjustments.- Specified by:
calculateSubtotalWithAdjustmentsin interfacePromotableOrder- Returns:
-
isIncludeOrderAndItemAdjustments
public boolean isIncludeOrderAndItemAdjustments()Description copied from interface:PromotableOrderReturns true if this order was created in a way that existing order and item adjustments were copied over to this item.- Specified by:
isIncludeOrderAndItemAdjustmentsin interfacePromotableOrder- Returns:
-
getExtraDataMap
Description copied from interface:PromotableOrderMap available to implementations to store data needed for custom logic.- Specified by:
getExtraDataMapin interfacePromotableOrder
-