Skip to content

Latest commit

 

History

History

imixs-adapters-datev

DATEV Adapter

This adapter module provides services to import and export data from DATEV. The import feature allows the import of DATEV master data like 'Kontenbeschriftungen'. The export feature allows the export of workflow invoice data into a DATEV file (Buchungstapel).

DATEV Import

The imixs-datev-adapter provides mechanisms to import DATEV data. The import is based on the standard DATEV-Format which provides different data in CSV files.

The DataImportService

The DatevImportService EJB provides methods to read a Datev-Format file and import the data.

// test if supported CSV file?
if (file.getName().endsWith(".csv")) {
	ByteArrayInputStream input = new ByteArrayInputStream(file.getContent());
	String result = datevImportService.importData(input, "ISO-8859-1");
	getImportData().replaceItemValue("log", result);
} else {
	throw new PluginException(this.getClass().getName(), DatevImportService.IMPORT_ERROR,
			"File Format not supported: " + file.getName());
}

The column 'Formatname' will be mapped to the item 'type'.

Client and Consultant ID

A DATEV-Format file contains a header with different information. The Datev 'Berater' and 'Mandant' are mapped to each imported dataset

  • Berater = _datev_consultant_id
  • Mandant = _datev_client_id

This item fields which are part of each imported datev dataset can be used to import data from different sources. The data can be selected by the items. There for the items must be added into the imixs.properties entry: 'lucence.indexFieldListNoAnalyze'

 lucence.indexFieldListNoAnalyze=....,_datev_client_id,_datev_consultant_id

Query DATEV data

Data can be selected by a query based on the type and the categories. See the following example:

(type:"Kontenbeschriftungen" AND _datev_client_id:"00001" AND _datev_consultant_id:"00001")

DATEV Export

The DATEV Export is generated by a SignalAdapter within a Invoice Workflow model.

org.imixs.workflow.datev.adapter.DATEVRefAddAdapter

The adapter automatically verifies if a DATEV Export for the current booking period and the datev.client_id already exists. If not, the adapter creates a new one.

The DATEV Export Workflow can be fully controlled by the user

This model must at least define an initial Task with the following Events:

  • add Invoice reference = 100
  • remove invoice reference = 200

To remove a linked invoice the RemoveAdapter can be used.

org.imixs.workflow.datev.adapter.DATEVRefRemoveAdapter

To execute a SEPA Export the ExecuteAdatper can be used

org.imixs.workflow.datev.adapter.DATEVExecuteAdapter

XSL Transformation

The DATEV file is generated using the imixs-report functionality. The DATEV report is assigned with a XSLT file to generate the output. The DATEV file format is standardized. The DATEV interface is not public and not open source!

For the DATEV Standard CSV export one report need to be defined. For the DATEV XML format two reports a necessary. The report for invoices defines the invoice selection and the XSL to transform one invoice into the corresponding XML file. Thre report for documents is needed to define the XSLT definition to generate the XML file Dokument.xml.

**Note: ** The DATEV interface is not public and not open source! You need the official DATEV documentation to get information how the CSV and XML files have to be designed.

XML Data Source

The xml data source is generated by the set of selected invoices defined by report definition and the DATEV export workitem itself. So the number of data entries is the count of invoices +1. DATEVasdfDDD To identify the type of document you can make use of the xsl select statement:

....
<xsl:template
	match="/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'DATEV-Export']">
	....
</xsl:template>

<xsl:template
	match="/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'Rechnungseingang']">
	....
</xsl:template>
.....

Maven

The imxis-adapter-sepa module can be added into an applicaton module. The module provides CDI and EJB components. Optional the module contains also JSF pages to be used for frontends.

Add the following maven dependency into a parent project:

<!-- DATEV Adapter -->
<dependency>
	<groupId>org.imixs.workflow</groupId>
	<artifactId>imixs-adapters-datev</artifactId>
	<version>${org.imixs.adapters.version}</version>
	<scope>provided</scope>
</dependency>