Class EnhancedFulfillmentGroup

    • Field Detail

      • adjustedTotal

        protected javax.money.MonetaryAmount adjustedTotal
    • Constructor Detail

      • EnhancedFulfillmentGroup

        public EnhancedFulfillmentGroup()
    • Method Detail

      • getMerchandiseTotal

        @Nullable
        public javax.money.MonetaryAmount getMerchandiseTotal()
        Return the total price of all order line items in the fulfillment group.
      • getTotal

        public javax.money.MonetaryAmount getTotal()
        Gets the total for this fulfillment group. This method returns the adjustedTotal and sets the value if it is null. Used primarily by the rules engine to check for fulfillment offers that are only valid for certain group subtotals.
      • getTotalBeforeAdjustments

        public javax.money.MonetaryAmount getTotalBeforeAdjustments()
        Gets the total before adjustments for this fulfillment group. Note that this excludes individual items.
      • getAdjustmentTotal

        public javax.money.MonetaryAmount getAdjustmentTotal​(javax.money.CurrencyUnit currency)
        Calculates the sum of the fulfillment group adjustments. Excludes future credits and item adjustments.
      • getTotalWithoutFutureCredits

        public javax.money.MonetaryAmount getTotalWithoutFutureCredits​(javax.money.CurrencyUnit currency)
        Gets the total for this fulfillment group excluding future credits. Note that this excludes individual items.
      • getTotalWithAdjustments

        public javax.money.MonetaryAmount getTotalWithAdjustments()
        Calculates the total for this fulfillment group with adjustments. This includes future credit and excludes items.
      • getItemsAdjustmentsValue

        public javax.money.MonetaryAmount getItemsAdjustmentsValue​(javax.money.CurrencyUnit currency)
        Gets the sum of the fulfillment items total adjustments. Excludes future credits.
      • getAllFutureCreditAdjustmentValue

        public javax.money.MonetaryAmount getAllFutureCreditAdjustmentValue​(javax.money.CurrencyUnit currency)
        Gets the sum of all future credit for this fulfillment group (of item and group adjustments).
      • getFulfillmentAdjustmentAmount

        public javax.money.MonetaryAmount getFulfillmentAdjustmentAmount​(javax.money.CurrencyUnit currency)
        Calculates the total adjustment for this group and its items. Excludes future credits.
      • canApplyOffer

        public boolean canApplyOffer​(CandidateFulfillmentGroupOffer offer)
        Whether the provided offer can be applied to this group.
        Parameters:
        offer - the offer to test
        Returns:
        whether the offer can be applied to this group
      • removeAllGroupOfferAdjustments

        public void removeAllGroupOfferAdjustments()
      • finalizeItemPrices

        public void finalizeItemPrices()
      • finalizeTotal

        public javax.money.MonetaryAmount finalizeTotal()
        Finalize attached adjustments and return adjusted price.
        Returns:
        The final adjusted price for this EnhancedFulfillmentGroup.
      • removeZeroDollarAdjustments

        protected void removeZeroDollarAdjustments()
      • isNonCombinableGroupOfferApplied

        protected boolean isNonCombinableGroupOfferApplied()
      • setAdjustedTotal

        protected void setAdjustedTotal()
      • sumOnItems

        protected javax.money.MonetaryAmount sumOnItems​(javax.money.CurrencyUnit currency,
                                                        Function<EnhancedFulfillmentLineItem,​javax.money.MonetaryAmount> mapAttribute)
        Sums some attribute of the items of this fulfillment group.
        Parameters:
        currency - the currency of the items' values
        mapAttribute - the attribute of the item to map to
        Returns:
        the summed amount of the attributes for each of the fulfillment items
      • sumOnAdjustments

        protected javax.money.MonetaryAmount sumOnAdjustments​(javax.money.CurrencyUnit currency,
                                                              Function<FulfillmentGroupAdjustment,​javax.money.MonetaryAmount> mapAttribute)
        Sums some attribute of the adjustments of this fulfillment group.
        Parameters:
        currency - the currency of the adjustments' values
        mapAttribute - the attribute of the adjustment to map to
        Returns:
        the summed amount of the attributes for each of the fulfillment adjustments
      • sumOnAdjustments

        protected javax.money.MonetaryAmount sumOnAdjustments​(javax.money.CurrencyUnit currency,
                                                              Function<FulfillmentGroupAdjustment,​javax.money.MonetaryAmount> mapAttribute,
                                                              Predicate<FulfillmentGroupAdjustment> filter)
        Sums some attribute of the adjustments of this fulfillment group.
        Parameters:
        currency - the currency of the adjustments' values
        mapAttribute - the attribute of the adjustment to map to
        filter - a filter for any of the adjustments
        Returns:
        the summed amount of the attributes for each of the fulfillment adjustments
      • getId

        public String getId()
        Specified by:
        getId in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • getFulfillmentOptionType

        public String getFulfillmentOptionType()
        Specified by:
        getFulfillmentOptionType in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • getFulfillmentOptionName

        public String getFulfillmentOptionName()
        Specified by:
        getFulfillmentOptionName in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • getDestination

        public com.broadleafcommerce.promotion.offer.client.web.context.Destination getDestination()
        Specified by:
        getDestination in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • getPrimaryPhone

        public String getPrimaryPhone()
        Specified by:
        getPrimaryPhone in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • getSecondaryPhone

        public String getSecondaryPhone()
        Specified by:
        getSecondaryPhone in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • getFaxNumber

        public String getFaxNumber()
        Specified by:
        getFaxNumber in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • getPriceBeforeAdjustments

        public javax.money.MonetaryAmount getPriceBeforeAdjustments()
        Specified by:
        getPriceBeforeAdjustments in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • getProratedFulfillmentAdjustments

        public javax.money.MonetaryAmount getProratedFulfillmentAdjustments()
        Prorated fulfillment adjustments for the fulfillment group itself.

        Fulfillment-level adjustments are prorated between the charges of the fulfullment group and those of the individual fulfullment items, the prorated fulfillment adjustments for the items are set at the item level.

        See Also:
        EnhancedLineItem.getProratedAdjustments()
      • setId

        public void setId​(String id)
        Specified by:
        setId in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • setFulfillmentOptionType

        public void setFulfillmentOptionType​(String fulfillmentOptionType)
        Specified by:
        setFulfillmentOptionType in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • setFulfillmentOptionName

        public void setFulfillmentOptionName​(String fulfillmentOptionName)
        Specified by:
        setFulfillmentOptionName in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • setDestination

        public void setDestination​(com.broadleafcommerce.promotion.offer.client.web.context.Destination destination)
        Specified by:
        setDestination in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • setPrimaryPhone

        public void setPrimaryPhone​(String primaryPhone)
        Specified by:
        setPrimaryPhone in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • setSecondaryPhone

        public void setSecondaryPhone​(String secondaryPhone)
        Specified by:
        setSecondaryPhone in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • setFaxNumber

        public void setFaxNumber​(String faxNumber)
        Specified by:
        setFaxNumber in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • setPriceBeforeAdjustments

        public void setPriceBeforeAdjustments​(javax.money.MonetaryAmount priceBeforeAdjustments)
        Specified by:
        setPriceBeforeAdjustments in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • setAttributes

        public void setAttributes​(Map<String,​Object> attributes)
        Specified by:
        setAttributes in interface com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
      • setProratedFulfillmentAdjustments

        public void setProratedFulfillmentAdjustments​(javax.money.MonetaryAmount proratedFulfillmentAdjustments)
        Prorated fulfillment adjustments for the fulfillment group itself.

        Fulfillment-level adjustments are prorated between the charges of the fulfullment group and those of the individual fulfullment items, the prorated fulfillment adjustments for the items are set at the item level.

        See Also:
        EnhancedLineItem.getProratedAdjustments()
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object