View source | Discuss this page | Page history | Printable version   
Main Page
Upload file
What links here
Recent changes

PDF Books
Show collection (0 pages)
Collections help


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:

Defining Taxes


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.

Tax Category

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.

Tax Rate

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:

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.

Applying Taxes

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.

Retrieved from ""

This page has been accessed 17,596 times. This page was last modified on 3 April 2012, at 11:00. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.