Class DatevExportService
- java.lang.Object
-
- org.imixs.workflow.datev.export.DatevExportService
-
@DeclareRoles("org.imixs.ACCESSLEVEL.MANAGERACCESS") @RunAs("org.imixs.ACCESSLEVEL.MANAGERACCESS") public class DatevExportService extends ObjectDer DatevExportService stellt methoden für den Datev export bereitUnter anderem werden metadaten berechnet.
_stapelzeitraum_start und _stapelzeitraum_ende markieren die äterste und die jüngste Rechnung. Diese Daten weren für die DATEV Kopf Datei benötigt.
Change: 13.01.2021
Belegbilder dürfen immer nur einmal in der documents.xml drin stehen auch wenn diese mehrfach in verschiedenne Buchungssätzen verwendet werden. Daher prüfen wir beim Aufbau der documents.xml ob das belegbild schon generiert wurde.
- Version:
- 1.0
- Author:
- rsoika
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHILD_ITEM_PROPERTYstatic StringITEM_DATEV_BOOKING_PERIODstatic StringITEM_DATEV_CLIENT_IDstatic StringITEM_DATEV_CONSULTANT_IDstatic StringITEM_DATEV_FISCAL_STARTstatic StringITEM_DATEV_KONTENLAENGEstatic StringITEM_DBTR_NAMEstatic StringITEM_FTP_ERRORstatic StringITEM_FTP_HOSTstatic StringITEM_FTP_PASSWORDstatic StringITEM_FTP_PATH_UPLOADstatic StringITEM_FTP_PORTstatic StringITEM_FTP_USERstatic StringMODEL_ERRORstatic StringREPORT_ERROR
-
Constructor Summary
Constructors Constructor Description DatevExportService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildCSVFile(org.imixs.workflow.ItemCollection datevExport, List<org.imixs.workflow.ItemCollection> data, String key, org.imixs.workflow.ItemCollection configuration)This method builds an DATEV CSV export file containing all given invoicesvoidbuildDocumentsZipFile(org.imixs.workflow.ItemCollection datevExport, List<org.imixs.workflow.ItemCollection> data, String key, org.imixs.workflow.ItemCollection configuration)This method builds the datev zip file containing the XML documents definition and also all attachments.org.imixs.workflow.ItemCollectionbuildExportWorkitem(org.imixs.workflow.ItemCollection configuration, String modelVersion, int taskID, List<org.imixs.workflow.ItemCollection> data)This method builds the export workitem.StringcomputeKey(org.imixs.workflow.ItemCollection invoice)Helper Method to copute the grouping key (MandantID+Buchungsperiode)org.imixs.workflow.ItemCollectionfindDatevExport(String datevKey)Prüft alle offenen Datev Exporte und gibt den neuesten zur angegebenen Datev Client ID zurück, oder null falls es keinen Offenen Datev Export gibt.org.imixs.workflow.FileDatagetWorkItemFileFromWorkitem(org.imixs.workflow.ItemCollection invoice)This method first lookups the origin workItem from the given export data entity.org.imixs.workflow.ItemCollectionloadConfiguration(String name)Loads the DATEV configuration entity by name.org.imixs.workflow.ItemCollectionprocessDatevExport(org.imixs.workflow.ItemCollection datevExport)Aktualisiert den DATEV Export mit Manager RechtenbooleanputFileData(org.imixs.workflow.FileData fileData, org.imixs.workflow.ItemCollection configuration, String subDirectory, org.imixs.workflow.ItemCollection datevExport, int ftpType)This method exports a fildata object to a ftp server defined by the configuration ItemCollection.org.imixs.workflow.ItemCollectionupdateExportWorkitem(org.imixs.workflow.ItemCollection datevExport, org.imixs.workflow.ItemCollection configuration, List<org.imixs.workflow.ItemCollection> data)This method Updates the export workitem
-
-
-
Field Detail
-
ITEM_DATEV_KONTENLAENGE
public static final String ITEM_DATEV_KONTENLAENGE
- See Also:
- Constant Field Values
-
ITEM_FTP_HOST
public static final String ITEM_FTP_HOST
- See Also:
- Constant Field Values
-
ITEM_FTP_PORT
public static final String ITEM_FTP_PORT
- See Also:
- Constant Field Values
-
ITEM_FTP_USER
public static final String ITEM_FTP_USER
- See Also:
- Constant Field Values
-
ITEM_FTP_PASSWORD
public static final String ITEM_FTP_PASSWORD
- See Also:
- Constant Field Values
-
ITEM_FTP_PATH_UPLOAD
public static final String ITEM_FTP_PATH_UPLOAD
- See Also:
- Constant Field Values
-
ITEM_FTP_ERROR
public static final String ITEM_FTP_ERROR
- See Also:
- Constant Field Values
-
ITEM_DATEV_CLIENT_ID
public static final String ITEM_DATEV_CLIENT_ID
- See Also:
- Constant Field Values
-
ITEM_DATEV_BOOKING_PERIOD
public static final String ITEM_DATEV_BOOKING_PERIOD
- See Also:
- Constant Field Values
-
ITEM_DATEV_CONSULTANT_ID
public static final String ITEM_DATEV_CONSULTANT_ID
- See Also:
- Constant Field Values
-
ITEM_DATEV_FISCAL_START
public static final String ITEM_DATEV_FISCAL_START
- See Also:
- Constant Field Values
-
ITEM_DBTR_NAME
public static final String ITEM_DBTR_NAME
- See Also:
- Constant Field Values
-
CHILD_ITEM_PROPERTY
public static final String CHILD_ITEM_PROPERTY
- See Also:
- Constant Field Values
-
REPORT_ERROR
public static final String REPORT_ERROR
- See Also:
- Constant Field Values
-
MODEL_ERROR
public static final String MODEL_ERROR
- See Also:
- Constant Field Values
-
-
Method Detail
-
updateExportWorkitem
public org.imixs.workflow.ItemCollection updateExportWorkitem(org.imixs.workflow.ItemCollection datevExport, org.imixs.workflow.ItemCollection configuration, List<org.imixs.workflow.ItemCollection> data)This method Updates the export workitemThe datev client id is fetched from the first invoice of the invoice data collection.
Change 5.5.2022 Die Beraternummer kann nun auch auf Corporate Ebene gepflegt werden. Ist das der Fall, dann gewinnt diese Nummer. Andernfalls wird weiterhin die Beraternummer aus der Zentralen DATEV Config genommen.
- Parameters:
configuration-modelVersion-taskID-data-- Returns:
-
buildDocumentsZipFile
public void buildDocumentsZipFile(org.imixs.workflow.ItemCollection datevExport, List<org.imixs.workflow.ItemCollection> data, String key, org.imixs.workflow.ItemCollection configuration) throws org.imixs.workflow.engine.scheduler.SchedulerException, org.imixs.workflow.exceptions.PluginExceptionThis method builds the datev zip file containing the XML documents definition and also all attachments. The zip-file is finally attached into the datevExport workitem.Change: 13.01.2021
Belegbilder dürfen immer nur einmal in der documents.xml drin stehen auch wenn diese mehrfach in verschiedenne Buchungssätzen verwendet werden. Daher prüfen wir beim Aufbau der documents.xml ob das belegbild schon generiert wurde.
- Parameters:
data-- Throws:
org.imixs.workflow.engine.scheduler.SchedulerExceptionorg.imixs.workflow.exceptions.PluginException
-
buildCSVFile
public void buildCSVFile(org.imixs.workflow.ItemCollection datevExport, List<org.imixs.workflow.ItemCollection> data, String key, org.imixs.workflow.ItemCollection configuration) throws org.imixs.workflow.engine.scheduler.SchedulerExceptionThis method builds an DATEV CSV export file containing all given invoices- Parameters:
data-- Throws:
org.imixs.workflow.engine.scheduler.SchedulerException
-
putFileData
public boolean putFileData(org.imixs.workflow.FileData fileData, org.imixs.workflow.ItemCollection configuration, String subDirectory, org.imixs.workflow.ItemCollection datevExport, int ftpType) throws org.imixs.workflow.engine.scheduler.SchedulerExceptionThis method exports a fildata object to a ftp server defined by the configuration ItemCollection.Das Zielverzeichnis wird mit der MAndanten ID ergänzt!
- Parameters:
timer-- Throws:
org.imixs.workflow.exceptions.QueryExceptionorg.imixs.workflow.engine.scheduler.SchedulerException
-
buildExportWorkitem
public org.imixs.workflow.ItemCollection buildExportWorkitem(org.imixs.workflow.ItemCollection configuration, String modelVersion, int taskID, List<org.imixs.workflow.ItemCollection> data)This method builds the export workitem. This method is only used by the IW24DatevImportControler!The datev client id is fetched from the first invoice of the invoice data collection.
Change 5.5.2022 Die Beraternummer kann nun auch auf Corporate Ebene gepflegt werden. Ist das der Fall, dann gewinnt diese Nummer. Andernfalls wird weiterhin die Beraternummer aus der Zentralen DATEV Config genommen.
- Parameters:
configuration-modelVersion-taskID-data-- Returns:
-
loadConfiguration
public org.imixs.workflow.ItemCollection loadConfiguration(String name)
Loads the DATEV configuration entity by name. The method returns null if no configuration exits.- Returns:
-
computeKey
public String computeKey(org.imixs.workflow.ItemCollection invoice)
Helper Method to copute the grouping key (MandantID+Buchungsperiode)- Returns:
-
findDatevExport
public org.imixs.workflow.ItemCollection findDatevExport(String datevKey) throws org.imixs.workflow.exceptions.QueryException
Prüft alle offenen Datev Exporte und gibt den neuesten zur angegebenen Datev Client ID zurück, oder null falls es keinen Offenen Datev Export gibt.- Parameters:
datevKey-- Returns:
- Throws:
org.imixs.workflow.exceptions.QueryException
-
processDatevExport
public org.imixs.workflow.ItemCollection processDatevExport(org.imixs.workflow.ItemCollection datevExport) throws org.imixs.workflow.exceptions.AccessDeniedException, org.imixs.workflow.exceptions.ProcessingErrorException, org.imixs.workflow.exceptions.PluginException, org.imixs.workflow.exceptions.ModelExceptionAktualisiert den DATEV Export mit Manager Rechten- Parameters:
datevExport-- Returns:
- Throws:
org.imixs.workflow.exceptions.ModelExceptionorg.imixs.workflow.exceptions.PluginExceptionorg.imixs.workflow.exceptions.ProcessingErrorExceptionorg.imixs.workflow.exceptions.AccessDeniedException
-
getWorkItemFileFromWorkitem
public org.imixs.workflow.FileData getWorkItemFileFromWorkitem(org.imixs.workflow.ItemCollection invoice) throws org.imixs.workflow.exceptions.PluginExceptionThis method first lookups the origin workItem from the given export data entity. Then the method returns the first PDF fileData from a snapshot by a resolved invoice workItem.If multiple files are attached, the method returns the latest FileData object
- Parameters:
uniqueid-file- - file name- Returns:
- FileData object for the given filename.
- Throws:
org.imixs.workflow.exceptions.PluginException
-
-