ERP 2.50:Functional Documentation/Financial Management/Taxes
This document discusses how taxes are defined, the logic used to automatically apply them and the resulting effects when documents (such as invoices) are processed.
The normal work flow to define and use taxes includes these steps:
- Create Tax Categories.
- Create Tax Rates into these categories, in a hierarchical way.
- Associate Products to the Tax Categories.
- Create Business Partner (BP) Tax Categories, if necessary.
- Associate these BP Tax Categories to partners (as vendor/creditor or customer).
- Associate BP Tax Categories to Tax Rates.
There are three important concepts for taxes in Openbravo: tax categories, tax rates and business partner tax categories.
A tax category groups similar tax rates. A tax rate must belong to a tax category, and it, optionally, may belong to a business partner tax category. When creating a product, a suitable tax category for that product should be defined. When filling in a document window, products added to the invoice will have specific tax rates associated. This allows different products to have different tax rates.
Additionally, one or more tax rates can be defined for a specific business partner, through business partner tax categories. Then, when creating a new document, if this business partner is chosen, with a business partner tax category, the system will apply one of these tax rates to the product in the invoice.
The Tax Category provides a method for grouping and managing similar tax rates. For example, Sales Tax or Value Added Tax 16%. Every tax rate and every product is in a tax category so when a product is chosen in an order or invoice, a tax with the same tax category is associated to it. Later, we will see why Openbravo chooses one rate or another, from among the available tax rates of the same tax category.
BP Tax Category
Business Partner Tax Category is used to define tax categories that are associated to one or more concrete business partners. A business partner may or may not have an associated business partner tax category. Moreover, a business partner can only have one business partner tax category, or just one as a vendor and another one as a customer. Business Partner Tax Category can be associated to taxes as well. A tax with a business partner tax category will only be applied to partners within the same category. If the tax does not have a business partner tax category defined, that tax will be applied to any partner.
That is how you create special taxes that will be applied to some specific partners.
This window is used to define taxes. Every tax rate is in a tax category, and it is possible to define more than one tax rate for a tax category.
Tax rates are the only valid taxes for products. When we create a new document and we add a product to it, the system will determine which tax is suitable for that product, business partner, country, and region. Users can keep this selection, or select a different tax rate. Different products may have different tax rates as well. We can see a summary of the tax rates applied to each product found in a specific document by clicking on the “Tax” tab.
Tax rates can be defined as individual taxes (applying only one tax) or as summary type that are applied at the same time to more than one tax. We will see an example below:
The configuration of a tax rate is done filling in the following fields:
- Name (Mandatory): The name for the tax rate.
- Description: A description for the tax rate.
- Valid from (Mandatory): The first day that the tax rate will be valid from. When taxes are automatically applied, the applied tax is the one with the most recent date relative to the current date.
- Cascade: This is used for summary type taxes. If it is not selected, the base for calculating the price after tax, will be the basic price; if it is selected, the base will be the price after applying the previous taxes for the same parent.
- Line No.: In summary type taxes, it is the sequence for dependent taxes.
- Tax Category (Mandatory): It is the tax category where the tax range is included.
- Summary Level: If it is checked, the tax rate is defined as a parent tax that has dependent taxes: the child taxes. If a tax is not going to have any “children,” it should not be checked as summary.
- Parent Tax: This field is only showed if the tax is not defined as summary level. It is used for defining the parent of the tax. Note that this type of tax cannot be applied directly; only complete trees can be applied (a parent with all its children).
- Tax exempt: Taxes defined as exempt will be assigned when the business partner of the document is checked as tax exempt.
- SO/PO Type: Defines which type of transaction this tax will be applied to (Sales, Purchases or Both).
- Rate (Mandatory): It is the percentage of the base price that is paid as tax.
- BP Tax Category: If this field is not blank this tax will only be applied to those Business Partners that have the same category as the tax (for vendor or customer depending on the case). If it is blank it can be applied to any Business Partner.
- Country and Region (to and from): For taxes that are applied to specific geographic zones. If there is only one zone it is filled in the header fields, if there are more than one Tax, the zone tab is used.
There are applicable and unapplicable Tax Rates. This means that some Tax Rates can be directly applied and others are used to define details for applicable ones. The applicable taxes are those defined as summary, and ones that are not summary and have no parent (these ones are simple taxes and note: simple taxes should not be checked as summary). The inapplicable taxes are the ones that have a parent tax.
Additional information on how to set up taxes and examples can be found in the Configuration Manual.
Taxes are applied to orders and invoices. In this process there are two steps: associate the desired tax to the line and process the document that will apply the tax and calculate the actual amount.
Obtaining default tax
When in a document line (order or invoice) a product is selected, a default tax is associated to this line. Keep in mind that we can select the tax we want for this line. The selection of the default tax is achieved by the C_GetTax DB stored procedure. The rules followed by this procedure are as follows:
For sale transactions with an associated project, if a project has a tax rate, this tax rate will be taken. This works when an order is generated by a Project (Order). In this case the tax it is taken directly from the project line tax. For sale transactions, if a partner is marked as tax exempt, the selected tax will be the one checked as exempt with the most recent dated relative to the ordered or invoiced date.
Otherwise, the tax is selected from the ones defined in the same tax category as the product on the line. Taxes with defined business partner tax category can only be applied to those business partners with the same tax category (for vendor or customer). If the tax does not have a business partner tax category, it can be applied to any partner (with or without an associated tax category). If a tax with business partner tax category and another one without it can both be applied, the one with business partner tax category will be selected. In addition to this, the “to” and “from” locations are taken into account. At first those taxes defined for closer regions are selected (if a tax is for region and another one for country, the region one will be selected). This information is associated to the tax rate, through the “Tax Zone” tab. Taxes are applied taking into account if they are defined as Sales, Purchases or Both.
Once the tax is selected (the default one, or another one selected by the user), an approximated amount is calculated by the SL_Order_Tax or SL_Invoice_Tax callouts. If the tax is checked as summary, the calculation will be done using the rate defined in the parent, not exploding it and taking the real values from its children. In addition, information c_order_tax and c_invoice_tax tables are populated with taxes at this point. The actual amount is calculated when the document is processed.
When creating a new invoice, it is possible to write down taxes manually and check them as “no recalculate”. In this case the tax will be applied with the amount written down in the tax tab of the invoice, so no recalculation will be done while processing the invoice. When a tax in an invoice is marked as recalculated, if the tax is edited manually all changes will be lost when processing the invoice. This is because the tax amount of the invoice is recalculated. “No recalculate” taxes are not associated to any invoice line, where as the recalculted ones are. So when a tax comes from a line, it will be checked as recalculate. If it is manually created, it won't be checked, and this value will be not updateable.
No recalculating taxes is useful for invoices that include tax lines without a product. For example, it can be used for imported products: these products usually have an invoice that is tax exempt and another invoice that is created by the custom broker without any product, but a tax amount for the imported products.
Calculating actual amount
When these documents are processed (c_order_post and c_invoice_post), the actual taxes and amounts are calculated from the selected taxes (unless they are defined as “no recalculate” for invoices) following these steps:
Every tax at C_OrderTax or C_InvoiceTax tables is deleted. This is done because the taxes in these tables before the process of the document are for information only and can be inaccurate.
A new line is created in C_OrderTax or C_InvoiceTax tables for every different tax applied to the lines of the document (each line will have only one tax). The amount paid to the tax is calculated from the base amount of the lines that are associated to this tax.
For taxes defined as summary, a new line is inserted for each of its children and the amount is calculated taking into account whether or not the children are cascade.