update excel update
This commit is contained in:
parent
c2c3b6e798
commit
b666ffdbb7
2 changed files with 1105 additions and 23 deletions
|
|
@ -1,4 +1,4 @@
|
|||
package com.alexanderlogistics.dwc;
|
||||
package com.alexanderlogistics.sepa;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
|
@ -30,7 +30,8 @@ import org.imixs.workflow.exceptions.PluginException;
|
|||
import org.imixs.workflow.exceptions.QueryException;
|
||||
import org.imixs.workflow.sepa.services.SepaWorkflowService;
|
||||
|
||||
import com.alexanderlogistics.KreditorDebitorService;
|
||||
import com.alexanderlogistics.BusinessPartnerService;
|
||||
import com.alexanderlogistics.InvoiceUtil;
|
||||
import com.alexanderlogistics.OPListExportAdapterByWeek;
|
||||
|
||||
import jakarta.ejb.EJB;
|
||||
|
|
@ -56,9 +57,9 @@ import jakarta.inject.Inject;
|
|||
* @version 1.0
|
||||
* @author rsoika
|
||||
*/
|
||||
public class SEPAExportAdapterNBD implements SignalAdapter {
|
||||
public class SEPAExportAdapterExcel implements SignalAdapter {
|
||||
|
||||
private static Logger logger = Logger.getLogger(SEPAExportAdapterNBD.class.getName());
|
||||
private static Logger logger = Logger.getLogger(SEPAExportAdapterExcel.class.getName());
|
||||
|
||||
public static final String ERROR_CONFIG = "CONFIG_ERROR";
|
||||
public static final String ERROR_MISSING_INVOICE = "ERROR_MISSING_INVOICE";
|
||||
|
|
@ -81,7 +82,7 @@ public class SEPAExportAdapterNBD implements SignalAdapter {
|
|||
SnapshotService snapshotService;
|
||||
|
||||
@Inject
|
||||
KreditorDebitorService kreditorDebitorService;
|
||||
BusinessPartnerService businessPartnerService;
|
||||
|
||||
/**
|
||||
* This method collects a data set with all invoices and computes a NBA Excel
|
||||
|
|
@ -242,7 +243,7 @@ public class SEPAExportAdapterNBD implements SignalAdapter {
|
|||
logger.finest("......new document added");
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new PluginException(SEPAExportAdapterNBD.class.getSimpleName(), ERROR_CONFIG,
|
||||
throw new PluginException(SEPAExportAdapterExcel.class.getSimpleName(), ERROR_CONFIG,
|
||||
"failed to update sepa export: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
@ -289,17 +290,12 @@ public class SEPAExportAdapterNBD implements SignalAdapter {
|
|||
String result = "";
|
||||
ItemCollection cdtrItemCol = null;
|
||||
|
||||
String cdtrNumber = workitem.getItemValueString("cdtr.number");
|
||||
cdtrItemCol = businessPartnerService.getBusinessPartnerByID(InvoiceUtil.getBPID(workitem));
|
||||
|
||||
try {
|
||||
cdtrItemCol = kreditorDebitorService.findCreditor(cdtrNumber);
|
||||
} catch (PluginException e) {
|
||||
logger.warning("Unable to resolve address for " + cdtrNumber + " : " + e.getMessage());
|
||||
}
|
||||
if (cdtrItemCol != null) {
|
||||
result = result + cdtrItemCol.getItemValueString("_vendor_zip_code") + " ";
|
||||
result = result + cdtrItemCol.getItemValueString("_vendor_city") + " ";
|
||||
result = result + cdtrItemCol.getItemValueString("_vendor_str") + " ";
|
||||
result = result + cdtrItemCol.getItemValueString("partner.zip") + " ";
|
||||
result = result + cdtrItemCol.getItemValueString("partner.city") + " ";
|
||||
result = result + cdtrItemCol.getItemValueString("partner.address") + " ";
|
||||
}
|
||||
|
||||
// length max 255
|
||||
|
|
@ -308,16 +304,10 @@ public class SEPAExportAdapterNBD implements SignalAdapter {
|
|||
}
|
||||
|
||||
private String getVendorField(ItemCollection workitem, String fieldname) {
|
||||
String result = "";
|
||||
|
||||
ItemCollection cdtrItemCol = null;
|
||||
|
||||
String cdtrNumber = workitem.getItemValueString("cdtr.number");
|
||||
|
||||
try {
|
||||
cdtrItemCol = kreditorDebitorService.findCreditor(cdtrNumber);
|
||||
} catch (PluginException e) {
|
||||
logger.warning("Unable to resolve address for " + cdtrNumber + " : " + e.getMessage());
|
||||
}
|
||||
cdtrItemCol = businessPartnerService.getBusinessPartnerByID(InvoiceUtil.getBPID(workitem));
|
||||
if (cdtrItemCol != null) {
|
||||
return cdtrItemCol.getItemValueString(fieldname);
|
||||
}
|
||||
1092
workflow/usa/sepa-export-manual-usa-3.0.2.bpmn
Normal file
1092
workflow/usa/sepa-export-manual-usa-3.0.2.bpmn
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue