Package com.broadleafcommerce.tax.domain
Class TaxDetail
java.lang.Object
com.broadleafcommerce.tax.domain.TaxDetail
- All Implemented Interfaces:
Serializable
Detailed tax information for a item, via
TaxInfo. There would be separate
TaxDetail for every tax, i.e., state sales tax, city sales tax.- Author:
- Chad Harchar (charchar)
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTaxDetail(String country, String region, String jurisdictionName, String jurisdictionType, String taxName, javax.money.MonetaryAmount taxableAmount, BigDecimal rate, javax.money.MonetaryAmount taxCalculated, String transactionId, Map<String, Object> attributes, boolean isVat, boolean isExempt) -
Method Summary
Modifier and TypeMethodDescriptionstatic TaxDetail.TaxDetailBuilderbuilder()protected booleanbooleanAdditional attributes for this tax detailThe country for this tax.The jurisdiction name.The jurisdiction type, e.g.getRate()The rate of this tax.The region for this tax.javax.money.MonetaryAmountThe amount that was taxable to determine the calculated tax.javax.money.MonetaryAmountThe calculated tax for this detail.The name of the tax.The transaction ID for this tax detail.inthashCode()booleanisExempt()Indicates if this is exempt from taxes, usually based on a tax exemption code.booleanisVat()Declares whether the taxes were included in the provided subtotal.voidsetAttributes(Map<String, Object> attributes) Additional attributes for this tax detailvoidsetCountry(String country) The country for this tax.voidsetExempt(boolean isExempt) Indicates if this is exempt from taxes, usually based on a tax exemption code.voidsetJurisdictionName(String jurisdictionName) The jurisdiction name.voidsetJurisdictionType(String jurisdictionType) The jurisdiction type, e.g.voidsetRate(BigDecimal rate) The rate of this tax.voidThe region for this tax.voidsetTaxableAmount(javax.money.MonetaryAmount taxableAmount) The amount that was taxable to determine the calculated tax.voidsetTaxCalculated(javax.money.MonetaryAmount taxCalculated) The calculated tax for this detail.voidsetTaxName(String taxName) The name of the tax.voidsetTransactionId(String transactionId) The transaction ID for this tax detail.voidsetVat(boolean isVat) Declares whether the taxes were included in the provided subtotal.toString()
-
Constructor Details
-
TaxDetail
public TaxDetail() -
TaxDetail
protected TaxDetail(String country, String region, String jurisdictionName, String jurisdictionType, String taxName, javax.money.MonetaryAmount taxableAmount, BigDecimal rate, javax.money.MonetaryAmount taxCalculated, String transactionId, Map<String, Object> attributes, boolean isVat, boolean isExempt)
-
-
Method Details
-
builder
-
getCountry
The country for this tax.- Returns:
- The country for this tax.
-
getRegion
The region for this tax. This is often something like a two digit state code, e.g. (CA, TX, NY, etc.)- Returns:
- The region for this tax.
-
getJurisdictionName
The jurisdiction name. This may be a state, city, county, etc.- Returns:
- The tax jurisdiction name.
-
getJurisdictionType
The jurisdiction type, e.g. city, state, county, etc. -
getTaxName
The name of the tax.- Returns:
- The name of the tax.
-
getTaxableAmount
public javax.money.MonetaryAmount getTaxableAmount()The amount that was taxable to determine the calculated tax.- Returns:
- The amount that was taxable to determine the calculated tax.
-
getRate
The rate of this tax.- Returns:
- The rate of this tax.
-
getTaxCalculated
public javax.money.MonetaryAmount getTaxCalculated()The calculated tax for this detail.- Returns:
- The calculated tax for this detail.
-
getTransactionId
The transaction ID for this tax detail. Used to reconcile this tax detail with a specific transaction when using an external tax provider. -
getAttributes
Additional attributes for this tax detail -
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 ofTaxInfo.isTaxIncluded(). -
isExempt
public boolean isExempt()Indicates if this is exempt from taxes, usually based on a tax exemption code. -
setCountry
The country for this tax.- Parameters:
country- The country for this tax.
-
setRegion
The region for this tax. This is often something like a two digit state code, e.g. (CA, TX, NY, etc.)- Parameters:
region- The region for this tax.
-
setJurisdictionName
The jurisdiction name. This may be a state, city, county, etc.- Parameters:
jurisdictionName- The tax jurisdiction name.
-
setJurisdictionType
The jurisdiction type, e.g. city, state, county, etc. -
setTaxName
The name of the tax.- Parameters:
taxName- The name of the tax.
-
setTaxableAmount
public void setTaxableAmount(javax.money.MonetaryAmount taxableAmount) The amount that was taxable to determine the calculated tax.- Parameters:
taxableAmount- The amount that was taxable to determine the calculated tax.
-
setRate
The rate of this tax.- Parameters:
The- rate of this tax.
-
setTaxCalculated
public void setTaxCalculated(javax.money.MonetaryAmount taxCalculated) The calculated tax for this detail.- Parameters:
taxCalculated- The calculated tax for this detail.
-
setTransactionId
The transaction ID for this tax detail. Used to reconcile this tax detail with a specific transaction when using an external tax provider. -
setAttributes
Additional attributes for this tax detail -
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 ofTaxInfo.isTaxIncluded(). -
setExempt
public void setExempt(boolean isExempt) Indicates if this is exempt from taxes, usually based on a tax exemption code. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-