diff --git a/RELEASENOTES.md b/RELEASENOTES.md index e469bb5..ac9bf6b 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,6 +1,32 @@ # Versionen -### 1.2.21 (Development) + + +### 1.3.0 (Development - Office-Workflow 5.0.2 ) + + - Migration auf Imixs-Office-Workflow 5.0.2 + - Upgrade Imixs-Workflow 6.7 + - Beim XML Invoice Import wird nun auch die Sprache für das Mahnwesen ermittelt (fehlte) + - Währungsunabhängigkeit + + +**Migration** + + 1. Parameter Pflegen + a) Währungen pflegen + - DE = EUR;CHF;SEK;RUB;NOK;GBP;USD;CAD + - PL = PLN;EUR;CHF;SEK;RUB;NOK;GBP;USD;CAD + - DWC = AED; EUR;CHF;SEK;RUB;NOK;GBP;USD;CAD + b) Mandant ID + + 2. OP Listen Template im Textbausteein aktualisieren + + 3. Alle Workflow Modelle erneuern + + + + +### 1.2.21 (Draft) - Beim XML Invoice Import wird nun auch die Sprache für das Mahnwesen ermittelt (fehlte) - Währungsunabhängigkeit diff --git a/doc/Emirates NBD/4. Bulk File Upload Guide - businessONLINE.pdf b/doc/Emirates NBD/4. Bulk File Upload Guide - businessONLINE.pdf new file mode 100644 index 0000000..252a91d Binary files /dev/null and b/doc/Emirates NBD/4. Bulk File Upload Guide - businessONLINE.pdf differ diff --git a/doc/Emirates NBD/README.md b/doc/Emirates NBD/README.md new file mode 100644 index 0000000..bb7d427 --- /dev/null +++ b/doc/Emirates NBD/README.md @@ -0,0 +1,14 @@ +# SEPA Schnittstelle Emirates NBD + +Für die Bank Emirates NBD kann die bestehene SEPA Schnittstelle nicht verwendet werden. Hierfür wird eine Excel Basierte Dateischnittstelle benötigt. +Diese ist im Adapter `SEPAExportAdapterNBD` umgesetzt. + +## Schnittstelle + +Die Schnittstelle ist über den `SEPAExportAdapterNBD` realisiert. Dieser läd das Template für den Bulk File Upload aus dem Textbaustein und befüllt es anhand der Schnittstellenbeschreibung + + - businessONLINE - Bulk File Upload specifications_20Columns.pdf + + + + diff --git a/doc/Emirates NBD/businessONLINE - Bulk File Upload specifications_20Columns.pdf b/doc/Emirates NBD/businessONLINE - Bulk File Upload specifications_20Columns.pdf new file mode 100644 index 0000000..8086efe Binary files /dev/null and b/doc/Emirates NBD/businessONLINE - Bulk File Upload specifications_20Columns.pdf differ diff --git a/reports/cargosoft/doc/CargoSoftInvoice-2020.2.xsd b/doc/cargosoft/CargoSoftInvoice-2020.2.xsd similarity index 100% rename from reports/cargosoft/doc/CargoSoftInvoice-2020.2.xsd rename to doc/cargosoft/CargoSoftInvoice-2020.2.xsd diff --git a/reports/cargosoft/doc/CargoSoftInvoice-2023.1.xsd b/doc/cargosoft/CargoSoftInvoice-2023.1.xsd similarity index 100% rename from reports/cargosoft/doc/CargoSoftInvoice-2023.1.xsd rename to doc/cargosoft/CargoSoftInvoice-2023.1.xsd diff --git a/reports/cargosoft/doc/Example_IncomingInvoice_unbooked_2020.2.xml b/doc/cargosoft/Example_IncomingInvoice_unbooked_2020.2.xml similarity index 100% rename from reports/cargosoft/doc/Example_IncomingInvoice_unbooked_2020.2.xml rename to doc/cargosoft/Example_IncomingInvoice_unbooked_2020.2.xml diff --git a/reports/cargosoft/doc/Rechnungsimport Version 2020.2.pdf b/doc/cargosoft/Rechnungsimport Version 2020.2.pdf similarity index 100% rename from reports/cargosoft/doc/Rechnungsimport Version 2020.2.pdf rename to doc/cargosoft/Rechnungsimport Version 2020.2.pdf diff --git a/reports/cargosoft/doc/neue Schnittstelle/CargoSoftInvoice-2024.1.xsd b/doc/cargosoft/neue Schnittstelle/CargoSoftInvoice-2024.1.xsd similarity index 100% rename from reports/cargosoft/doc/neue Schnittstelle/CargoSoftInvoice-2024.1.xsd rename to doc/cargosoft/neue Schnittstelle/CargoSoftInvoice-2024.1.xsd diff --git a/reports/cargosoft/doc/neue Schnittstelle/Sample_File_InvoiceExport.xml b/doc/cargosoft/neue Schnittstelle/Sample_File_InvoiceExport.xml similarity index 100% rename from reports/cargosoft/doc/neue Schnittstelle/Sample_File_InvoiceExport.xml rename to doc/cargosoft/neue Schnittstelle/Sample_File_InvoiceExport.xml diff --git a/reports/cargosoft/doc/neue Schnittstelle/XML Exporting of Invoices 2024.1.pdf b/doc/cargosoft/neue Schnittstelle/XML Exporting of Invoices 2024.1.pdf similarity index 100% rename from reports/cargosoft/doc/neue Schnittstelle/XML Exporting of Invoices 2024.1.pdf rename to doc/cargosoft/neue Schnittstelle/XML Exporting of Invoices 2024.1.pdf diff --git a/reports/cargosoft/doc/neue Schnittstelle/steuerbescheid-beispiel.xml b/doc/cargosoft/neue Schnittstelle/steuerbescheid-beispiel.xml similarity index 100% rename from reports/cargosoft/doc/neue Schnittstelle/steuerbescheid-beispiel.xml rename to doc/cargosoft/neue Schnittstelle/steuerbescheid-beispiel.xml diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/dwc/SEPAExportAdapterNBD.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/dwc/SEPAExportAdapterNBD.java new file mode 100644 index 0000000..09da9be --- /dev/null +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/dwc/SEPAExportAdapterNBD.java @@ -0,0 +1,153 @@ +package com.alexanderlogistics.dwc; + +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.logging.Logger; + +import javax.ejb.EJB; +import javax.inject.Inject; +import javax.xml.bind.JAXBException; +import javax.xml.transform.TransformerException; + +import org.imixs.workflow.FileData; +import org.imixs.workflow.ItemCollection; +import org.imixs.workflow.SignalAdapter; +import org.imixs.workflow.engine.ReportService; +import org.imixs.workflow.exceptions.AdapterException; +import org.imixs.workflow.exceptions.PluginException; +import org.imixs.workflow.sepa.services.SepaWorkflowService; + +import com.alexanderlogistics.OPListExportAdapterByWeek; + +/** + * TheSEPAExportAdapterNBD is an extension of the SEPAExportAdapter. + * + * This adapter export the payment information in a Excel Sheet acording to the + * 'businessONLINE NBD' interface description. + * + * @version 1.0 + * @author rsoika + */ +public class SEPAExportAdapterNBD implements SignalAdapter { + + private static Logger logger = Logger.getLogger(SEPAExportAdapterNBD.class.getName()); + + public static final String ERROR_CONFIG = "CONFIG_ERROR"; + public static final String ERROR_MISSING_INVOICE = "ERROR_MISSING_INVOICE"; + + @EJB + ReportService reportService; + + @Inject + SepaWorkflowService sepaWorkflowService; + + /** + * This method collects a data set with all invoices and computes a NBA Excel + * File. The templated is loaded from a text block + * + * @throws PluginException + */ + @SuppressWarnings("unchecked") + @Override + public ItemCollection execute(ItemCollection sepaExport, ItemCollection event) + throws AdapterException, PluginException { + + // Textblock laden + // load the text block + FileData fileData = loadTextBlockFileData(textblockRef, template); + + // do we found the document? + if (fileData == null) { + throw new PluginException(OPListExportAdapterByWeek.class.getSimpleName(), ERROR_CONFIG, + "invalid op-list configuration in model event - template=" + template + " not found!"); + } + fileData.setName(targetName); + // append document + logger.info("...append new op-list Template: " + targetName); + + document.addFileData(fileData); + + /* Processing .... */ + String key = sepaExport.getItemValueString("name"); + + // load the report + ItemCollection report = reportService.findReport(event.getItemValueString("txtReportName")); + if (report == null) { + throw new PluginException(SEPAExportAdapterNBD.class.getName(), SepaWorkflowService.REPORT_ERROR, + "Missing report definition. Unable to load report '" + event.getItemValueString("txtReportName") + + "'. Please check model configuration "); + } + + // get the data source based on the $workitemref .... + List refList = sepaExport.getItemValue("$workitemref"); + List data = new ArrayList(); + ItemCollection configuration = sepaWorkflowService.loadConfiguration(); + + logger.info("...SEPA export started - " + refList.size() + " invoices found..."); + + for (String ref : refList) { + // load invoice + ItemCollection invoice = sepaWorkflowService.loadInvoice(ref); + if (invoice == null) { + logger.warning("Invoice '" + ref + "' not found! SEPA Export can not be executed"); + continue; + } + // avoid unsupported characters in sepa fields + invoice = sepaWorkflowService.harmonizeSEPAItem(invoice, SepaWorkflowService.ITEM_CDTR_NAME); + invoice = sepaWorkflowService.harmonizeSEPAItem(invoice, SepaWorkflowService.ITEM_DBTR_NAME); + data.add(invoice); + } + + // finally we add the sepa export document to the data collection + data.add(sepaExport); + + // create the attachment based on the report definition + // attach a file to the current workitem + // create a harmonized debitor name for the filename..... + String sDepName = sepaExport.getItemValueString(SepaWorkflowService.ITEM_DBTR_NAME); + sDepName = sDepName.replace("&", "_"); + sDepName = sDepName.replace(">", "_"); + sDepName = sDepName.replace("<", "_"); + sDepName = sDepName.replace(" ", "_"); + // build a timestamp for the filename + DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HHmm"); + String sepaFileName = "sepa_" + sDepName + "_" + df.format(new Date()) + ".xml"; + try { + // now we transform the data source + // if an optional report definition was defined, this report is used for XSL + // processing if not, than the main report definition is used + FileData filedata = null; + String optionalSepaReport = sepaExport.getItemValueString(SepaWorkflowService.ITEM_SEPA_REPORT); + ItemCollection reportOptional = reportService.findReport(optionalSepaReport); + if (reportOptional != null) { + // use optional report + filedata = reportService.transformDataSource(reportOptional, data, sepaFileName); + sepaWorkflowService.logMessage( + "...SEPA export report=" + sepaExport.getItemValueString(SepaWorkflowService.ITEM_SEPA_REPORT), + configuration, sepaExport); + } else { + if (!optionalSepaReport.isEmpty()) { + sepaWorkflowService.logMessage("...WARNING - SEPA export report " + optionalSepaReport + + " not found! Default report will be used.", configuration, sepaExport); + } + // use the default report + filedata = reportService.transformDataSource(report, data, sepaFileName); + } + // attach the file + sepaExport.addFileData(filedata); + } catch (JAXBException | IOException | TransformerException e) { + throw new PluginException(SEPAExportAdapterNBD.class.getName(), SepaWorkflowService.REPORT_ERROR, + "Failed to generate SEPA File:" + e.getMessage()); + } + + // write log + logger.info("...SEPA export " + key + " finished."); + + return sepaExport; + } + +} \ No newline at end of file diff --git a/reports/sepa/result_sepa01.xml b/reports/sepa/result_sepa01.xml index 53bb10b..5bb7d6d 100644 --- a/reports/sepa/result_sepa01.xml +++ b/reports/sepa/result_sepa01.xml @@ -6,7 +6,7 @@ bf073e72asdf512c4d60af7740872036 - 2024-07-04T11:17:55 + 2024-07-11T14:29:56 3 655.90 @@ -23,7 +23,7 @@ SEPA - 2024-07-04 + 2024-07-11 Targo Bank diff --git a/reports/sepa/result_sepa02.xml b/reports/sepa/result_sepa02.xml index 8c4b7d0..208c6c6 100644 --- a/reports/sepa/result_sepa02.xml +++ b/reports/sepa/result_sepa02.xml @@ -6,7 +6,7 @@ bf073e72asdf512c4d60af7740872036 - 2024-07-04T11:17:55 + 2024-07-11T14:29:57 3 655.90 @@ -23,7 +23,7 @@ SEPA - 2024-07-04 + 2024-07-11 Targo Bank diff --git a/workflow/sepa-export-manual-dwc-3.0.0.bpmn b/workflow/sepa-export-manual-dwc-3.0.0.bpmn index 857dfe3..3d5ac75 100644 --- a/workflow/sepa-export-manual-dwc-3.0.0.bpmn +++ b/workflow/sepa-export-manual-dwc-3.0.0.bpmn @@ -32,7 +32,7 @@ - + textAnnotation_Ku1gIw TextAnnotation_2 - TextAnnotation_3 + textAnnotation_VzlLPQ @@ -758,13 +758,6 @@ result.isValid=true; The SEPA Export process runs on a scheduled basis (e.g. once a day) - - Contains Report Definition - - - - - @@ -772,31 +765,38 @@ result.isValid=true; + + + + + + + - + - + - + - + - + - + - + - + @@ -818,190 +818,190 @@ result.isValid=true; - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - - - + + + - + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - + + + + - - - + + + - - - + + + - + - - - - + + + + + + + + + + + + +