Package com.broadleafcommerce.tax.domain
Class TaxInfo
java.lang.Object
com.broadleafcommerce.tax.domain.TaxInfo
- All Implemented Interfaces:
Serializable
Tax information returned from a
TaxProvider
for a single line item.- Author:
- Chad Harchar (charchar)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected javax.money.MonetaryAmount
The amount of this item that is not taxable. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Additional attributes for this tax infojavax.money.MonetaryAmount
The amount of this item that is not taxable.The id of the line item for this tax info.getRate()
The rate that the item was taxed at.The sku code for the item.javax.money.MonetaryAmount
The amount of this item that is taxable and was used to determine the calculated tax.javax.money.MonetaryAmount
The tax calculated for the item.The tax code for the item.Breakdown of taxes for this item.int
hashCode()
boolean
Whether the calculated tax is an estimate.boolean
isExempt()
Indicates if this is exempt from taxes, usually based on a tax exemption code.boolean
Whether the item is taxable.boolean
Indicates if taxes were included in the original price or subtotal passed in.boolean
isVat()
Declares whether the taxes were included in the provided subtotal.void
setAttributes
(Map<String, Object> attributes) Additional attributes for this tax infovoid
setEstimated
(boolean isEstimated) Whether the calculated tax is an estimate.void
setExempt
(boolean isExempt) Indicates if this is exempt from taxes, usually based on a tax exemption code.void
setExemptionAmount
(javax.money.MonetaryAmount exemptionAmount) The amount of this item that is not taxable.void
The id of the line item for this tax info.void
setRate
(BigDecimal rate) The rate that the item was taxed at.void
setSkuCode
(String skuCode) The sku code for the item.void
setTaxable
(boolean isTaxable) Whether the item is taxable.void
setTaxableAmount
(javax.money.MonetaryAmount taxableAmount) The amount of this item that is taxable and was used to determine the calculated tax.void
setTaxCalculated
(javax.money.MonetaryAmount taxCalculated) The tax calculated for the item.void
setTaxCode
(String taxCode) The tax code for the item.void
setTaxDetails
(List<TaxDetail> taxDetails) Breakdown of taxes for this item.void
setTaxIncluded
(boolean taxIncluded) Indicates if taxes were included in the original price or subtotal passed in.void
setVat
(boolean isVat) Declares whether the taxes were included in the provided subtotal.toString()
-
Field Details
-
exemptionAmount
protected javax.money.MonetaryAmount exemptionAmountThe amount of this item that is not taxable.
-
-
Constructor Details
-
TaxInfo
public TaxInfo()
-
-
Method Details
-
getItemId
The id of the line item for this tax info.- Returns:
- The id of the line item for this tax info.
-
getSkuCode
The sku code for the item.- Returns:
- The sku code for the item.
-
getTaxCode
The tax code for the item.- Returns:
- The tax code for the item.
-
isVat
public boolean isVat()Declares whether the taxes were included in the provided subtotal. Note: this is a known misnomer & its value should always align with that ofisTaxIncluded()
. -
isExempt
public boolean isExempt()Indicates if this is exempt from taxes, usually based on a tax exemption code. -
isTaxable
public boolean isTaxable()Whether the item is taxable.- Returns:
- Whether the item is taxable.
-
isEstimated
public boolean isEstimated()Whether the calculated tax is an estimate.- Returns:
- Whether the calculated tax is an estimate.
-
isTaxIncluded
public boolean isTaxIncluded()Indicates if taxes were included in the original price or subtotal passed in. This is often the case with VAT. In other words, if an item costs 20EUR and tax is included, then it is expected that some percentage of 20EUR is tax if the tax rate is greater than zero. This is related to, but separate from,isVat()
. The reason is that VAT may be included or not in the provided item price or subtotal.- See Also:
-
TaxItem#isTaxIncluded()
-
getTaxableAmount
public javax.money.MonetaryAmount getTaxableAmount()The amount of this item that is taxable and was used to determine the calculated tax.- Returns:
- The amount of this item that is taxable and was used to determine the calculated tax.
-
getExemptionAmount
public javax.money.MonetaryAmount getExemptionAmount()The amount of this item that is not taxable.- Returns:
- The amount of this item that is not taxable.
-
getRate
The rate that the item was taxed at.- Returns:
- The rate that the item was taxed at.
-
getTaxCalculated
public javax.money.MonetaryAmount getTaxCalculated()The tax calculated for the item.- Returns:
- The tax calculated for the item.
-
getTaxDetails
Breakdown of taxes for this item.- Returns:
- Breakdown of taxes for this item.
-
getAttributes
Additional attributes for this tax info -
setItemId
The id of the line item for this tax info.- Parameters:
itemId
- The id of the line item for this tax info.
-
setSkuCode
The sku code for the item.- Parameters:
skuCode
- The sku code for the item.
-
setTaxCode
The tax code for the item.- Parameters:
taxCode
- The tax code for the item.
-
setVat
public void setVat(boolean isVat) Declares whether the taxes were included in the provided subtotal. Note: this is a known misnomer & its value should always align with that ofisTaxIncluded()
. -
setExempt
public void setExempt(boolean isExempt) Indicates if this is exempt from taxes, usually based on a tax exemption code. -
setTaxable
public void setTaxable(boolean isTaxable) Whether the item is taxable.- Parameters:
taxable
- Whether the item is taxable.
-
setEstimated
public void setEstimated(boolean isEstimated) Whether the calculated tax is an estimate.- Parameters:
estimated
- Whether the calculated tax is an estimate.
-
setTaxIncluded
public void setTaxIncluded(boolean taxIncluded) Indicates if taxes were included in the original price or subtotal passed in. This is often the case with VAT. In other words, if an item costs 20EUR and tax is included, then it is expected that some percentage of 20EUR is tax if the tax rate is greater than zero. This is related to, but separate from,isVat()
. The reason is that VAT may be included or not in the provided item price or subtotal.- See Also:
-
TaxItem#isTaxIncluded()
-
setTaxableAmount
public void setTaxableAmount(javax.money.MonetaryAmount taxableAmount) The amount of this item that is taxable and was used to determine the calculated tax.- Parameters:
taxableAmount
- The amount of this item that is taxable and was used to determine the calculated tax.
-
setExemptionAmount
public void setExemptionAmount(javax.money.MonetaryAmount exemptionAmount) The amount of this item that is not taxable.- Parameters:
exemptionAmount
- The amount of this item that is not taxable.
-
setRate
The rate that the item was taxed at.- Parameters:
rate
- The rate that the item was taxed at.
-
setTaxCalculated
public void setTaxCalculated(javax.money.MonetaryAmount taxCalculated) The tax calculated for the item.- Parameters:
taxCalculated
- The tax calculated for the item.
-
setTaxDetails
Breakdown of taxes for this item.- Parameters:
taxDetails
- Breakdown of taxes for this item.
-
setAttributes
Additional attributes for this tax info -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-