Class TaxInfo

java.lang.Object
com.broadleafcommerce.tax.domain.TaxInfo
All Implemented Interfaces:
Serializable

public class TaxInfo extends Object implements Serializable
Tax information returned from a TaxProvider for a single line item.
Author:
Chad Harchar (charchar)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected javax.money.MonetaryAmount
    The amount of this item that is not taxable.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    Additional attributes for this tax info
    javax.money.MonetaryAmount
    The amount of this item that is not taxable.
    The id of the line item for this tax info.
    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
     
    boolean
    Whether the calculated tax is an estimate.
    boolean
    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
    Declares whether the taxes were included in the provided subtotal.
    void
    Additional attributes for this tax info
    void
    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
    setItemId(String itemId)
    The id of the line item for this tax info.
    void
    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
    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.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • exemptionAmount

      protected javax.money.MonetaryAmount exemptionAmount
      The amount of this item that is not taxable.
  • Constructor Details

    • TaxInfo

      public TaxInfo()
  • Method Details

    • getItemId

      public String getItemId()
      The id of the line item for this tax info.
      Returns:
      The id of the line item for this tax info.
    • getSkuCode

      public String getSkuCode()
      The sku code for the item.
      Returns:
      The sku code for the item.
    • getTaxCode

      public String 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 of isTaxIncluded().
    • 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

      public BigDecimal 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

      public List<TaxDetail> getTaxDetails()
      Breakdown of taxes for this item.
      Returns:
      Breakdown of taxes for this item.
    • getAttributes

      public Map<String,Object> getAttributes()
      Additional attributes for this tax info
    • setItemId

      public void setItemId(String itemId)
      The id of the line item for this tax info.
      Parameters:
      itemId - The id of the line item for this tax info.
    • setSkuCode

      public void setSkuCode(String skuCode)
      The sku code for the item.
      Parameters:
      skuCode - The sku code for the item.
    • setTaxCode

      public void setTaxCode(String taxCode)
      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 of isTaxIncluded().
    • 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

      public void setRate(BigDecimal rate)
      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

      public void setTaxDetails(List<TaxDetail> taxDetails)
      Breakdown of taxes for this item.
      Parameters:
      taxDetails - Breakdown of taxes for this item.
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Additional attributes for this tax info
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object