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; /** * TheSEPAExportAdapterNBD is an extension of the SEPAExportAdapter. * * This adapter export the payment information in a Excel Sheet acording to the * 'businessONLINE NBD' interface description. * * * * *
* {@code
....
....
* }
*
*
* @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";
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
*
* @throws PluginException
*/
@SuppressWarnings("unchecked")
@Override
public ItemCollection execute(ItemCollection sepaExport, ItemCollection event)
throws AdapterException, PluginException {
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