Tax Rules
If you sell products with different tax rates or operate different markets where variable or multiple tax rates apply, you need rules to determine the correct tax rate for an invoice line item. To this end, JustOn Billing & Invoice Management supports tax rules. They provide for tax rate lookups along various combinations of account region, merchant or business entity region, product tax class, product group, etc.
To have the software calculate the taxes based on tax rules, you set up the tax rules that meet your business requirements – usually a dedicated tax rule for every applicable tax rate, including one for reverse charge.
With this respect, the following concepts are important:
- Tax rule
-
Tax rules provide for tax rate lookups along various combinations of account region, merchant or business entity region, product tax class, etc.
Tax rules are applied to invoice line items immediately on creation. JustOn Billing & Invoice Management writes the values for the fields
Tax Rate
,Applied Tax Rule
andTax Code
either directly to the invoice line item (like for the VAT) or creates a tax detail for each applicable tax type (like sales tax). - Tax detail
- A tax detail represents an individual tax data set that is determined for a specific combination of region, tax class, etc., and that is included in the tax calculation for an invoice line item. It is always produced if there are multiple tax types available for the context of a business entity, even if only one is finally applied.
Implementation Details
JustOn Billing & Invoice Management implements tax rules using the custom setting Tax Rules. Tax rules include controlling, source, validity and result parameter fields:
- Controlling fields affect the behavior of the tax calculation.
- Source fields are used to select the best matching tax rule for the current context.
- Validity fields are used to restrict the validity of a tax rule for a certain time frame.
- Result fields are copied to the invoice line item and its tax details.
The following fields are available:
Field | Field Type | Description |
---|---|---|
Name | Result | The name of the tax rule, will be copied to the field Applied Tax Rule on the line item or tax detail.JustOn recommends to keep the name of each tax rule unique and to never change it. |
Type | Controlling | Custom name of a tax type. Types are used to group tax rules to support multiple tax rates per invoice line item. Each group of types is evaluated individually and results in a different tax rate. Required if you use multiple tax rates. |
Start Date | Validity | Optional start date for this tax rule. The value is compared with the service period of invoice line items. An empty start date is allowed. The start date is ignored if you use multiple tax rates. |
End Date | Validity | Optional end date for this tax rule. The value is compared with the service period of invoice line items. An empty end date is allowed. The end date is ignored if you use multiple tax rates. |
Business Entity | Source | Takes the value from the field Business Entity on the invoice to determine the best matching tax rule.If you make use of business entities, all tax rules for the particular business entity must have the business entity field set. |
Invoice Region | Source | Takes the value from the field Region on the invoice to determine the best matching tax rule. |
Invoice Country | Source | Takes the value either from the field Shipping Country or from the field Billing Country on the invoice to determine the best matching tax rule, see Using Billing Address for Tax Calculation.To guarantee the correct spelling of countries, JustOn recommends to use Salesforce's state and country picklists. If you have state and country picklists enabled and configured, make sure to use the country code instead of the country name. |
Invoice State | Source | Takes the value either from the field Shipping State or from the field Billing State on the invoice to determine the best matching tax rule, see Using Billing Address for Tax Calculation.To guarantee the correct spelling of states, JustOn recommends to use Salesforce's state and country picklists. If you have state and country picklists enabled and configured, make sure to use the state code instead of the state name. |
Account Tax Class | Source | Takes the value from the field Account Tax Class on the invoice to determine the best matching tax rule. |
Product Tax Class | Source | Takes the value from the field Product Tax Class on the invoice line item to determine the best matching tax rule. |
Product Group | Source | Takes the value from the field Product Group on the invoice line item to determine the best matching tax rule. |
Tax Rate | Result | The actual tax rate that will be applied with this rule. The tax rate is written to the field Tax Rate on the invoice line item or the field Rate on the tax detail. |
Tax Code | Result | The actual tax code that will be applied with this rule. The tax code is written to the field Tax Code on the invoice line item or the field Tax Code on the tax detail. |
VAT Category Code | Result | A code for categorizing VAT regulations, required for e-invoices (see UNTDID 5305 Duty or tax or fee category code). The VAT category code is written to the field VAT Category Code on the invoice line item or the field VAT Category Code on the tax detail. |
Tax-Relevant Fields on Invoices and Invoice Line Items
All tax-relevant data that is required to determine the best matching tax rule for a given invoice line item is written to the invoice and invoice line item records when the invoice is created.
The sources for the invoice data may include a custom object (as source for the generic invoice run) or the subscription as well as the account. Which data is used depends on the source record that is the first to hold the corresponding information: For example, if the invoice builder first tries to get the data from the GIR source record or the subscription and the data is not available, the builder then tries to retrieve the data from the account.
Invoice Field | Custom Object | Subscription | Account | Example |
---|---|---|---|---|
Region | ON_Region | ON_Region | ON_Region | EU EMEA |
State | ON_ShippingState or ON_BillingState |
Legal State | Shipping State or Billing State |
|
Country | ON_ShippingCountry or ON_BillingCountry |
Legal Country | Shipping Country or Billing Country |
|
Account Tax Class | ON_AccountTaxClass | ON_AccountTaxClass | ON_AccountTaxClass | retail business |
The data for the invoice line item is taken from the object that is used to build the invoice line item.
Invoice Line Item Field | Description | Source Field Name | Example |
---|---|---|---|
Product Tax Class | The tax class of the product | ON_ProductTaxClass | (tax) free reduced full luxury |
Info
The invoice line item field Product Tax Rate is used to hold a fix tax rate that is always applicable and not subject to any conditions.
Tax Rule Evaluation
Tax rules are applied to invoice line items each time you create or update an invoice line item. JustOn Billing & Invoice Management writes the values for the fields Tax Rate
, Applied Tax Rule
and Tax Code
either directly to the invoice line item (like for the VAT) or creates a tax detail for each applicable tax type (like sales tax).
First, JustOn Billing & Invoice Management loads the values of the tax-relevant fields from the account, the subscription, the opportunity, the item, the opportunity product and the product. Then, it evaluates all tax rules that may apply for the business entity of the invoice: They are grouped by type, where each group is evaluated individually. This may result in a best matching tax rule (or none) for each group. When there is only a matching rule from one group, the result is written to the invoice line item. When there are multiple rules, that is, from different groups, JustOn Billing & Invoice Management creates tax details instead.
There are currently three ways for creating and editing invoice line items manually (see Adding Invoice Line Items):
- New, Edit All or New Line Item from Product on the invoice line item related list
- Edit from the invoice line item action menu
Each page allows to select the tax rules automatically, force a tax rule or specify a tax rate manually. The available UI options are determined by the number of the matching tax rules and their types.
The following table illustrates this:
Tax Rate Definition | Business Entity Tax Rule Configuration | Description |
---|---|---|
Drop-down list set to Automatic (w/o user interaction) |
Multiple tax rules for the invoice business entity with multiple types, like: Rule 1: Type=GST, Tax Rate=5%, Business Entity=CA Rule 2: Type=PST, Tax Rate=7%, Business Entity=CA |
If JustOn Billing & Invoice Management detects that the current configuration will result in multiple taxes for the current invoice line item, it will switch to the automatic mode, which does not allow user interaction. |
Drop-down list set toAutomatic orFull (19%) orReduced (7%) |
Multiple tax rules for the invoice business entity with a single type, like: Rule 1: Type=VAT, Tax Rate=19%, Business Entity=DE, Name=Full Rule 2: Type=VAT, Tax Rate=7%, Business Entity=DE, Name=Reduced |
If JustOn Billing & Invoice Management detects that the current configuration will result in a single tax rate, it allows the user to leave it on automatic mode or force JustOn to apply a particular tax rule to the invoice line item.Automatic is preselected for new line items, a particular rule is preselected for existing line items. |
Input field for the tax rate | No applicable tax rules for the business entity found | If there are no applicable tax rules, JustOn Billing & Invoice Management allows to specify the tax rate manually. JustOn recommends to create tax rules, because a manual input of the tax rate may result in errors. |
When using New Line Item from Product, JustOn Billing & Invoice Management takes the value from the field Product2.ON_TaxRate
to specify the tax rate for the invoice line item if there are no applicable tax rules for the business entity.
Info
Manually modifying invoice line items that have been split as a result of time-based tax rules may produce errors. JustOn therefore recommends to delete and recreate the relevant invoice line items.
JustOn Billing & Invoice Management does not recalculate taxes when you use the following business processes:
- Clone invoice
- Clone invoice line item
- Cancel invoice
- Create partial credit
The tax information on the invoice line item and the tax details will be copied to the resulting records.
Determining Best Matching Rule
JustOn Billing & Invoice Management determines the best matching tax rule based on the following order of precedence:
- Account Tax Class
- Product Tax Class
- Invoice Region
- Invoice Country
- Invoice State
- Product Group
If a rule field is empty, the field is ignored.
Assume the following configuration:
Tax Rule | Account Region | Account Country | Product Group |
---|---|---|---|
Rule 1 | EU | Germany | PG1, PG2 |
Rule 2 | EU | PG1, PG2 | |
Rule 3 | PG3 |
Some given values produce the following rule match:
Values | Matching Rule |
---|---|
EU, Germany, PG1 | Rule 1 |
EU, PG1 | Rule 2 |
EU, France, PG2 | Rule 2 |
PG3 | Rule 3 |
EU, PG4 | no match |
Time-Based Tax Rules
Applying start dates and end dates to tax rules, you define validity periods for tax rules. Doing so, you can cover tax rate changes, both permanent or temporary (like, for example, in Switzerland).
Generally, JustOn Billing & Invoice Management rates the tax rules by an algorithm in order to determine the best matching rule. When using start dates and end dates, the algorithm may produce several equally weighted tax rules as "best matching", which differ in their validity periods and tax rates. In this context, the following conditions are important:
- The source fields and controlling fields of the tax rules must be identical.
- Result and validity fields can be different.
- Start dates and end dates must be consistent. That is, the validity must not overlap and there must not be any gaps.
- Leaving start date and end date empty covers all possible service periods.
- Only single tax scenarios (like VAT) support start dates and end dates on tax rules, whereas multiple tax scenarios (like sales tax) ignore start dates and end dates.
The following tax rules for the full tax rate show how to cover the temporary VAT change in Germany, applied in 2020 to mitigate the consequences of the Covid 19-induced lockdown:
Tax Rule | Invoice Region | Start Date | End Date | Tax Rate |
---|---|---|---|---|
Default 19 - 2020 | DE | - | 2020-06-30 | 19.0 |
Default 16 - 2020 | DE | 2020-07-01 | 2020-12-31 | 16.0 |
Default 19 - 2021 | DE | 2021-01-01 | - | 19.0 |
As you see, the tax rules in this example have the same source fields and controlling fields, which makes them equally weighted. The validity fields cover all possible invoice line item service periods without any gaps or ambiguities.
Invoice line items with a service period that spans only one tax rule are left unchanged. For invoice line items that span multiple rules, the taxation rule set on the invoice line item decides how to proceed:
- The taxation rule
Service Period
forces the invoice line items to be split automatically along the validity period. So one invoice line item becomes two – one item with a service period until the deadline date and with the tax rate valid in this service period, and a second item with a new service period starting after the deadline date and with the tax rate valid in the new service period. - Using the taxation rule
End of Service Period
, JustOn does not split the invoice line item and applies the tax rate that is valid at the end of the service period.
Example: Invoice line item split
The following example illustrates this behavior, using the rules above.
Invoice line item before tax rule application:
Field | Value |
---|---|
Unit Price | 100 |
Quantity | 1 |
Service Period Start | 2020-05-01 |
Service Period End | 2020-10-31 |
Billing Factor | 6 |
Resulting invoice line items after tax rule application:
Field | Value | Notes |
---|---|---|
Unit Price | 100 | unchanged |
Quantity | 1 | unchanged |
Service Period Start | 2020-05-01 | unchanged |
Service Period End | 2020-06-30 | corrected according to the validity period of the first tax rule |
Billing Factor | 2 | corrected to two months |
Applied Tax Rule | Default 19 - 2020 | |
Tax Rate | 19.0 |
Field | Value | Notes |
---|---|---|
Unit Price | 100 | unchanged |
Quantity | 1 | unchanged |
Service Period Start | 2020-07-01 | corrected according to the validity period of the second tax rule |
Service Period End | 2020-10-31 | unchanged |
Billing Factor | 4 | corrected to four months |
Applied Tax Rule | Default 16 - 2020 | |
Tax Rate | 16.0 |
When splitting invoice line items, JustOn Billing & Invoice Management adjusts the billing factor of the resulting invoice line items accordingly in a prorated manner. That is, the sum of the resulting billing factors equals the original factor.
Info
Be aware of the following specifics:
- Invoice line items without service period use the invoice date (with a fallback to the current date) to determine the applicable time-based tax rule.
- Manually modifying invoice line items that have been split as a result of time-based tax rules may produce errors. JustOn therefore recommends to delete and recreate the relevant invoice line items.
- Aggregating usage data to invoice line items that have been split as a result of time-based tax rules may produce errors. JustOn therefore recommends to set up the continuous invoice run to not span multiple tax rules.
- Remember to separate bookings by tax rates. For correctly processing your tax bookings, you therefore need individual booking accounts for all applied tax rates.
- According to current regulations, the timing of the tax origin determines which taxation rule to apply. This may depend on the type of product or service you invoice. Contact your tax consultant to determine the appropriate way for your business.
Tax Rules Application
Depending on whether one or multiple tax rules are applicable, the produced results differ.
Single Tax Rate per Invoice Line Item (VAT)
If you do not use the Type
field on the tax rules or use rules only of the same type, JustOn Billing & Invoice Management determines a single best matching tax rule and copies its values directly to the invoice line item.
The fields relate in the following way:
Invoice Line Item Field | Tax Rule Field | Example Value |
---|---|---|
Tax Rate | Tax Rate | 19% |
Applied Tax Rule | Name | Full |
Tax Code | Tax Code | a1396 |
Tax Type | Type | VAT |
Tax Provider | - | Internal |
Multiple Tax Rates per Invoice Line Item (Sales Tax)
JustOn Billing & Invoice Management supports multiple tax rates per invoice line item. This allows for configuring sales taxes for countries like the United States or Canada.
For each tax rate of an invoice line item, the software creates a separate tax detail.
Example Tax Calculation: Sales Tax in British Columbia/Canada
Tax rules:
Name | Business Entity | Invoice Country | Invoice State | Type | Tax Rate | Tax Code |
---|---|---|---|---|---|---|
GST | CA | Canada | BC | GST | 5% | a1 |
PST BC | CA | Canada | BC | PST | 7% | b2 |
Applying these rules, the invoice line item will have two tax details.
Resulting invoice line item:
Invoice Line Item Field | Tax Rule Field | Resulting Value | Description |
---|---|---|---|
Tax Rate | Tax Rate | 12% |
The sum of the two tax rates (5%+7%=12%) |
Applied Tax Rule | Name | GST,PST BC |
Comma-separated list of all applied rules (sorted alphabetically) |
Tax Code | Tax Code | a1,b2 |
Comma-separated list of all tax codes (sorted alphabetically) |
Tax Type | Type | Combined |
In case of tax details, always set to Combined |
Tax Provider | - | Internal |
The provider that calculates the taxes. |
Resulting tax detail 1:
Tax Rule Field | Tax Detail Field | Value |
---|---|---|
- | Invoice Line Item | <ID> |
Type | Name | GST |
Tax Rate | Rate | 5% |
Name | Applied Tax Rule | GST |
Tax Code | Tax Code | a1 |
- | Provider | Internal |
Resulting tax detail 2:
Tax Rule Field | Tax Detail Field | Value |
---|---|---|
- | Invoice Line Item | <ID> |
Type | Name | PST BC |
Tax Rate | Rate | 7% |
Name | Applied Tax Rule | PST |
Tax Code | Tax Code | b2 |
- | Provider | Internal |
Example Tax Rules: Sales Tax Configuration for Canada
Name | Business Entity | Invoice Country | Invoice State | Type | Tax Rate |
---|---|---|---|---|---|
GST | CA | Canada | AB,ON,BC,MB,NT,NU,QC,SK,YT | GST | 5.0% |
HST | CA | Canada | NB,NL,NS,PE | HST | 15.0% |
HST ON | CA | Canada | ON | HST ON | 13.0% |
PST BC | CA | Canada | BC | PST BC | 7.0% |
PST SK | CA | Canada | SK | PST SK | 6.0% |
QST | CA | Canada | QC | QST | 9.975% |
RST MB | CA | Canada | MB | RST MB | 8.0% |
To support such scenarios, you usually need to
- define tax rules, grouping them using the
Type
field in order to enable multiple tax rates, - add the tax type to the
Tax Label
field of the template, and - optionally, print the tax breakdown table on the invoice PDF.
Info
To facilitate the management of complex sales tax rules, JustOn Billing & Invoice Management allows for retrieving tax data from an external tax provider. Currently, it can integrate with the AvaTax service from Avalara as external tax provider.