Class InclusiveTaxHelper
java.lang.Object
com.broadleafcommerce.orderoperation.service.util.InclusiveTaxHelper
Utility to facilitate getting inclusive taxes from 
FulfillmentItemTaxDetail and
 OrderFulfillmentItemTaxDetail. Includes predicates for filtering inclusive/exclusive
 taxes, filtering merchandise/fulfillment taxes, and summing tax/taxable amount fields. This class
 only includes methods that are needed by the framework. Extensions of this class can use the
 included predicates to easily compose new tax calculation methods as needed.
 Duplicate methods of this class may be found in OrderServices.- Author:
- Cade Rea (cade-rea)
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringDefault name of theTaxDetailfor taxes associated with fulfillment, shipping, and handling.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected <T> javax.money.MonetaryAmountcalculateTaxesWithPredicates(Stream<T> stream, Predicate<T> isFulfillmentTaxPredicate, Predicate<T> isTaxInclusivePredicate, Function<T, javax.money.MonetaryAmount> fieldPredicate, javax.money.CurrencyUnit currency) javax.money.MonetaryAmountgetAllIncludedTax(com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem, javax.money.CurrencyUnit currency) Get the sum of all (merchandise and fulfillment) inclusive taxes from the givenFulfillmentItem.javax.money.MonetaryAmountgetAllIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment) Get the sum of all (merchandise and fulfillment) inclusive taxes from the givenOrderFulfillment.javax.money.MonetaryAmountgetFulfillmentIncludedTax(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup) Get the sum of inclusive fulfillment taxes from the givenFulfillmentGroup.javax.money.MonetaryAmountgetFulfillmentIncludedTax(com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem, javax.money.CurrencyUnit currency) Get the sum of inclusive fulfillment taxes from the givenFulfillmentItem.javax.money.MonetaryAmountgetFulfillmentIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment) Get the sum of fulfillment inclusive taxes from the givenOrderFulfillment.protected Stringjavax.money.MonetaryAmountgetMerchIncludedTax(com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem, javax.money.CurrencyUnit currency) Get the sum of inclusive merchandise taxes from the givenFulfillmentItem.javax.money.MonetaryAmountgetMerchIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment) Get the sum of merchandise inclusive taxes from the givenOrderFulfillment.javax.money.MonetaryAmountgetMerchIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem orderFulfillmentItem, javax.money.CurrencyUnit currency) Get the sum of inclusive merchandise taxes from the givenOrderFulfillmentItem.protected booleanisExclusiveTax(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail taxDetail) protected booleanisExclusiveTax(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail taxDetail) protected booleanisFulfillmentFeeTaxDetail(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail taxDetail) protected booleanisFulfillmentFeeTaxDetail(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail taxDetail) protected booleanisFulfillmentTaxName(String taxName) protected booleanisInclusiveTax(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail taxDetail) protected booleanisInclusiveTax(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail taxDetail) protected booleanisMerchandiseTaxDetail(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail taxDetail) protected booleanisMerchandiseTaxDetail(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail taxDetail) protected booleanprotected javax.money.MonetaryAmountsumTaxableAmount(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail fulfillmentItemTaxDetail) protected javax.money.MonetaryAmountsumTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail orderFulfillmentItemTaxDetail) protected javax.money.MonetaryAmountsumTaxCalculated(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail fulfillmentItemTaxDetail) protected javax.money.MonetaryAmountsumTaxCalculated(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail orderFulfillmentItemTaxDetail) 
- 
Field Details- 
DEFAULT_FULFILLMENT_TAX_NAMEDefault name of theTaxDetailfor taxes associated with fulfillment, shipping, and handling.- See Also:
 
 
- 
- 
Constructor Details- 
InclusiveTaxHelperpublic InclusiveTaxHelper()
 
- 
- 
Method Details- 
getAllIncludedTaxpublic javax.money.MonetaryAmount getAllIncludedTax(com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem, javax.money.CurrencyUnit currency) Get the sum of all (merchandise and fulfillment) inclusive taxes from the givenFulfillmentItem.- Parameters:
- fulfillmentItem- The- FulfillmentItemon which to operate.
- currency- The currency of the operation.
- Returns:
- The sum of inclusive taxes on the given FulfillmentItem.
 
- 
getMerchIncludedTaxpublic javax.money.MonetaryAmount getMerchIncludedTax(com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem, javax.money.CurrencyUnit currency) Get the sum of inclusive merchandise taxes from the givenFulfillmentItem.- Parameters:
- fulfillmentItem- The- FulfillmentItemon which to operate.
- currency- The currency of the operation.
- Returns:
- The sum of inclusive merchandise taxes from the given FulfillmentItem.
 
- 
getMerchIncludedTaxpublic javax.money.MonetaryAmount getMerchIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment) Get the sum of merchandise inclusive taxes from the givenOrderFulfillment.- Parameters:
- orderFulfillment- The- OrderFulfillmentto operate on.
- Returns:
- The sum of merchandise inclusive taxes from the given OrderFulfillment.
 
- 
getFulfillmentIncludedTaxpublic javax.money.MonetaryAmount getFulfillmentIncludedTax(com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem, javax.money.CurrencyUnit currency) Get the sum of inclusive fulfillment taxes from the givenFulfillmentItem.- Parameters:
- fulfillmentItem- The- FulfillmentItemon which to operate.
- currency- The currency of the operation.
- Returns:
- The sum of inclusive fulfillment taxes from the given FulfillmentItem.
 
- 
getFulfillmentIncludedTaxpublic javax.money.MonetaryAmount getFulfillmentIncludedTax(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup) Get the sum of inclusive fulfillment taxes from the givenFulfillmentGroup.- Parameters:
- fulfillmentGroup- The- FulfillmentGroupwhose- FulfillmentItem'scontain the fulfillment taxes as- FulfillmentItemTaxDetails.
- Returns:
- The sum of inclusive fulfillment taxes from the given FulfillmentGroup.
 
- 
getAllIncludedTaxpublic javax.money.MonetaryAmount getAllIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment) Get the sum of all (merchandise and fulfillment) inclusive taxes from the givenOrderFulfillment.- Parameters:
- orderFulfillment- The- OrderFulfillmentto operate on.
- Returns:
- The sum of all (merchandise and fulfillment) inclusive taxes from the given
         OrderFulfillment.
 
- 
getFulfillmentIncludedTaxpublic javax.money.MonetaryAmount getFulfillmentIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment) Get the sum of fulfillment inclusive taxes from the givenOrderFulfillment.- Parameters:
- orderFulfillment- The- OrderFulfillmentto operate on.
- Returns:
- The sum of fulfillment inclusive taxes from the given OrderFulfillment.
 
- 
getMerchIncludedTaxpublic javax.money.MonetaryAmount getMerchIncludedTax(com.broadleafcommerce.order.client.domain.OrderFulfillmentItem orderFulfillmentItem, javax.money.CurrencyUnit currency) Get the sum of inclusive merchandise taxes from the givenOrderFulfillmentItem.- Parameters:
- orderFulfillmentItem- The- OrderFulfillmentItemon which to operate.
- currency- The currency of the operation.
- Returns:
- The sum of inclusive merchandise taxes from the given OrderFulfillmentItem.
 
- 
calculateTaxesWithPredicates
- 
sumTaxCalculatedprotected javax.money.MonetaryAmount sumTaxCalculated(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail fulfillmentItemTaxDetail) 
- 
sumTaxCalculatedprotected javax.money.MonetaryAmount sumTaxCalculated(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail orderFulfillmentItemTaxDetail) 
- 
sumTaxableAmountprotected javax.money.MonetaryAmount sumTaxableAmount(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail fulfillmentItemTaxDetail) 
- 
sumTaxableAmountprotected javax.money.MonetaryAmount sumTaxableAmount(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail orderFulfillmentItemTaxDetail) 
- 
isInclusiveTaxprotected boolean isInclusiveTax(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail taxDetail) 
- 
isExclusiveTaxprotected boolean isExclusiveTax(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail taxDetail) 
- 
isInclusiveTaxprotected boolean isInclusiveTax(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail taxDetail) 
- 
isExclusiveTaxprotected boolean isExclusiveTax(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail taxDetail) 
- 
passthroughFilter
- 
isFulfillmentFeeTaxDetailprotected boolean isFulfillmentFeeTaxDetail(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail taxDetail) 
- 
isMerchandiseTaxDetailprotected boolean isMerchandiseTaxDetail(com.broadleafcommerce.cart.client.domain.FulfillmentItemTaxDetail taxDetail) 
- 
isFulfillmentFeeTaxDetailprotected boolean isFulfillmentFeeTaxDetail(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail taxDetail) 
- 
isMerchandiseTaxDetailprotected boolean isMerchandiseTaxDetail(com.broadleafcommerce.order.client.domain.OrderFulfillmentItemTaxDetail taxDetail) 
- 
isFulfillmentTaxName
- 
getFulfillmentTaxName
 
-