Class FulfillmentOperationHelper

java.lang.Object
com.broadleafcommerce.orderoperation.service.FulfillmentOperationHelper

public class FulfillmentOperationHelper extends Object
Contains methods to help with fulfillment operations, such as calculating specific totals for a fulfillment.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    javax.money.MonetaryAmount
    calculateFulfillmentTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    Calculate the taxable amount of the fulfillment fees.
    javax.money.MonetaryAmount
    calculateGrandTotal(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    Calculate the fulfillment's OrderFulfillment.grandTotal.
    javax.money.MonetaryAmount
    calculateMerchandiseTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    Calculate the taxable amount of the merchandise total.
    javax.money.MonetaryAmount
    calculateTotalFulfillmentPrice(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    Calculate the fulfillment's OrderFulfillment#totalFulfillmentPrice.
    boolean
    fulfillmentOptionIsTaxable(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
     
    javax.money.MonetaryAmount
    getFulfillmentIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    The sum of the included fulfillment tax for all the items in the fulfillment.
     
    javax.money.MonetaryAmount
    getMerchandiseExclusiveTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    The sum of the exclusive merchandise tax for all the items in the fulfillment.
    javax.money.MonetaryAmount
    getMerchandiseIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    The sum of the included merchandise tax for all the items in the fulfillment.
    void
     
    javax.money.MonetaryAmount
    sumAdjustments(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    Sum up the fulfillment's OrderFulfillment.adjustments.
    javax.money.MonetaryAmount
    sumItemFulfillmentTotals(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    Sum up the OrderFulfillmentItem.fulfillmentTotal across all of the fulfillment's items.
    javax.money.MonetaryAmount
    sumItemMerchandiseTotalTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    Total up the OrderFulfillmentItem#merchandiseTotalTax for all the items in the fulfillment.
    javax.money.MonetaryAmount
    sumTaxDetailTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem item, javax.money.CurrencyUnit currencyUnit)
    Sum the TaxableAmount from all Tax Details on the given item.
    javax.money.MonetaryAmount
    sumTaxDetailTaxCalculated(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem item, javax.money.CurrencyUnit currencyUnit)
    Sum the TaxCalculated from all Tax Details on the given item.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FulfillmentOperationHelper

      public FulfillmentOperationHelper()
  • Method Details

    • calculateTotalFulfillmentPrice

      public javax.money.MonetaryAmount calculateTotalFulfillmentPrice(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
      Calculate the fulfillment's OrderFulfillment#totalFulfillmentPrice.

      This is the OrderFulfillment.fulfillmentCharge plus the items' OrderFulfillmentItem.fulfillmentTotal, less the total of adjustment amounts from OrderFulfillment.adjustments.

      Parameters:
      fulfillment - the fulfillment to calculate the total fulfillment price for
      Returns:
      the total fulfillment price calculated for the fulfillment
    • sumAdjustments

      public javax.money.MonetaryAmount sumAdjustments(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
      Sum up the fulfillment's OrderFulfillment.adjustments.
      Parameters:
      fulfillment - the fulfillment to sum the adjustments for
      Returns:
      the sum of the fulfillment's adjustments
    • sumItemFulfillmentTotals

      public javax.money.MonetaryAmount sumItemFulfillmentTotals(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
      Sum up the OrderFulfillmentItem.fulfillmentTotal across all of the fulfillment's items.
      Parameters:
      fulfillment - the fulfillment to sum the item fulfillment total for
      Returns:
      the sum of the fulfillment's items' fulfillment totals
    • sumItemMerchandiseTotalTax

      public javax.money.MonetaryAmount sumItemMerchandiseTotalTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
      Total up the OrderFulfillmentItem#merchandiseTotalTax for all the items in the fulfillment.
      Parameters:
      fulfillment - the fulfillment to total the merchandise total tax for
      Returns:
      the total of all the merchandise tax for all items in the fulfillment
    • getMerchandiseExclusiveTax

      public javax.money.MonetaryAmount getMerchandiseExclusiveTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
      The sum of the exclusive merchandise tax for all the items in the fulfillment. Exclusive tax is the difference between the OrderFulfillmentItem#merchandiseTotalTax and the OrderFulfillmentItem.includedMerchandiseTax
      Parameters:
      fulfillment - the fulfillment to get the exclusive merchandise tax for
      Returns:
      the exclusive merchandise tax for all items in the fulfillment
    • getMerchandiseIncludedTax

      public javax.money.MonetaryAmount getMerchandiseIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
      The sum of the included merchandise tax for all the items in the fulfillment. Included tax is tax that is already accounted for in the OrderFulfillment.getItemMerchandiseSubtotal().
      Parameters:
      fulfillment - the fulfillment to get the included merchandise tax for
      Returns:
      the included merchandise tax for all items in the fulfillment
    • getFulfillmentIncludedTax

      public javax.money.MonetaryAmount getFulfillmentIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
      The sum of the included fulfillment tax for all the items in the fulfillment. Included tax is tax that is already accounted for in the OrderFulfillment.getFulfillmentTotal().
      Parameters:
      fulfillment - the fulfillment to get the included fulfillment tax for
      Returns:
      the included fulfillment tax for all items in the fulfillment
    • sumTaxDetailTaxableAmount

      public javax.money.MonetaryAmount sumTaxDetailTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem item, javax.money.CurrencyUnit currencyUnit)
      Sum the TaxableAmount from all Tax Details on the given item. This does not differentiate between taxes on merchandise and taxes on fulfillment fees. For more fine-grained summing of tax fields, see InclusiveTaxHelper.
      Parameters:
      item - The OrderFulfillmentItem to operate on.
      currencyUnit - The currency of the operation.
      Returns:
      The total of all taxable amounts from all tax details on the given item.
    • sumTaxDetailTaxCalculated

      public javax.money.MonetaryAmount sumTaxDetailTaxCalculated(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem item, javax.money.CurrencyUnit currencyUnit)
      Sum the TaxCalculated from all Tax Details on the given item. This does not differentiate between taxes on merchandise and taxes on fulfillment fees. For more fine-grained summing of tax fields, see InclusiveTaxHelper.
      Parameters:
      item - The OrderFulfillmentItem to operate on.
      currencyUnit - The currency of the operation.
      Returns:
      The total of all taxes from all tax details on the given item.
    • calculateFulfillmentTaxableAmount

      public javax.money.MonetaryAmount calculateFulfillmentTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
      Calculate the taxable amount of the fulfillment fees.
      Parameters:
      fulfillment - the fulfillment to calculate the taxable fulfillment price for
      Returns:
      the taxable amount of the fulfillment price
    • calculateMerchandiseTaxableAmount

      public javax.money.MonetaryAmount calculateMerchandiseTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
      Calculate the taxable amount of the merchandise total.
      Parameters:
      fulfillment - the fulfillment to calculate the taxable fulfillment price for
      Returns:
      the taxable amount of the fulfillment price
    • calculateGrandTotal

      public javax.money.MonetaryAmount calculateGrandTotal(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
      Calculate the fulfillment's OrderFulfillment.grandTotal.

      This is the OrderFulfillment#totalFulfillmentPrice and OrderFulfillment#totalTax plus the items' OrderFulfillmentItem#merchandiseTotalAmount.

      Parameters:
      fulfillment - the fulfillment to calculate the grand total for
      Returns:
      the calculated grand total for the fulfillment
    • fulfillmentOptionIsTaxable

      public boolean fulfillmentOptionIsTaxable(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment)
    • getInclusiveTaxHelper

      protected InclusiveTaxHelper getInclusiveTaxHelper()
    • setInclusiveTaxHelper

      @Autowired public void setInclusiveTaxHelper(InclusiveTaxHelper inclusiveTaxHelper)