Class PromotableFulfillmentGroupImpl
java.lang.Object
org.broadleafcommerce.core.offer.service.discount.domain.PromotableFulfillmentGroupImpl
- All Implemented Interfaces:
Serializable,PromotableFulfillmentGroup
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.broadleafcommerce.common.money.Moneyprotected List<PromotableOrderItem>protected FulfillmentGroupprotected PromotableItemFactoryprotected PromotableOrderprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionPromotableFulfillmentGroupImpl(FulfillmentGroup fulfillmentGroup, PromotableOrder promotableOrder, PromotableItemFactory itemFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a fulfillmentGroupAdjustmentorg.broadleafcommerce.common.money.MoneycalculatePriceWithAdjustments(boolean useSalePrice) Calculates the price with adjustments.org.broadleafcommerce.common.money.MoneyReturns the price of this fulfillment group if no adjustments were applied.protected org.broadleafcommerce.common.money.Moneyprotected org.broadleafcommerce.common.money.MoneybooleancanApplyOffer(PromotableCandidateFulfillmentGroupOffer fulfillmentGroupOffer) Checks to see if the offer can be added to this fulfillmentGroup based on whether or not it is combinable or if this fulfillmentGroup already has a non-combinable offer applied.voidThis method will check to see if the salePriceAdjustments or retailPriceAdjustments are better and remove those that should not apply.protected voidfinalizeAdjustments(boolean useSaleAdjustments) Adds a fulfillmentGroupAdjustmentReturn list of discountable discrete order items contained in this fulfillmentGroup.org.broadleafcommerce.common.money.MoneyCalculates the price with all adjustments.Returns the decorated FulfillmentGroupprotected org.broadleafcommerce.common.money.MoneybooleanReturns true if totalitarian offer was applied to this promotable fulfillment group.voidRemoves all candidate adjustmentsprotected voidRemoves retail only adjustments.protected voidremoveZeroDollarAdjustments(boolean useSalePrice) If removeUnusedAdjustments is svoidupdateRuleVariables(Map<String, Object> ruleVars) Adds the underlying fulfillmentGroup to the rule variable map.
-
Field Details
-
candidateFulfillmentGroupAdjustments
-
fulfillmentGroup
-
promotableOrder
-
itemFactory
-
discountableOrderItems
-
useSaleAdjustments
protected boolean useSaleAdjustments -
adjustedPrice
protected org.broadleafcommerce.common.money.Money adjustedPrice
-
-
Constructor Details
-
PromotableFulfillmentGroupImpl
public PromotableFulfillmentGroupImpl(FulfillmentGroup fulfillmentGroup, PromotableOrder promotableOrder, PromotableItemFactory itemFactory)
-
-
Method Details
-
getFulfillmentGroup
Description copied from interface:PromotableFulfillmentGroupReturns the decorated FulfillmentGroup- Specified by:
getFulfillmentGroupin interfacePromotableFulfillmentGroup
-
updateRuleVariables
Description copied from interface:PromotableFulfillmentGroupAdds the underlying fulfillmentGroup to the rule variable map.- Specified by:
updateRuleVariablesin interfacePromotableFulfillmentGroup
-
getDiscountableOrderItems
Description copied from interface:PromotableFulfillmentGroupReturn list of discountable discrete order items contained in this fulfillmentGroup.- Specified by:
getDiscountableOrderItemsin interfacePromotableFulfillmentGroup- Returns:
-
getSalePriceBeforeAdjustments
protected org.broadleafcommerce.common.money.Money getSalePriceBeforeAdjustments() -
calculateSaleAdjustmentPrice
protected org.broadleafcommerce.common.money.Money calculateSaleAdjustmentPrice() -
calculateRetailAdjustmentPrice
protected org.broadleafcommerce.common.money.Money calculateRetailAdjustmentPrice() -
chooseSaleOrRetailAdjustments
public void chooseSaleOrRetailAdjustments()This method will check to see if the salePriceAdjustments or retailPriceAdjustments are better and remove those that should not apply.- Specified by:
chooseSaleOrRetailAdjustmentsin interfacePromotableFulfillmentGroup
-
finalizeAdjustments
protected void finalizeAdjustments(boolean useSaleAdjustments) -
removeRetailOnlyAdjustments
protected void removeRetailOnlyAdjustments()Removes retail only adjustments. -
removeZeroDollarAdjustments
protected void removeZeroDollarAdjustments(boolean useSalePrice) If removeUnusedAdjustments is s- Parameters:
useSalePrice-
-
getFinalizedPriceWithAdjustments
public org.broadleafcommerce.common.money.Money getFinalizedPriceWithAdjustments()Description copied from interface:PromotableFulfillmentGroupCalculates the price with all adjustments. May error in the case where adjustments have not been finalized with a call to chooseSaleOrRetailAdjustments.- Specified by:
getFinalizedPriceWithAdjustmentsin interfacePromotableFulfillmentGroup
-
calculatePriceWithoutAdjustments
public org.broadleafcommerce.common.money.Money calculatePriceWithoutAdjustments()Description copied from interface:PromotableFulfillmentGroupReturns the price of this fulfillment group if no adjustments were applied.- Specified by:
calculatePriceWithoutAdjustmentsin interfacePromotableFulfillmentGroup- Returns:
-
addCandidateFulfillmentGroupAdjustment
Description copied from interface:PromotableFulfillmentGroupAdds a fulfillmentGroupAdjustment- Specified by:
addCandidateFulfillmentGroupAdjustmentin interfacePromotableFulfillmentGroup
-
getCandidateFulfillmentGroupAdjustments
Description copied from interface:PromotableFulfillmentGroupAdds a fulfillmentGroupAdjustment- Specified by:
getCandidateFulfillmentGroupAdjustmentsin interfacePromotableFulfillmentGroup- Returns:
-
canApplyOffer
Description copied from interface:PromotableFulfillmentGroupChecks to see if the offer can be added to this fulfillmentGroup based on whether or not it is combinable or if this fulfillmentGroup already has a non-combinable offer applied.- Specified by:
canApplyOfferin interfacePromotableFulfillmentGroup- Returns:
-
calculatePriceWithAdjustments
public org.broadleafcommerce.common.money.Money calculatePriceWithAdjustments(boolean useSalePrice) Description copied from interface:PromotableFulfillmentGroupCalculates the price with adjustments. Uses the sale or retail adjustments based on the passed in parameter.- Specified by:
calculatePriceWithAdjustmentsin interfacePromotableFulfillmentGroup
-
isTotalitarianOfferApplied
public boolean isTotalitarianOfferApplied()Description copied from interface:PromotableFulfillmentGroupReturns true if totalitarian offer was applied to this promotable fulfillment group.- Specified by:
isTotalitarianOfferAppliedin interfacePromotableFulfillmentGroup- Returns:
-
removeAllCandidateAdjustments
public void removeAllCandidateAdjustments()Description copied from interface:PromotableFulfillmentGroupRemoves all candidate adjustments- Specified by:
removeAllCandidateAdjustmentsin interfacePromotableFulfillmentGroup
-