View source | Discuss this page | Page history | Printable version   

AEAT190/Technical Documentation



Purpose of the project

The purpose of this project is to create a new module for generating the Spanish official 190 withholding report (Modelo 340) valid file. This module will be part of the Spanish Professional Localization Pack.

Modelo 190 report includes withholdings and payments on account of income from employment and economic activities, prizes and certain capital gains and income allocations.

It must be submitted to the Tax Authorities on a yearly basis within the January month. This report includes all the operations done during the previous year.

The report can be submitted through Internet using a valid format Modelo 190 file.

On line submission implies that the Spanish companies must have a Tax ID as well as a user Certificate X.509.V3 issued by FNMT or any other valid Certificate according to tax authorities requirements.

Modules definition

Modelo 190 will be split in two different modules: one compatible with Openbravo 2.50 old flows, and the other one mainly compatible with Advanced Payables and Receivables and ready to work with data migrated from the old financial flow.

The module compatible with APRM will have 2 different major versions to work with Openbravo 2.50 and Openbravo 3.

Differences between Openbravo 3 and 2.50 versions

The module and backport for APRM versions of the Modelo 190 module are quite similar, having both of them exactly the same functionality. However, from a development perspective they have two important differences that make it impossible to share the same module for both Openbravo Core versions.

Finally, the module for the old flow will just use the C_DebtPayment records that are linked to a bank statement line or a cash journal line. This module version must be run in Openbravo 2.50 with the old financial flow (instance that does not have the APR module installed).

Important: Take into account that APRM compatible modules are also compatible with the old financial flow data (if any). So the generated report will automatically merge the payment data from both financial flows in a migrated environment with no intervention needed from the user.

Changes in Core or other modules

There is no need to adapt other modules for developing Modelo 190 report

Database code

There is no need to create any database artifact like tables, views, functions or triggers. All the development is done using Java code.

Java code

This module uses the framework available in the Tax Report Launcher. This basically means that we need to have Java class that implements the OBTL_TaxReport_I interface and dataset that defines the input and constant parameters, and the relationship between tax parameters and tax rates in the application.

Aeat190 classdiagram.png

The AEAT190Report class implements the OBTL_TaxReport_I interface and it's the most important one because it contains all the business logic for generating the 190 file. The generateElectronicFile() method is the entry point to the class, that will first of all initialize the class attributes (initializeAttibutes method) and check all the data for launching the report is OK (checkData method). After that, the generateRegister1Line() and generateRegister2Line() methods are called to create the valid structure file for the Modelo 190.

The AEAT190Report class delegates all the access to the data stored in the database using DAL (Hibernate) to the AEAT190ReportDao class.

There are several beans that help managing all the information involved in the report:

Finally, the AEAT190_Utility is an utility class with common public static methods used during the development

Dataset structure

The dataset, with an organization data access level, will contain the relevant information for 190 report of the following tables:

The Tax Report definition (inside the Tax Report configuration window), will just contain a record for the yearly basis 190 report associated with the class.

Three groups will be available:

Retrieved from ""

This page has been accessed 3,631 times. This page was last modified on 17 January 2012, at 12:43. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.