Processing taxes

Link copied to clipboard

There are two methods for calculating taxes: inclusive and exclusive. Inclusive means that the rate in the price list is defined with all the applicable taxes included; so then a single xDR is produced, and the total amount in the xDR includes both charges for services and the taxes applied to them. In the exclusive method, the rate is defined without any taxes, and the total amount in the xDR includes only charges for services. Taxes are calculated later on, and added as separate xDRs.

With PortaBilling you can use both methods simultaneously to produce the same final result. In the examples given below, you will notice that, although different taxation methods are used, the information on the invoice looks the same. Deciding which method to use for a specific group of customers depends on various aspects of the two methods, which are explained in detail below.

Inclusive rate (single xDR containing charges and tax)

Link copied to clipboard

When you enter rates into PortaBilling, you can define them in such a way that they incorporate the necessary charges and applicable taxes. For example, if your price is $0.10 per minute and there is 20% VAT, the rate will be entered as $0.12 ($0.10 + 20%), as illustrated below. When the customer is charged, the total amount in the xDR will then include the appropriate amount of taxes. In our example below, the customer makes a 15-minute call, which is charged at $1.80 – this amount includes both service charges and taxes.

Invoice generation

When the invoice is created, the tax information must be properly presented to the customer. Since the total amount of the invoice and the tax rate are known, the actual amount of tax and the pre-tax amount can be “back-calculated”. In our example, we assume that there was only one charge during the billing period, so that the invoice total is also $1.8; but it works exactly the same way if there are multiple transactions in the billing period, too. By applying the tax calculation formulas, PortaBilling determines that, since the invoice total is $1.80 and the tax rate is 20%, the pre-tax amount was $1.50 and the amount of tax $0.30.

Inclusive rate

This method is ideal for prepaid services. Since every xDR produced contains the tax amount, charges and taxes are debited from the customer’s balance immediately after the service is rendered. This is also convenient for European countries, where customers are used to seeing all prices as “final.”

The inclusive rate functionality is available with these taxation plugins:

  • Fixed VAT rate;
  • Custom taxation. Enable the “Tax included into rates/fees” option

Exclusive rate (separate xDRs for charges and taxes)

Link copied to clipboard

In this case, the prices you enter in the system exclude any tax information, and so when PortaBilling processes a billing event, the charged amount recorded in the xDR is likewise exclusive of tax. Instead, the taxation process is launched later, when closing the billing period for a given customer (this is actually the final step in closing the billing period process, after all other operations, such as charging recurring subscription fees, have been completed). All the customer’s transactions during the billing period are retrieved and analyzed, and the appropriate taxes are assessed. These tax charges are added to the customer’s account as separate records (xDRs), and then appear on the invoice along with the other charges.

Invoice generationExclusive rate

This method allows greater flexibility when dealing with complex taxation (for instance, when the tax is not simply a percentage of the price). It is more suitable for postpaid customers, since tax amounts are applied to the balance only at the end of the billing period. It is also the preferred method for customers in the US and Canada, who are used to seeing prices without tax and having tax amounts added to a bill separately.

Since taxation rules differ from country to country, PortaBilling supports a system of plug-in tax modules. When you configure a taxation plug-in for a customer class, you instruct PortaBilling how to calculate and apply taxes to your customers: as either included or excluded in the rates.

Currently, PortaBilling supports plug-ins for VAT (fixed percentage) and custom taxation, as well as the EZtax suite, Avalara, and the SureTax taxation plug-ins. The latter three enable correct calculation of US state, country, and city taxes, as well as special items such as federal USF, etc.

Unified invoice templates

Link copied to clipboard

Since taxes are configured by customer classes, the invoice templates in PortaBilling are unified and apply to all taxation plug-ins. This makes invoicing configurations transparent and simplifies customer management.

Previously configured invoice templates are preserved for backward compatibility for information purposes and are available as read-only.

VAT

Link copied to clipboard

Fixed VAT rate is a taxation system that is used worldwide. The Fixed VAT Rate allows you to add a certain percentage of value-added tax. For inclusive rates, the defined percentage of tax is back-calculated from the charged amount.

Rounding
Link copied to clipboard

By default, the tax amount for fixed VAT Rate taxation plug-in rounds upward. PortaBilling® rounds the tax amount to the pre-defined number of digits applicable to the customer class currency. For example, if the customer class currency is USD which rounding precision is 0.01 (2 decimals), then 1.204, 1.205, and 1.206 all round up to 1.21.

Fixed VAT Rate rounding

Also, you can change the default rounding method to apply mathematical rounding in the Stats.Tax_Rounding_Method option on the Configuration server. For example, if mathematical rounding is applied and the customer class currency is USD which rounding precision is 0.01 (2 decimals), then 1.204 rounds to 1.20, 1.205, and 1.206 round to 1.21.

Custom taxation

Link copied to clipboard

This taxation plug-in is similar to VAT and is specifically designed for those who need to apply different taxes depending on the type of charges (e.g., tax differently for recurring and usage charges). You can specify your own name and percentage rate value for this tax. You can apply it to:

  • all services;
  • all services except for subscriptions and credits/adjustments;
  • only to subscriptions.
Rounding
Link copied to clipboard

By default, the tax amount for custom taxation plug-in rounds upward. PortaBilling rounds the tax amount to the pre-defined number of digits applicable to the customer class currency. For example, if the customer class currency is USD which rounding precision is 0.01 (2 decimals), then 1.204, 1.205 and 1.206 all round up to 1.21.

Custom taxation plug-in rounding

Also, you can change the default rounding method to apply mathematical rounding in the Stats.Tax_Rounding_Method option on the Configuration server. For example, if mathematical rounding is applied and the customer class currency is USD which rounding precision is 0.01 (2 decimals), then 1.204 rounds to 1.20, 1.205 and 1.206 round to 1.21.

Using the EZtax suite with PortaBilling

Link copied to clipboard

To use EZtax suite, you must first sign a contract with EZtax company (their tax solution is a paid subscription service; please mention that you are a PortaOne customer to receive special pricing and other promotions) and obtain the EZtax libraries for installation on your server. After EZtax suite has been enabled in the PortaBilling configuration, the following will be done for all customers with EZtax assigned as the taxation method:

  1. All accumulated transactions (xDRs, refunds, etc.) will be sent to EZtax suite along with the customer’s information (which is used to determine his tax jurisdiction).
  2. EZtax suite will calculate all applicable taxes and send them back to PortaBilling, so that they can be inserted as extra xDRs for the given customer (each type of tax will produce a separate record; thus if both state and city taxes are applicable, there will be two separate transactions).
  3. PortaBilling will then proceed to generate the invoice as usual.

In order to tax services properly, xDRs are mapped to EZtax transaction /service codes, which define what type of taxes apply to a given transaction. The current logic of mapping XDRs is as follows:

  1. If neither the CLI (origination number or ANI) nor the CLD (destination number or DNIS) record of the call event matches the North America Numbering Plan (NANP) format (i.e. the phone number should start with 1 followed by a 3-digit area code (NPA), then a 3-digit exchange prefix (NXX), and finally a 4-digit number), then this is considered to be an international call, and the VoIP International Usage (19, 51) transaction/service code is used.
  2. If either the CLI or CLD matches the 1-NPA-NXX-NNNN pattern, but the given NPA-NXX combination is not found in the EZtax address database (this usually means that, even though the phone number starts with 1, it belongs to some other country – for instance, the Dominican Republic), the VoIP International Usage (19, 51) transaction/service code is likewise used
  3. Then the location identifier for CLI and CLD are compared further:
    • If the CLI and CLD are identified as belonging to different countries, the VoIP International Usage (19, 51) transaction/service code is applied (calls from/to Canada fall under this category).
      Calls between the USA and Puerto Rico are defined as calls of the interstate type, and the VoIP Interstate Usage (19, 49) transaction/service code applies.
    • Then the state attributes in the location information are compared for CLI and CLD. If both CLI and CLD are reported as belonging to the same state, the VoIP Intrastate Usage (19, 50) transaction/service code is used; otherwise the VoIP Interstate Usage (19, 49) code is applied.
EZtax suite updates
Link copied to clipboard

EZtax company provides their customers with regular updates and PortaBilling facilitates automatic updating of EZtax suite. This provides a safe and reliable way of updating EZtax suite with no unanticipated issues emerging during tax calculation.

There are two options for the EZtax suite installation directory:

  • Installation to the system’s default folder.
  • Installation to a separate folder for each of the system’s environments.

Thus if more than one company is hosted on one common system, each company may be associated with an individual EZtax contract. This provides the ability for installing particular versions of EZtax software with corresponding updates for each separate environment. Therefore, during tax calculation the folder for the environment will be checked first, and if the folder does not exist, all of the operations will be performed within the default folder.

Tax calculation via Avalara

Link copied to clipboard

Avalara is one of the largest tax calculation companies in the USA. Tax calculation via Avalara is done using the XML API. Your taxation configuration is stored within Avalara and all taxes are calculated by the Avalara middleware. This significantly simplifies taxation management for your administrators.

The tax calculation process is as follows:

  • PortaBilling sends all customer xDRs, along with customer location information, to Avalara using the API.
  • Avalara calculates the taxes and then returns those calculations to PortaBilling.
  • PortaBilling uses this tax information to generate xDRs for taxes and then produce invoices.

Avalara calculates taxes based on the customers’ tax jurisdiction, which is determined using PCodes – permanent jurisdiction codes. These PCodes are obtained from the customer’s location (the ZIP code) and the CLI/CLD numbers in xDRs using the code mapping table provided by Avalara. This ensures accurate tax calculation.

If CLI/CLD numbers are not present in the xDRs (e.g., an xDR for subscription charges or manual credit), the customer’s location PCode is used.

As a result of tax calculation, PortaBilling receives summarized taxes grouped by tax type (e.g., federal, state, etc.) and generates separate xDRs for each tax type.

Configuration
Link copied to clipboard

To enable tax calculation via Avalara, first establish the account with Avalara. Contact the Avalara support team to ac