Class DefaultReturnConfirmationGenerationService

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected javax.money.MonetaryAmount calculateRemainderOfTotal​(com.broadleafcommerce.order.client.domain.ReturnAuthorizationItem returnItem, javax.money.MonetaryAmount itemTotal, Function<com.broadleafcommerce.order.client.domain.ReturnConfirmation,​javax.money.MonetaryAmount> getConfirmationTotal)
      Calculate the remaining amount for the itemTotal which has not already been accounted for by the sum of the getConfirmationTotal of the existing ReturnAuthorizationItem.confirmations.
      com.broadleafcommerce.order.client.domain.ReturnConfirmation generateReturnConfirmation​(com.broadleafcommerce.order.client.domain.ReturnAuthorizationItem returnItem, ConfirmReturnItemRequest confirmReturnItemRequest)
      Generates a new ReturnConfirmation for the given ReturnConfirmation requested by confirmReturnRequest.
      protected SplitRoundingHelper getRoundingHelper()  
      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()  
      protected void populateTotals​(com.broadleafcommerce.order.client.domain.ReturnConfirmation returnConfirmation, com.broadleafcommerce.order.client.domain.ReturnAuthorizationItem returnItem)
      Calculate and assign the totals within the ReturnConfirmation based on the quantity of the ReturnAuthorizationItem it contains.
      protected void populateTotalsBasedOnQuantity​(com.broadleafcommerce.order.client.domain.ReturnConfirmation returnConfirmation, com.broadleafcommerce.order.client.domain.ReturnAuthorizationItem returnItem)
      Calculate and assign the totals within a ReturnConfirmation based on the fraction of the ReturnAuthorizationItem.quantity it contains.
      protected void populateTotalsWithRemainders​(com.broadleafcommerce.order.client.domain.ReturnConfirmation returnConfirmation, com.broadleafcommerce.order.client.domain.ReturnAuthorizationItem returnItem)
      Calculate and assign the totals within ReturnConfirmation as the remainder of the totals in the ReturnAuthorizationItem which have not already been confirmed.
    • Constructor Detail

      • DefaultReturnConfirmationGenerationService

        public DefaultReturnConfirmationGenerationService​(SplitRoundingHelper roundingHelper,
                                                          com.broadleafcommerce.common.extension.TypeFactory typeFactory)
    • Method Detail

      • generateReturnConfirmation

        public com.broadleafcommerce.order.client.domain.ReturnConfirmation generateReturnConfirmation​(com.broadleafcommerce.order.client.domain.ReturnAuthorizationItem returnItem,
                                                                                                       ConfirmReturnItemRequest confirmReturnItemRequest)
        Description copied from interface: ReturnConfirmationGenerationService
        Generates a new ReturnConfirmation for the given ReturnConfirmation requested by confirmReturnRequest.
        Specified by:
        generateReturnConfirmation in interface ReturnConfirmationGenerationService
        Parameters:
        returnItem - the return authorization item to confirm
        confirmReturnItemRequest - the request to confirm an item
        Returns:
        the generated ReturnConfirmation
      • populateTotals

        protected void populateTotals​(com.broadleafcommerce.order.client.domain.ReturnConfirmation returnConfirmation,
                                      com.broadleafcommerce.order.client.domain.ReturnAuthorizationItem returnItem)
        Calculate and assign the totals within the ReturnConfirmation based on the quantity of the ReturnAuthorizationItem it contains.
        Parameters:
        returnConfirmation - the confirmation to calculate and assign totals within
        returnItem - the item which the confirmation applies to
      • populateTotalsWithRemainders

        protected void populateTotalsWithRemainders​(com.broadleafcommerce.order.client.domain.ReturnConfirmation returnConfirmation,
                                                    com.broadleafcommerce.order.client.domain.ReturnAuthorizationItem returnItem)
        Calculate and assign the totals within ReturnConfirmation as the remainder of the totals in the ReturnAuthorizationItem which have not already been confirmed.
        Parameters:
        returnConfirmation - the confirmation to calculate and assign totals within
        returnItem - the item which the confirmation applies to
      • calculateRemainderOfTotal

        protected javax.money.MonetaryAmount calculateRemainderOfTotal​(com.broadleafcommerce.order.client.domain.ReturnAuthorizationItem returnItem,
                                                                       javax.money.MonetaryAmount itemTotal,
                                                                       Function<com.broadleafcommerce.order.client.domain.ReturnConfirmation,​javax.money.MonetaryAmount> getConfirmationTotal)
        Calculate the remaining amount for the itemTotal which has not already been accounted for by the sum of the getConfirmationTotal of the existing ReturnAuthorizationItem.confirmations.
        Parameters:
        returnItem - the item containing confirmations
        itemTotal - the item total to get the remainder of by subtracting the confirmation totals
        getConfirmationTotal - the function to get the total off a confirmation
        Returns:
        remaining amount for the itemTotal not already accounted for by the confirmation totals
      • populateTotalsBasedOnQuantity

        protected void populateTotalsBasedOnQuantity​(com.broadleafcommerce.order.client.domain.ReturnConfirmation returnConfirmation,
                                                     com.broadleafcommerce.order.client.domain.ReturnAuthorizationItem returnItem)
        Calculate and assign the totals within a ReturnConfirmation based on the fraction of the ReturnAuthorizationItem.quantity it contains.
        Parameters:
        returnConfirmation - the confirmation to calculate and assign totals within
        returnItem - the item which the confirmation applies to
      • getTypeFactory

        protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()