Skip to content

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 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 JustOn calculate the taxes based on tax rules, you set up the tax rules that meet your business requirements.

With this respect, the following concepts are important:

Tax rules provide for tax rate lookups along various combinations of account region, merchant or business entity region, product tax class, etc.

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.

Tax rules are applied to invoice line items immediately on creation. JustOn 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).

Info

For general information about JustOn's tax capabilities, see JustOn Tax Handling.

Tax Rule Concepts

JustOn 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 Required 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 () Corresponds to the field Business Entity on the invoice.
If you use the business entity feature, all tax rules for the particular business entity must have the business entity field set.
Invoice Region Source Corresponds to the field Region on the invoice.
Invoice Country Source Corresponds either to the field Shipping Country or to the field Billing Country on the invoice, 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, make sure to use the country code instead of the country name.
Invoice State Source Corresponds either to the field Shipping State or to the field Billing State on the invoice, 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, make sure to use the state code instead of the state name.
Account Tax Class Source Corresponds to the field Account Tax Class on the invoice.
Product Tax Class Source Corresponds to the field Product Tax Class on the invoice line item.
Product Group Source Corresponds to the field Product Group on the invoice line item.
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.

Tax-Relevant Fields on Invoices and Invoice Line Items

All tax-relevant data that is required to determine the tax for a specific line item is written to the invoice and invoice line item records when the invoice is created.

The source objects for the invoice data include the Opportunity, Subscription and Account objects (in this order). Which data is used depends on the source object that is the first to hold the corresponding information: For example, if the invoice builder first tries to get the data from the subscription and the data is not available, the builder then tries to retrieve the data from the account.

Invoice Field Opportunity 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, like an opportunity product or a product record.

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
Product Tax Rate The tax rate of the product ON_ProductTaxRate 19%

Info

Depending on your given data, you can use either the product tax class or the product tax rate.

How Tax Rules Are Applied

Tax rules are applied to invoice line items each time you create or update an invoice line item. JustOn 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).

Start Dates and End Dates on Tax Rules

Applying start dates and end dates to tax rules, you define validity periods for tax rules. Doing so, you can cover both permanent or temporary tax rate changes.

Generally, JustOn 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, introduced 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 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 Rule Evaluation During the Invoice Run

First, JustOn 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 creates tax details instead.

Manual Creation/Modification of Invoice Line Items

There are currently three ways for creating and editing invoice line items manually (see Modifying Invoice Line Items):

  • New Invoice Line Item or Edit at the line item related list,
  • Edit All, and
  • New Line Item from Product.

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 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 to
Automatic or
Full (19%) or
Reduced (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 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 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 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.

Cloning Invoices

JustOn 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 are copied to the resulting records.

Determining Best Matching Rule

The best matching tax rule is determined 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

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 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 supports multiple tax rates per invoice line item. This allows for configuring sales taxes for countries like the United States or Canada.

To this end, you need to

For each tax rate of an invoice line item, JustOn 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%

Defining Tax Rules

Depending on your organization's requirements, you must define tax rules.

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Tax Rules.

  3. Click New.
  4. Specify the details as necessary.

    See Tax Rule Concepts.

  5. Click Save.

Managing Taxation Rules

As of JustOn 2.67, invoice line items include the Taxation Rule picklist. The taxation rule decides how to process invoice line items that span multiple time-based tax rules.

Info

For businesses in Germany, 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.

Taxation Rule Description
Service Period Forces the invoice line items to be split automatically along the tax rule 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.
Set as default value.
End of Service Period Does not split the invoice line item and applies the tax rate that is valid at the end of the service period.

The taxation rule is intended to be set on invoice line item creation. If not set explicitly, JustOn applies the default taxation rule.

Enabling Taxation Rule During Invoice Run

When creating invoice line items (automatically) during the invoice run, you usually define the applicable taxation rule on the source records.

  • If you create invoices from subscriptions, you set the taxation rule in the item field Taxation Rule. For the automatic subscription build, create the custom field ON_TaxationRule on the source object to allow setting the rule on item generation.
  • If you create invoices using the generic invoice run, you must create the custom field ON_TaxationRule on the source object. This allows setting setting the rule on invoice line item generation.

Info

You can use formulas, custom processes or other automation tools to have ON_TaxationRule set automatically.

Enabling Taxation Rule on Manual Invoice Line Item Creation

Your business may require to create invoice line items manually and, when doing so, specifying the taxation rule. Notice, however, that the Taxation Rule field is not available on the New Invoice Line Item page. To work around this restriction, you add the Taxation Rule field to the Edit All field set. This allows for using the Edit All dialog to create new invoice line items, specifying the taxation rule.

To add the Taxation Rule field to the Edit All field set:

  1. Navigate to the field sets definition of the Invoice Line Item object.

    In Salesforce Lightning, navigate to Setup > Object Manager > Invoice Line Item > Field Sets.

    In Salesforce Classic, navigate to Setup > Create > Objects > Invoice Line Item > Field Sets.

  2. Click Edit in the Edit All row.

  3. Move the Taxation Rule field to the In the Field Set container.
  4. Click Save.

    This applies the field set configuration, making the Taxation Rule field available on the Edit All dialog.

Changing Default Taxation Rule

The installation default taxation rule is Service Period for subscription items and invoice line items. If not explicitly set otherwise on creation, JustOn, consequently, splits the produced invoice line item along the tax rule validity period. Your business may, however, require End of Service Period as the default approach: to not split the invoice line item and to apply the tax rate that is valid at the end of the service period.

You can define which taxation rule JustOn uses by default. To this end, you change the default value of the Taxation Rule picklist on the Invoice Line Item object, or, if necessary, on the Item object:

  1. Navigate to the fields list of the Item object or the Invoice Line Item object, respectively.
  2. Click the name of the Taxation Rule field.
  3. In the Values section, click Edit in the row of the value to be the new default.
  4. Select the Default checkbox.
  5. Click Save.

    This makes the selected taxation rule the default approach. JustOn, consequently, applies this rule if you do not explicitly set another rule.

Using Billing Address for Tax Calculation

By default, JustOn matches the fields Invoice Region, Invoice Country and Invoice State against the shipping address fields of the invoice. This is useful if you sell non-digital goods and use the shipping address fields to determine the physical location of the buyer.

If you sell digital goods, however, and use the billing address only, you can tell JustOn to match against the billing address fields:

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Global Settings.

  3. Click Edit in the Default row.
  4. Select the checkbox Use Billing Address for Tax.
  5. Click Save.

Note

This is a global option that cannot be reversed for a single invoice, subscription or account.

Adding Tax Type to Tax Label

If multiple taxes are applied, you can add the tax type to the invoice PDF by adding the placeholder [TaxType] to the Tax Label field of the invoice template.

  1. Open the template to be edited.
  2. In the Line Items section, double-click the Tax Label field and modify the tax label as required.

    Alternatively, you can click Edit in the detail view to edit the field.

    To display, for example, the tax rate and the tax type, specify this string:

    Tax ([TaxRate] [TaxType])
    
  3. Click Save.

Displaying Tax Breakdown Table

If multiple taxes are applied, JustOn can print the tax breakdown table on the invoice PDF. This table contains one line for each applied tax rule. The amount is the sum of all taxes of the same rule. The table is sorted first by the tax type and then by the applied tax rule.

To configure the tax breakdown table display in the invoice template, use the following fields:

Field Description Default Value
Tax Table Checkbox to enable or disable the tax table display on the invoice
Tax Table Text An introductory text for the tax table The composition of the taxes is presented on the following table.
Tax Table Columns Defines the tax detail fields (API names) to be displayed as columns in the tax table, separated by semicolon.
To display the local currency, add LocalAmount.
Name;AppliedTaxRule__c;Rate__c;Amount__c

Before using the tax breakdown table, you may have to add the corresponding fields to the template layout:

  1. Navigate to the object management settings of the Template object.
  2. Click Page Layouts.
  3. In the row of Template Layout, click Edit.
  4. Drag the fields Tax Table, Tax Table Columns and Tax Table Text to the Line Items section.
  5. Click Save to save the modified page layout.

For help about modifying page layouts, see Managing Pages.

To configure the tax table display:

  1. Open the template to be edited.
  2. Click Edit in the detail view.
  3. Modify the values for Tax Table, Tax Table Text and Tax Table Columns as required.
  4. Click Save.

Setting Tax Rates on Opportunity Product, Product or Item

If there is no matching tax rule, it is still possible to set the tax rate from the opportunity product, the product or the subscription item. To do so, add the ON fields ON_TaxRate and ON_TaxClass to one of the objects.

  1. Navigate to the fields list for the intended object.
  2. Create the following new fields.

    API Name Data Type Description
    ON_TaxRate Percent (3,3) The value will be copied to the field Product Tax Rate on the invoice line item.
    ON_TaxClass Text (255) The value will be copied to the field Product Tax Class on the invoice line item.

    For help about creating fields, see Managing Object Fields.

Info

If the tax rate fields are available on multiple objects, the values defined on the opportunity product take precedence.

Using Invoice Region to Control Tax Rules

Your business may require to use individual tax rules for specific invoice regions. To do so, you determine the invoice region based on certain criteria. Consequently, you can apply the tax rule as defined for the region.

Assume the following example: There are four tax situations, for which you need individual tax rules that yield a specific tax rate.

Tax Situation Tax Rule Tax Rate Invoice Region
Germany, tax ID available or not available DE-VAT 19% DE
EU country, tax ID not available EU-VAT 19% EU
Reverse charge applicable, tax ID available RC 0% RC
Non-EU country, tax ID not available NON-EU 0% NON-EU

Now, the invoice region determines the tax rule to apply for an account. So you must identify the region based on the account's billing country.

To this end, you create the formula field ON_Region on the Account object:

  1. Navigate to the fields list for the Account object.
  2. Create the following new field.

    API Name Data Type Description
    ON_Region Formula (Text) Determines the invoice region. The produced value will be copied to the field Region on the invoice.

    For help about creating fields, see Managing Object Fields.

Example: B2B scenario

In B2B scenarios, you can use the following formula to determine the invoice region (given that ONB2__TaxNumber__c specifies the tax ID).

With respect to taxation rules and depending on your type of business, you may handle Switzerland like a EU country, adding "CH","EU" to the country list in the formula.

IF(ISPICKVAL(BillingCountryCode,"DE"), "DE",
    IF(CASE(TEXT(BillingCountryCode),
        "AT","EU",
        "BE","EU",
        "BG","EU",
        "CY","EU",
        "CZ","EU",
        "DK","EU",
        "EE","EU",
        "ES","EU",
        "FI","EU",
        "FR","EU",
        "GB","EU",
        "GR","EU",
        "HU","EU",
        "IE","EU",
        "IT","EU",
        "HR","EU",
        "LT","EU",
        "LU","EU",
        "LV","EU",
        "MT","EU",
        "NL","EU",
        "PL","EU",
        "PT","EU",
        "RO","EU",
        "SE","EU",
        "SI","EU",
        "SK","EU",
        "SM","EU",
        "NON-EU")
        = "NON-EU", "NON-EU",
        IF(ISBLANK(ONB2__TaxNumber__c), "EU", "RC")
    )
)

Based on the billing country as defined for the account, this formula produces either DE, EU, RC or NON-EU as the value for the region.

Example: B2B scenario, using VAT number validation

If your org has enabled JustOn's VAT number validation, you can use the following formula to determine the invoice region, provided that the VAT validation has produced a result (true or false).

With respect to taxation rules and depending on your type of business, you may handle Switzerland like a EU country, adding "CH","EU" to the country list in the formula.

IF(ISPICKVAL(BillingCountryCode,"DE"), "DE",
    IF(CASE(TEXT(BillingCountryCode),
        "AT","EU",
        "BE","EU",
        "BG","EU",
        "CY","EU",
        "CZ","EU",
        "DK","EU",
        "EE","EU",
        "ES","EU",
        "FI","EU",
        "FR","EU",
        "GB","EU",
        "GR","EU",
        "HU","EU",
        "IE","EU",
        "IT","EU",
        "HR","EU",
        "LT","EU",
        "LU","EU",
        "LV","EU",
        "MT","EU",
        "NL","EU",
        "PL","EU",
        "PT","EU",
        "RO","EU",
        "SE","EU",
        "SI","EU",
        "SK","EU",
        "SM","EU",
        "NON-EU")
        = "NON-EU", "NON-EU",
        IF(ONB2__VATIsValid__c = true, "RC", "EU")
    )
)

Based on the billing country as defined for the account, this formula produces either DE, EU, RC or NON-EU as the value for the region.

Example: B2C scenario, electronic goods

The scenario may be more complex. Assume, for example, your org sells electronic goods or services to individuals. In this case, local taxes apply in the EU, as explained in When and where to charge VAT?. Consequently, you need a tax rule for every possible EU billing country, and your region formula must yield the billing country for EU accounts without tax ID.

To support this use case, you can use the following formula to determine the invoice region (given that ONB2__TaxNumber__c specifies the tax ID).

With respect to taxation rules and depending on your type of business, you may handle Switzerland like a EU country, adding "CH","EU" to the country list in the formula.

IF(ISPICKVAL(BillingCountryCode,"DE"), "DE",
    IF(CASE(TEXT(BillingCountryCode),
        "AT","EU",
        "BE","EU",
        "BG","EU",
        "CY","EU",
        "CZ","EU",
        "DK","EU",
        "EE","EU",
        "ES","EU",
        "FI","EU",
        "FR","EU",
        "GB","EU",
        "GR","EU",
        "HU","EU",
        "IE","EU",
        "IT","EU",
        "HR","EU",
        "LT","EU",
        "LU","EU",
        "LV","EU",
        "MT","EU",
        "NL","EU",
        "PL","EU",
        "PT","EU",
        "RO","EU",
        "SE","EU",
        "SI","EU",
        "SK","EU",
        "SM","EU",
        "NON-EU")
        = "NON-EU", "NON-EU",
        IF(ISBLANK(ONB2__TaxNumber__c), TEXT(BillingCountryCode), "RC")
    )
)

Based on the billing country as defined for the account, this formula produces either DE, NON-EU, RC or the individual billing country code as the value for the region.

Info

This functionality requires Salesforce's state and country picklist to be enabled for your org.

Note

Be aware that these formulas are examples. You may have to adjust them according to your business use case.

Configuring G/L Account

You can configure the G/L account to respect the fields Applied Tax Rule and Tax Code on the invoice line item.

Be aware of the following aspects:

  • The fields are not set if there is no best matching tax rule or the tax rate has been taken from the product.
  • Applied Tax Rule and Tax Code hold a comma-separated list in case of multiple taxes per line item.