How to create a Chart of Accounts Module
English | Translate this article...
About this document
This document describes all the necessary steps to create a Chart of Accounts module which are:
- the CSV file creation which contains the account tree structure
- the CSV file testing and validation
- and the packaging of the module.
The document is divided into several chapters and some of them forward to other articles which explain in detail a concrete task related to the creation of the Chart of Accounts module. For a proper understanding, it is mandatory to read all these related articles.
Since Openbravo 2.50, Chart of accounts are distributed using modules, that's why it is important to have a clear understanding of the Modularity Concepts, specially the process of creating and packing modules.
Related to that, it is interesting to follow the Naming guidelines for modules.
Creating a chart of accounts file for Openbravo requires some experience with any spreadsheet software, like LibreOffice Calc. In case you have no experience with this kind of software, we recommend you to read its documentation before trying to create the Chart of Accounts file.
The most difficult part when developing a Chart of Accounts module is clearly the creation of the CSV file containing the account tree.
As you can imagine, this step requires a deep knowledge about the required chart of accounts structure for your country. Once the CSV file is ready, the creation of the chart of accounts module is probably the easiest and fastest tasks in the localization process.
The estimation could be that the 95% of the time required for this task will be invested in the creation and validation of the CSV file. The rest of the time will be used just in the creation of the module. A rough estimate could be 16 hours of a skilled developer.
The chart of accounts (also called account tree) is a list of the accounts available to post entries which can be structured in a way to get meaningful financial reports such as Balance Sheet and P&L.
In some countries it is required to have a specific chart of accounts to be used in the statutory books; in some other countries this legal requirement does not exist and a “sample” chart of accounts should be enough. Finally it should also be possible for a country to have more than one official chart of accounts, depending for example on the organization's size or main activity.
A Chart of Accounts Module for Openbravo can only contain one chart of accounts. So, if you are working in a localization project for a country where several chart of accounts can be used, you must create independent modules including each chart of accounts CSV file. It will be up to the user to install and apply the chart of accounts module that fits his particular needs.
Creating the CSV file
The first step for creating a chart of accounts module is to write the CSV file with the list of accounts we want to include. All the information can be found at the Creating Accounts Files article.
Testing the CSV file.
Before creating the Chart of Accounts module, we should first check that the CSV file has no structural or logical errors. This can be easily done in two steps:
- The first one is using a testing spreadsheet provided by Openbravo that will detect any structural error, like missing search keys, wrong values in Element Level, Parent_Value or Show Value Condition columns, etc.
- The second check can be directly executed through the ERP. It just consists on importing our CSV file when running the Initial Client Setup process.
Finally, there is also recommended to create some accounting entries for every transactional document and ensure the accounting report information is OK.
Please visit the Chart of Accounts Testing article to learn more about these steps.
Creating the Chart of Accounts module
The remaining step is clearly the easiest one, which is just including the CSV file into our Chart of Accounts module.
A Chart of Accounts module is like any other module, but it has just the following considerations:
- The CSV file must be included into the referencedata/accounts/ directory of our module.
- The file must be renamed to COA.csv. So the directory structure for our module should look like:
<module java package name> ├── referencedata │ └── accounts │ └── COA.csv └── src-db └── database └── sourcedata ├── AD_DATASET.xml ├── AD_MENU.xml ├── AD_MODULE_DBPREFIX.xml ├── AD_MODULE_DEPENDENCY.xml ├── AD_MODULE.xml ├── AD_PACKAGE.xml ├── AD_PROCESS_PARA.xml ├── AD_PROCESS.xml └── AD_TREENODE.xml
- When defining the module inside the Application Dictionary, the only important considerations we must have are:
- Set the module type to Module
- Set the Has Chart of Account checkbox
- Remember to add the dependency to Core
Packaging the Chart of Accounts Module
The way to package a chart of accounts module is similar to the standard packaging process for any module, just taking into account the previous particular considerations.
The summarized process is:
- Create the module's definition in the Application Dictionary. You should follow the Naming guidelines for modules. Remember to register the module in case you want to publish it in the Forge
- Set the Has Chart of Account checkbox and add a dependency to Core
- Export the database to create the file structure
- Save the COA.csv file inside the module's referencedata/accounts/ directory. You should manually create this directory structure if necessary.
- Generate the obx file
ant package.module -Dmodule=<module's java package name>
Translating a Chart of Accounts
In some countries it can be useful to have the same chart of accounts translated into several languages. Unfortunatelly Openbravo does not support yet the translation of chart of accounts, although it is in our road map.
If you are in this situation you have two possible workarounds:
- Create several chart of accounts modules for different languages. The structure of the chart of accounts file will be exactly the same, just changing the account names and descriptions for each language. This solution is perfect for companies that want to work in just one language, although there are several official languages in the country. In this case the administrator must decide at the beginning of the ERP implementation, the language to use for the chart of accounts and he will not be able to change it in the future.
- The other possibility is to create just one chart of accounts module and, once applied in an instance, manually translate the elements value inside the Account Tree window. The drawback of this method is that the translation can't be distributed to other instances and the process of translating must be repeated manually, or by the implementation of a script that automatically translates the elements based on the Element Value search key.