Default tax calculation provider, looking up a tax rate by the sale's country with a configurable fallback rate. Holds a map of country code to tax rate plus a default rate used when the sale's country is not present or has no configured rate. Sales with no country recorded return null unless the default rate applies. Configured per store and serialised as XML under the "default-tax-calc" alias.
Group: E-commerce
Implements: TaxCalcProvider
Properties
| Property | Returns | Description |
|---|---|---|
| countryRates | Map<String,BigDecimal> | The configured tax rates by country code. |
| defaultRate | BigDecimal | The fallback tax rate used when the sale's country has no configured rate. |
| detailedDescription | String | A formatted summary of the configured country rates and default rate. |
| id | String | The identifier for this provider, used in forms where the admin selects it. |
| managementPageTemplate | String | Path to the template used to render this provider's management page in the admin UI. |
| title | String | The user friendly title for this tax calc provider. |
Methods
getId()
Returns: String
The identifier for this provider, used in forms where the admin selects it.
getTitle()
Returns: String
The user friendly title for this tax calc provider.
getDetailedDescription()
Returns: String
A formatted summary of the configured country rates and default rate.
calcTaxRate(BigDecimal adjustedPriceExTax, ProductInEComStore productInStoreList, ProductInLocation pil, ISale sale)
Returns: BigDecimal
Calculates the tax rate for the sale, looking up the sale's country in the configured country rates first, then falling back to the configured default rate.
| Parameter | Description |
|---|---|
adjustedPriceExTax | the price of the item excluding tax, not used by this provider |
productInStoreList | the product's listing in the e-commerce store, not used by this provider |
pil | the product's listing in the inventory location it is shipping from, not used by this provider |
sale | the sale the tax rate is being calculated for |
getCountryRates()
Returns: Map<String,BigDecimal>
The configured tax rates by country code.
getDefaultRate()
Returns: BigDecimal
The fallback tax rate used when the sale's country has no configured rate.
getManagementPageTemplate()
Returns: String
Path to the template used to render this provider's management page in the admin UI.