Class FulfillmentOperationHelper
java.lang.Object
com.broadleafcommerce.orderoperation.service.FulfillmentOperationHelper
Contains methods to help with fulfillment operations, such as calculating specific totals for a
fulfillment.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.money.MonetaryAmountcalculateFulfillmentTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Calculate the taxable amount of the fulfillment fees.javax.money.MonetaryAmountcalculateGrandTotal(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Calculate the fulfillment'sOrderFulfillment.grandTotal.javax.money.MonetaryAmountcalculateMerchandiseTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Calculate the taxable amount of the merchandise total.javax.money.MonetaryAmountcalculateTotalFulfillmentPrice(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Calculate the fulfillment'sOrderFulfillment#totalFulfillmentPrice.booleanfulfillmentOptionIsTaxable(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) javax.money.MonetaryAmountgetFulfillmentIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) The sum of the included fulfillment tax for all the items in the fulfillment.protected InclusiveTaxHelperjavax.money.MonetaryAmountgetMerchandiseExclusiveTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) The sum of the exclusive merchandise tax for all the items in the fulfillment.javax.money.MonetaryAmountgetMerchandiseIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) The sum of the included merchandise tax for all the items in the fulfillment.voidsetInclusiveTaxHelper(InclusiveTaxHelper inclusiveTaxHelper) javax.money.MonetaryAmountsumAdjustments(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Sum up the fulfillment'sOrderFulfillment.adjustments.javax.money.MonetaryAmountsumItemFulfillmentTotals(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Sum up theOrderFulfillmentItem.fulfillmentTotalacross all of the fulfillment's items.javax.money.MonetaryAmountsumItemMerchandiseTotalTax(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Total up theOrderFulfillmentItem#merchandiseTotalTaxfor all the items in the fulfillment.javax.money.MonetaryAmountsumTaxDetailTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem item, javax.money.CurrencyUnit currencyUnit) Sum the TaxableAmount from all Tax Details on the given item.javax.money.MonetaryAmountsumTaxDetailTaxCalculated(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem item, javax.money.CurrencyUnit currencyUnit) Sum the TaxCalculated from all Tax Details on the given item.
-
Constructor Details
-
FulfillmentOperationHelper
public FulfillmentOperationHelper()
-
-
Method Details
-
calculateTotalFulfillmentPrice
public javax.money.MonetaryAmount calculateTotalFulfillmentPrice(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Calculate the fulfillment'sOrderFulfillment#totalFulfillmentPrice.This is the
OrderFulfillment.fulfillmentChargeplus the items'OrderFulfillmentItem.fulfillmentTotal, less the total of adjustment amounts fromOrderFulfillment.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'sOrderFulfillment.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 theOrderFulfillmentItem.fulfillmentTotalacross 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 theOrderFulfillmentItem#merchandiseTotalTaxfor 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 theOrderFulfillmentItem#merchandiseTotalTaxand theOrderFulfillmentItem.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 theOrderFulfillment.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 theOrderFulfillment.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, seeInclusiveTaxHelper.- Parameters:
item- TheOrderFulfillmentItemto 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, seeInclusiveTaxHelper.- Parameters:
item- TheOrderFulfillmentItemto 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'sOrderFulfillment.grandTotal.This is the
OrderFulfillment#totalFulfillmentPriceandOrderFulfillment#totalTaxplus 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
-
setInclusiveTaxHelper
-