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

PropertyReturnsDescription
countryRatesMap<String,BigDecimal>The configured tax rates by country code.
defaultRateBigDecimalThe fallback tax rate used when the sale's country has no configured rate.
detailedDescriptionStringA formatted summary of the configured country rates and default rate.
idStringThe identifier for this provider, used in forms where the admin selects it.
managementPageTemplateStringPath to the template used to render this provider's management page in the admin UI.
titleStringThe 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.

ParameterDescription
adjustedPriceExTaxthe price of the item excluding tax, not used by this provider
productInStoreListthe product's listing in the e-commerce store, not used by this provider
pilthe product's listing in the inventory location it is shipping from, not used by this provider
salethe 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.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.