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
FieldsModifier and TypeFieldDescriptionprotected javax.money.MonetaryAmountThe amount of this item that is not taxable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanAdditional attributes for this tax infojavax.money.MonetaryAmountThe 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.MonetaryAmountThe amount of this item that is taxable and was used to determine the calculated tax.javax.money.MonetaryAmountThe tax calculated for the item.The tax code for the item.Breakdown of taxes for this item.inthashCode()booleanWhether the calculated tax is an estimate.booleanisExempt()Indicates if this is exempt from taxes, usually based on a tax exemption code.booleanWhether the item is taxable.booleanIndicates if taxes were included in the original price or subtotal passed in.booleanisVat()Declares whether the taxes were included in the provided subtotal.voidsetAttributes(Map<String, Object> attributes) Additional attributes for this tax infovoidsetEstimated(boolean isEstimated) Whether the calculated tax is an estimate.voidsetExempt(boolean isExempt) Indicates if this is exempt from taxes, usually based on a tax exemption code.voidsetExemptionAmount(javax.money.MonetaryAmount exemptionAmount) The amount of this item that is not taxable.voidThe id of the line item for this tax info.voidsetRate(BigDecimal rate) The rate that the item was taxed at.voidsetSkuCode(String skuCode) The sku code for the item.voidsetTaxable(boolean isTaxable) Whether the item is taxable.voidsetTaxableAmount(javax.money.MonetaryAmount taxableAmount) The amount of this item that is taxable and was used to determine the calculated tax.voidsetTaxCalculated(javax.money.MonetaryAmount taxCalculated) The tax calculated for the item.voidsetTaxCode(String taxCode) The tax code for the item.voidsetTaxDetails(List<TaxDetail> taxDetails) Breakdown of taxes for this item.voidsetTaxIncluded(boolean taxIncluded) Indicates if taxes were included in the original price or subtotal passed in.voidsetVat(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
-