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 portion of theOrderFulfillment#totalFulfillmentPrice
.javax.money.MonetaryAmount
calculateGrandTotal
(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Calculate the fulfillment'sOrderFulfillment.grandTotal
.javax.money.MonetaryAmount
calculateTotalFulfillmentPrice
(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Calculate the fulfillment'sOrderFulfillment#totalFulfillmentPrice
.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) javax.money.MonetaryAmount
sumTaxDetailTaxCalculated
(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem item, javax.money.CurrencyUnit currencyUnit)
-
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
-
sumTaxDetailTaxableAmount
public javax.money.MonetaryAmount sumTaxDetailTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem item, javax.money.CurrencyUnit currencyUnit) -
sumTaxDetailTaxCalculated
public javax.money.MonetaryAmount sumTaxDetailTaxCalculated(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem item, javax.money.CurrencyUnit currencyUnit) -
calculateFulfillmentTaxableAmount
public javax.money.MonetaryAmount calculateFulfillmentTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment) Calculate the taxable portion of theOrderFulfillment#totalFulfillmentPrice
.- 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
-