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 index ce85ecf..3c30897 100644 --- 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 @@ -1,14 +1,37 @@ package com.alexanderlogistics.dwc; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; import java.util.logging.Logger; +import org.apache.poi.ss.usermodel.CellCopyPolicy; +import org.apache.poi.ss.util.CellReference; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.imixs.ai.workflow.OpenAIAPIAdapter; +import org.imixs.archive.core.SnapshotService; +import org.imixs.workflow.FileData; import org.imixs.workflow.ItemCollection; import org.imixs.workflow.SignalAdapter; +import org.imixs.workflow.engine.DocumentService; import org.imixs.workflow.engine.ReportService; +import org.imixs.workflow.engine.WorkflowService; import org.imixs.workflow.exceptions.AdapterException; import org.imixs.workflow.exceptions.PluginException; +import org.imixs.workflow.exceptions.QueryException; import org.imixs.workflow.sepa.services.SepaWorkflowService; +import com.alexanderlogistics.OPListExportAdapterByWeek; + import jakarta.ejb.EJB; import jakarta.inject.Inject; @@ -18,6 +41,17 @@ import jakarta.inject.Inject; * This adapter export the payment information in a Excel Sheet acording to the * 'businessONLINE NBD' interface description. * + * * + * + *
+ * {@code
+
+ ....
+ ....
+
+ * }
+ *
+ *
* @version 1.0
* @author rsoika
*/
@@ -28,12 +62,23 @@ public class SEPAExportAdapterNBD implements SignalAdapter {
public static final String ERROR_CONFIG = "CONFIG_ERROR";
public static final String ERROR_MISSING_INVOICE = "ERROR_MISSING_INVOICE";
+ final String TYPE_TEXTBLOCK = "textblock";
+
@EJB
ReportService reportService;
@Inject
SepaWorkflowService sepaWorkflowService;
+ @Inject
+ DocumentService documentService;
+
+ @Inject
+ WorkflowService workflowService;
+
+ @Inject
+ SnapshotService snapshotService;
+
/**
* This method collects a data set with all invoices and computes a NBA Excel
* File. The templated is loaded from a text block
@@ -45,27 +90,173 @@ public class SEPAExportAdapterNBD implements SignalAdapter {
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");
+ // Textblock laden
+ List+ * The method copies the Row A16 as a reference row + *
+ * The named cell 'TOTAL' should contain the summary formula. It will be
+ * evaluated at the end.
+ *
+ * @throws PluginException
+ * @throws QueryException
+ */
+ private void insertInvoiceRows(ItemCollection workitem, FileData fileData, List