Import Taxes
Contents |
Introduction
For importing taxes in Openbravo ERP, create a text file that defines the taxes. This file must be written following a specific format. This format must be introduced in the application. The file for the import of taxes is a plain text file that will insert data in three tables of the application DB: Tax Category (C_TaxCategory), Tax Business Partner Category (C_BP_TaxCategory) and Tax Rate (C_Tax). It is possible to insert or update data simultaneously in all the tree tables, or in a single one (for example inserting only Tax Categories but not tax rates).
File format by default
It is possible to define files in any format to import taxes, depending on your needs. The format that is most versatile is a plain text file using commas (,) as field delimiter. Each line is a record that contains the following fields:
(Note: some of these fields are mandatory depending on which data is going to be defined. For example, if the file is going to be used to create tax categories (but not tax rates or bp tax categories), only fields 12 and 13 should be filled.)
- 1- Tax Name: mandatory to define Tax Rates. Is the short name that the tax will have.
- 2- Tax Description: used for Tax Rates. It is a description of the tax.
- 3- Tax Indicator: used for Tax Rates. A short indicator for the tax, e.g. VAT.
- 4- Valid from: used for Tax Rates. This field is the first date the tax will be applicable. If a Tax Rate is defined without this field, the current server system date (at importation time) will be used for this field.
- 5- Summary Level: used for Tax Rates. It can be 'Y' or 'N'. 'N' is the default value. When a tax is defined as summary level it can contain child taxes, otherwise it cannot.
- 6- Rate: mandatory to define Tax Rates. It is the percentage value for the tax.
- 7- Parent Tax Name: used for Tax Rates. This field will be filled when a tax with children is defined. The name used here should match exactly the name of the tax wanted to be the parent. Note that if the tax linked by this line does not already exist, it will be automatically created with a rate 0 (zero). This tax should be updated later (in the same or another file or manually).
- 8- Code Country From & 10- Code Country To: used for Tax Rates. These two fields define the country that the tax will be applied from and to. These fields can be filled with the ISO code for the country or with the country name. In both cases it must 'exactly match' with the contents of DB. (Note that field number 9 goes before field number.)
- 9- Code Region From & 11- Code Region To: used for Tax Rates. These two fields define the region that the tax will be applied from and to. These fields can be filled with the name of the region or its value.
- 12- Tax Category Name: used for Tax Rates and Tax Categories. Mandatory in both cases. When a tax rate is defined, this field is the tax category where the tax will be included in. If there is not a tax category with this name a new one will be created.
- 13- Tax Cat. Description: used for Tax Categories. It is a description for the Tax Category.
- 14- BP Tax Cat Name: used for Tax Rates and Business Partner Tax Categories. Mandatory for BP Tax Categories. This field works like field number 12, but it is not mandatory.
- 15- BP Tax Cat Desc.: used for Business Partner Tax Categories. Description for BP Tax Category.
The file format is defined in the application in Master Data Management > Import Data > Import Loader Format.
Another file format
Another example of a tax import file format is defined in the Acceptance Testing document of the wiki (point 1.1.6). Here you can find a script that creates the format, and an example of a text file to import.
This is the aspect of this import format:
File example
An example of file used to import taxes is available here – text file:
VAT 3%,VAT 3%,3,01/01/2000,N,B,,ES,,ES,,VAT 3%,VAT 3%, VAT 10%, VAT 10%,10,01/01/2000,N,B,,ES,,ES,,VAT 10%,VAT 10%, VAT(3)+CHARGE(0.5),VAT(3)+CHARGE(0.5),3.5,01/01/2000,Y,S,,ES,,ES,,VAT 3%,VAT3%,Vat 3%+Charge 0.5% CHARGE 0.5%,CHARGE 0.5%,0.5,01/01/2000,N,S,VAT(3)+CHARGE(0.5),ES,,ES,,VAT 3%,VAT3%,Vat 3%+Charge 0.5% VAT 3%,VAT3%,3,01/01/2000,N,S,VAT(3)+CHARGE(0.5),ES,,ES,,VAT 3%,VAT3%,Vat 3%+Charge 0.5%
This file follows the format defined in the Acceptance Testing document.
Notice that each line in this file belongs to a tax rate to import. Moreover, some tax rates include the tax category to which they belong. If this tax category doesn't exist, it will be created. The same applies to the business partner tax category.
Import operation
Once the tax import format has been created, and so a file with taxes to import following this format, a tax import can be performed: Go to Master Data Management > Import Data > Import File Loader. Choose the file, and format file created. Click on "Ok" to preview the import, and "Process" to perform the import.
Go to Master Data Management > Import Data > Import Taxes, and then click on the "Import Taxes" button.