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
-
Method Summary
Modifier and TypeMethodDescriptionjavax.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'sOrderFulfillment.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'sOrderFulfillment#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.protected InclusiveTaxHelper
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
setInclusiveTaxHelper
(InclusiveTaxHelper inclusiveTaxHelper) javax.money.MonetaryAmount
sumAdjustments
(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Sum up the fulfillment'sOrderFulfillment.adjustments
.javax.money.MonetaryAmount
sumItemFulfillmentTotals
(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Sum up theOrderFulfillmentItem.fulfillmentTotal
across all of the fulfillment's items.javax.money.MonetaryAmount
sumItemMerchandiseTotalTax
(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Total up theOrderFulfillmentItem#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.
-
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.fulfillmentCharge
plus 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.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 theOrderFulfillmentItem#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 theOrderFulfillmentItem#merchandiseTotalTax
and 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
- TheOrderFulfillmentItem
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, seeInclusiveTaxHelper
.- Parameters:
item
- TheOrderFulfillmentItem
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'sOrderFulfillment.grandTotal
.This is the
OrderFulfillment#totalFulfillmentPrice
andOrderFulfillment#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
-
setInclusiveTaxHelper
-