DatevImportService.ktThe orchestration service for DATEV-style Excel imports. Coordinates the import pipeline for both Kontenplan (chart of accounts) and Buchungssätze (accounting records). Manages the import lifecycle: parse (import), validate (reconcile), and persist (commit). All operations require the FIBU_DATEV_IMPORT user right.
| Dependency | Role |
|---|---|
PfPersistenceService | Persistence context management |
AccessChecker | User right verification |
KontoDao | Commit kontenplan entries; resolve account numbers |
Kost1Dao | Passed to BuchungssatzExcelImporter |
Kost2Dao | Passed to BuchungssatzExcelImporter |
BuchungssatzDao | Commit buchungssatz entries; lookup existing records |
| Method | Input | Output |
|---|---|---|
importKontenplan(inputStream, filename) | Excel InputStream | ImportStorage<KontoDO> |
importBuchungsdaten(inputStream, filename) | Excel InputStream | ImportStorage<BuchungssatzDO> |
Both methods open an ExcelWorkbook from the input stream, create an ImportStorage with logging configuration, delegate to the respective importer class (KontenplanExcelImporter / BuchungssatzExcelImporter), and return the populated storage.
| Method | Description |
|---|---|
reconcile(storage, sheetName) | Dispatches to reconcileKontenplan() or reconcileBuchungsdaten() based on storage type. Sets numberOfCommittedElements to -1. |
Reconciliation matches imported elements with existing database entries:
KontoDO by account number. Found entries are stored as oldValue on the import element and their created timestamp is copied to the import (needed by BaseDao to determine insert vs update).year, month, satznr) using buchungssatzDao.getBuchungssatz().| Method | Description |
|---|---|
commit(storage, sheetName) | Requires RECONCILED status. Dispatches to commitKontenplan() or commitBuchungsdaten(). Sets status to IMPORTED. |
Commit collects selected elements, sets the database id from oldValue if the entry already exists, and bulk-inserts via the DAO in blocks of 50.
DatevImportService.Type: KONTENPLAN, BUCHUNGSSAETZE. Used as a discriminator in ImportStorage.
| Constant | Properties |
|---|---|
KONTO_DIFF_PROPERTIES | nummer, bezeichnung |
BUCHUNGSSATZ_DIFF_PROPERTIES | satznr, betrag, sh, konto, kost2, menge, beleg, datum, gegenKonto, text, kost1, comment |
All public methods call checkLoggedinUserRight() which verifies UserRightId.FIBU_DATEV_IMPORT with value TRUE. The companion object provides static helper methods for use in Wicket pages (pre-service decoupling).
868d6abb7 2025 -> 2026 312d5e61c Clean-up 63081666f Source file headers: 2024-> 2025. 1012e347a Migration stuff in progress... (all tests of all packages: OK). bbc198d03 Migration stuff in progress... (all tests of all packages: OK). 4bc37b3a1 Migration stuff in progress... d67bce18b Migration stuff in progress... 1b50060c3 BaseDao: renamed: get -> find, save -> insert, getList -> select, load -> select 87aaf6a5a Migration stuff in progress... BaseDao refactored (not yet finished) 3aeda5ef5 Big change: all save|update|...InTrans renamed (InTrans removed).