diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/CargosoftSplitAdapter.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/CargosoftSplitAdapter.java index e5b40c8..9fe0355 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/CargosoftSplitAdapter.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/CargosoftSplitAdapter.java @@ -98,9 +98,9 @@ public class CargosoftSplitAdapter implements SignalAdapter { List buchungsPersioden = new ArrayList(); // add haupt buchungsperiode buchungsPersioden.add(workitem.getItemValueString("invoice.period")); - List positionsTabelle = InvoicePlugin.explodeChildList(workitem); + List positionsTabelle = InvoiceUtil.explodeChildList(workitem); for (ItemCollection posItem : positionsTabelle) { - String childPeriod = posItem.getItemValueString(InvoicePlugin.ITEM_INVOICE_PERIOD); + String childPeriod = posItem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD); if (!childPeriod.isEmpty() && !buchungsPersioden.contains(childPeriod)) { buchungsPersioden.add(childPeriod); } @@ -128,7 +128,7 @@ public class CargosoftSplitAdapter implements SignalAdapter { // float tax=0; while (iter.hasNext()) { ItemCollection posItem = iter.next(); - String childPeriod = posItem.getItemValueString(InvoicePlugin.ITEM_INVOICE_PERIOD); + String childPeriod = posItem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD); if (childPeriod.isEmpty() || buchungsPeriode.equals(childPeriod)) { posItem.setItemValue("numpos", row); splitPositionen.add(posItem.getAllItems()); @@ -139,7 +139,7 @@ public class CargosoftSplitAdapter implements SignalAdapter { } } - workitemSubProcess.setItemValue(InvoicePlugin.ITEM_INVOICE_PERIOD, buchungsPeriode); + workitemSubProcess.setItemValue(InvoiceUtil.ITEM_INVOICE_PERIOD, buchungsPeriode); // jetzt muessen wir die neue Rechnungssumme bilden.... workitemSubProcess.setItemValue("order.total", total); workitemSubProcess.setItemValue("order.total.tax", total - netto); @@ -147,7 +147,7 @@ public class CargosoftSplitAdapter implements SignalAdapter { logger.info("......create cargosoft split buchung - invoice.period=" + buchungsPeriode); // update the child items (reduzierte Positionstabelle) - workitemSubProcess.setItemValue(InvoicePlugin.CHILD_ITEM_PROPERTY, splitPositionen); + workitemSubProcess.setItemValue(InvoiceUtil.CHILD_ITEM_PROPERTY, splitPositionen); workitemSubProcess.model(model).task(taskID).event(eventID); workitemSubProcess.replaceItemValue(WorkflowService.UNIQUEIDREF, workitem.getUniqueID()); diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoiceOutgoingPlugin.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoiceOutgoingPlugin.java index 78ecc5b..904bc5b 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoiceOutgoingPlugin.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoiceOutgoingPlugin.java @@ -27,17 +27,21 @@ public class InvoiceOutgoingPlugin extends AbstractPlugin { **/ @Override public ItemCollection run(ItemCollection workitem, ItemCollection event) throws PluginException { + + // Update Invoice.positions + InvoiceUtil.updateInvoicePositions(workitem); + String dbtrNumber = workitem.getItemValueString("dbtr.number"); ItemCollection debitor = kreditorService.findDebitor(dbtrNumber); - if (debitor!=null) { + if (debitor != null) { // update mail workitem.setItemValue("dbtr.mail", debitor.getItemValueString("cdtr.mail")); } - String img=""; + String img = ""; if (workitem.getItemValueBoolean("invoice.protest")) { img = img + ""; - + } workitem.setItemValue("_img", img); return workitem; diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoicePlugin.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoicePlugin.java index 72e705c..6b3731b 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoicePlugin.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoicePlugin.java @@ -1,9 +1,7 @@ package com.alexanderlogistics; import java.time.LocalDate; -import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -30,6 +28,10 @@ import org.imixs.workflow.faces.util.ResourceBundleHandler; * geprüft ob die Rechnungsnummer schon einmal vorkam. Falls ja, wird eine * Warnung ausgegeben. Der Benutzer kann diese dann skippen. *

+ * Zusäztlich berechnet das Plugin das feld invoice.positions mit einer Value + * liste der Positionsnummern. Dieses Feld wird indiziert, so dass gezielt nach + * Positionsnummern gesucht werden kann. + *

* 2.2.22 - Das Plugin erzeugt auch das Feld _img welches die Images von * Sofortüberweisung, Mahnung und Ablehnung anzeigt. * @@ -44,9 +46,7 @@ public class InvoicePlugin extends AbstractPlugin { public static final int TASK_SACHPRUEFUNG = 5200; public static final int TASK_SACHPRUEFUNG_DELEGATION = 5210; public static final int EVENT_FREIGEBEN = 20; - public static final String ITEM_INVOICE_PERIOD = "invoice.period"; - public static final String CHILD_ITEM_PROPERTY = "_ChildItems"; public static final String ERROR_MISSING_DATA = "MISSING_DATA"; public static final String ERROR_DUPPLICATE_INVOICE_NUMBER = "DUPPLICATE_INVOICE_NUMBER"; public static final String ERROR_NEW_IBANBIC = "NEW_IBANBIC"; @@ -73,6 +73,9 @@ public class InvoicePlugin extends AbstractPlugin { updateImg(workitem); + // Update Invoice.positions + InvoiceUtil.updateInvoicePositions(workitem); + // skip if validaten tag is required=false ItemCollection evalItemCollection = this.getWorkflowService().evalWorkflowResult(event, "validation", workitem); if (evalItemCollection != null) { @@ -94,9 +97,7 @@ public class InvoicePlugin extends AbstractPlugin { // doppelte Rechnungsnummer prüfen if (workitem.getTaskID() == TASK_ERFASSUNG) { validateInvoiceNumber(workitem); - checkIBANNumber(workitem); - } if (workitem.getTaskID() == TASK_ERFASSUNG || ((workitem.getTaskID() == TASK_SACHPRUEFUNG @@ -104,7 +105,7 @@ public class InvoicePlugin extends AbstractPlugin { && workitem.getEventID() == EVENT_FREIGEBEN)) { // Buchungsperiode auf plausi prüfen if (isCargoRechnung(workitem) && "workitem".equals(workitem.getType())) { - validateBuchungsperiode(workitem.getItemValueString(ITEM_INVOICE_PERIOD)); + validateBuchungsperiode(workitem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD)); } // Cargosoft Kreditorennnummer prüfen if (isCargoRechnung(workitem)) { @@ -118,7 +119,7 @@ public class InvoicePlugin extends AbstractPlugin { if (isCargoRechnung(workitem) && ((workitem.getTaskID() == TASK_SACHPRUEFUNG || workitem.getTaskID() == TASK_SACHPRUEFUNG_DELEGATION) && workitem.getEventID() == EVENT_FREIGEBEN)) { - List childs = explodeChildList(workitem); + List childs = InvoiceUtil.explodeChildList(workitem); for (ItemCollection posItem : childs) { if (posItem.getItemValueString("name").trim().isEmpty()) { // throw a plugin exception - because name is missing! @@ -159,8 +160,8 @@ public class InvoicePlugin extends AbstractPlugin { } // Buchunsperiode - if (!posItem.getItemValueString(ITEM_INVOICE_PERIOD).trim().isEmpty()) { - validateBuchungsperiode(posItem.getItemValueString(ITEM_INVOICE_PERIOD)); + if (!posItem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD).trim().isEmpty()) { + validateBuchungsperiode(posItem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD)); } } @@ -222,16 +223,6 @@ public class InvoicePlugin extends AbstractPlugin { } workitem.setItemValue("_img", img); - /* - * for (String entry: eventLog) { // sofortüberweisung if (entry.contains(".96") - * && !img.contains("100.png")) { - * img=img+""; } // mahnen if - * (entry.contains(".95") && !img.contains("074.png")) { - * img=img+""; } // ablehnen if - * (entry.contains("5100.90") && !img.contains("031.png")) { - * img=img+""; } } - * workitem.setItemValue("_img", img); - */ } /** @@ -352,7 +343,7 @@ public class InvoicePlugin extends AbstractPlugin { // wenn bereits eine Überneahme angedroht wurde dann übernehemen! if (!overtakeIBAN.isEmpty()) { kreditorService.addNewIBANBIC(cdtrNumber, iban, bic); - workitem.setItemValue("ibanbic.overtake",""); + workitem.setItemValue("ibanbic.overtake", ""); return; } @@ -383,8 +374,6 @@ public class InvoicePlugin extends AbstractPlugin { } - - /** * Hilfsmethod prüft ob die cdtr.nummer mit einer nummer aus der Cargosoft * Import Datei übereinstimmt. @@ -422,24 +411,6 @@ public class InvoicePlugin extends AbstractPlugin { } - /** - * converts the Map List of a workitem into a List of ItemCollectons - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - protected static List explodeChildList(ItemCollection workitem) { - // convert current list of childItems into ItemCollection elements - ArrayList childItems = new ArrayList(); - - List mapOrderItems = workitem.getItemValue(CHILD_ITEM_PROPERTY); - for (Object mapOderItem : mapOrderItems) { - if (mapOderItem instanceof Map) { - ItemCollection itemCol = new ItemCollection((Map) mapOderItem); - childItems.add(itemCol); - } - } - return childItems; - } - /** * This method returns true if the current workitem is a Cargosoft Invoice. * diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoiceUtil.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoiceUtil.java index 4804cf4..f9a8746 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoiceUtil.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/InvoiceUtil.java @@ -2,24 +2,39 @@ package com.alexanderlogistics; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import java.util.regex.Pattern; + +import org.imixs.workflow.ItemCollection; + /** - * Rundungs Methode + * Hilfsmethoden für die Berechnung und Validierung von Ein und + * Ausgangsrechnugnen * - * See: https://stackoverflow.com/questions/2808535/round-a-double-to-2-decimal-places + * - Rundungs Methode + * - Berechnung der Positionsnummern + * - Explode Childitems + * + * See: + * https://stackoverflow.com/questions/2808535/round-a-double-to-2-decimal-places * * @author rsoika * */ public class InvoiceUtil { + public static final String CHILD_ITEM_PROPERTY = "_ChildItems"; + public static final String ITEM_INVOICE_PERIOD = "invoice.period"; + public static final String ITEM_INVOICE_POSITIONS = "invoice.positions"; + public static double round(double value) { BigDecimal bd = BigDecimal.valueOf(value); bd = bd.setScale(2, RoundingMode.HALF_UP); return bd.doubleValue(); } - - + /** * Hilfsmethode zum validieren der Mailadresse * @@ -27,16 +42,15 @@ public class InvoiceUtil { * @return */ public static boolean validateEmail(String emailAddress) { - //String regexPattern = "^(.+)@(\\S+)$"; - - String regexPattern = "^(?=.{1,64}@)[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*@" + // String regexPattern = "^(.+)@(\\S+)$"; + + String regexPattern = "^(?=.{1,64}@)[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*@" + "[^-][A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$"; return Pattern.compile(regexPattern) - .matcher(emailAddress) - .matches(); + .matcher(emailAddress) + .matches(); } - - + @Deprecated public static double roundConservative(double value) { value = value * 100; @@ -44,4 +58,53 @@ public class InvoiceUtil { return (double) tmp / 100; } + /** + * converts the Map List of a workitem into a List of ItemCollectons + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + public static List explodeChildList(ItemCollection workitem) { + // convert current list of childItems into ItemCollection elements + ArrayList childItems = new ArrayList(); + + List mapOrderItems = workitem.getItemValue(CHILD_ITEM_PROPERTY); + for (Object mapOderItem : mapOrderItems) { + if (mapOderItem instanceof Map) { + ItemCollection itemCol = new ItemCollection((Map) mapOderItem); + childItems.add(itemCol); + } + } + return childItems; + } + + /** + * Diese Methode berechnet das feld 'invoice.positions' welches eine Valueliste + * mit allen Positionsnummern aus dem Childliste enthält. + * Es wird sowohl für Ausgangs wie Eingangsrechnungen genutzt. + * Das feld wird indiziert, so dass eine gezielte Suche nach positiosnummern + * möglich ist. + * + * @param workitem + */ + public static void updateInvoicePositions(ItemCollection workitem) { + + List posList = new ArrayList(); + List childs = InvoiceUtil.explodeChildList(workitem); + for (ItemCollection posItem : childs) { + String posName = ""; + // Ausgangsrechnung - item=datev.text + // Eingangsrechnugn - item=name + if (posItem.hasItem("datev.text")) { + posName = posItem.getItemValueString("datev.text").trim(); + } else { + posName = posItem.getItemValueString("name").trim(); + } + if (!posName.isEmpty()) { + posList.add(posName); + } + } + // update invoice.positions + workitem.setItemValue(ITEM_INVOICE_POSITIONS, posList); + + } + } diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/datev/DatevCargosoftImportAdapter.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/datev/DatevCargosoftImportAdapter.java index 7ceca3d..9d8e0c8 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/datev/DatevCargosoftImportAdapter.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/datev/DatevCargosoftImportAdapter.java @@ -94,9 +94,13 @@ import com.alexanderlogistics.KreditorDebitorService; * - event * * rechnungseingang-dwc-1.0 - * 1000 - * 100 + * "model-invoice">rechnungsausgang-dwc-1.0 + * 1000 + * 100 + * rechnungsausgang-dwc-1.0 + * 1000 + * 100 * * @version 1.0 * @author rsoika @@ -122,11 +126,12 @@ public class DatevCargosoftImportAdapter implements SignalAdapter { @Inject TeamService teamService; - private String INITIAL_MODEL_VERSION; - - private int INITIAL_TASK_ID; - - private int INITIAL_EVENT_ID; + private String INITIAL_MODEL_VERSION_INVOICE; + private int INITIAL_TASK_ID_INVOICE; + private int INITIAL_EVENT_ID_INVOICE; + private String INITIAL_MODEL_VERSION_TAX; + private int INITIAL_TASK_ID_TAX; + private int INITIAL_EVENT_ID_TAX; /** * This method finds or create the Datev Export and adds a reference @@ -140,25 +145,44 @@ public class DatevCargosoftImportAdapter implements SignalAdapter { logger.info("...parse datev file import..."); // Set default values - INITIAL_MODEL_VERSION = "rechnungsausgang-de-1.0"; - INITIAL_TASK_ID = 5001; - INITIAL_EVENT_ID = 980; + INITIAL_MODEL_VERSION_INVOICE = "rechnungsausgang-de-1.0"; + INITIAL_TASK_ID_INVOICE = 5001; + INITIAL_EVENT_ID_INVOICE = 980; + + INITIAL_MODEL_VERSION_TAX = "zollanmeldung-de-1.0"; + INITIAL_TASK_ID_TAX = 1000; + INITIAL_EVENT_ID_TAX = 980; // Try to read the optional cargosoft import options... ItemCollection evalItemCollection = workflowService.evalWorkflowResult(event, "datev-cargosoft-import", workitem, false); if (evalItemCollection != null) { - INITIAL_MODEL_VERSION = evalItemCollection.getItemValueString("model"); - if (INITIAL_MODEL_VERSION.isEmpty()) { - INITIAL_MODEL_VERSION = "rechnungsausgang-de-1.0"; // set default + // Ausgangsrechnung + INITIAL_MODEL_VERSION_INVOICE = evalItemCollection.getItemValueString("model-invoice"); + if (INITIAL_MODEL_VERSION_INVOICE.isEmpty()) { + INITIAL_MODEL_VERSION_INVOICE = "rechnungsausgang-de-1.0"; // set default } - INITIAL_TASK_ID = evalItemCollection.getItemValueInteger("task"); - if (INITIAL_TASK_ID == 0) { - INITIAL_TASK_ID = 5001; // set default + INITIAL_TASK_ID_INVOICE = evalItemCollection.getItemValueInteger("task-invoice"); + if (INITIAL_TASK_ID_INVOICE == 0) { + INITIAL_TASK_ID_INVOICE = 5001; // set default } - INITIAL_EVENT_ID = evalItemCollection.getItemValueInteger("event"); - if (INITIAL_EVENT_ID == 0) { - INITIAL_EVENT_ID = 980; // set default + INITIAL_EVENT_ID_INVOICE = evalItemCollection.getItemValueInteger("event-invoice"); + if (INITIAL_EVENT_ID_INVOICE == 0) { + INITIAL_EVENT_ID_INVOICE = 980; // set default + } + + // Zollanmeldung + INITIAL_MODEL_VERSION_TAX = evalItemCollection.getItemValueString("model-tax"); + if (INITIAL_MODEL_VERSION_TAX.isEmpty()) { + INITIAL_MODEL_VERSION_TAX = "zollanmeldung-de-1.0"; // set default + } + INITIAL_TASK_ID_TAX = evalItemCollection.getItemValueInteger("task-tax"); + if (INITIAL_TASK_ID_TAX == 0) { + INITIAL_TASK_ID_TAX = 1000; // set default + } + INITIAL_EVENT_ID_TAX = evalItemCollection.getItemValueInteger("event-tax"); + if (INITIAL_EVENT_ID_TAX == 0) { + INITIAL_EVENT_ID_TAX = 980; // set default } } try { @@ -286,7 +310,8 @@ public class DatevCargosoftImportAdapter implements SignalAdapter { double basisumsatz = parseBetrag(DatevImportAdapter.csvVal(dataList[4])); // Skip Eingangsrechnungen - if (!gegenKonto.startsWith("1")) { + // Wenn es aber eine ATC Belegnummer ist dann ist es doch interessant + if (!gegenKonto.startsWith("1") && !belegNummer.startsWith("ATC")) { eingangsrechnungen++; // skip continue; @@ -337,7 +362,7 @@ public class DatevCargosoftImportAdapter implements SignalAdapter { logger.info("...close workitem...."); // nein - also invoice schließen - closeInvoiceWorkitem(invoiceWorkitem, splitBuchungen, spacePosMappings); + closeDatevWorkitem(invoiceWorkitem, splitBuchungen, spacePosMappings); invoiceWorkitem = null; // neue Splitbuchungstabelle anlegen splitBuchungen = new ArrayList(); @@ -355,7 +380,7 @@ public class DatevCargosoftImportAdapter implements SignalAdapter { } } // wile end - closeInvoiceWorkitem(invoiceWorkitem, splitBuchungen, spacePosMappings); + closeDatevWorkitem(invoiceWorkitem, splitBuchungen, spacePosMappings); } catch (IOException | ParseException e) { throw new PluginException(DatevCargosoftImportAdapter.class.getName(), @@ -426,7 +451,11 @@ public class DatevCargosoftImportAdapter implements SignalAdapter { throws AdapterException { // test if invoice was already imported before - String sQuery = "((type:workitem OR type:workitemarchive) AND $modelversion:rechnungsausgang* AND invoice.number:\"" + // zollanmeldung + // String sQuery = "((type:workitem OR type:workitemarchive) AND + // $modelversion:rechnungsausgang* AND invoice.number:\"" + // + belegNummer + "\")"; + String sQuery = "((type:workitem OR type:workitemarchive) AND ($modelversion:rechnungsausgang* OR $modelversion:zollanmeldung*) AND invoice.number:\"" + belegNummer + "\")"; try { // find the textblock... @@ -481,10 +510,10 @@ public class DatevCargosoftImportAdapter implements SignalAdapter { * @throws ProcessingErrorException * @throws AccessDeniedException */ - private void closeInvoiceWorkitem(ItemCollection invoiceWorkitem, List splitBuchungen, + private void closeDatevWorkitem(ItemCollection datevWorkitem, List splitBuchungen, Map> spacePosMappings) throws AccessDeniedException, ProcessingErrorException, PluginException, ModelException { - if (invoiceWorkitem == null) { + if (datevWorkitem == null) { return; // no op } @@ -499,30 +528,30 @@ public class DatevCargosoftImportAdapter implements SignalAdapter { } total = InvoiceUtil.round(total); - invoiceWorkitem.setItemValue("invoice.total", total); - invoiceWorkitem.setItemValue("invoice.saldo", total); + datevWorkitem.setItemValue("invoice.total", total); + datevWorkitem.setItemValue("invoice.saldo", total); // implode die Splitbuchungen - implodeChildList(invoiceWorkitem, splitBuchungen); + implodeChildList(datevWorkitem, splitBuchungen); // set dbtr.name ItemCollection dbtrItemCol = kreditorDebitorService - .findDebitor(invoiceWorkitem.getItemValueString("dbtr.number")); + .findDebitor(datevWorkitem.getItemValueString("dbtr.number")); if (dbtrItemCol != null) { - invoiceWorkitem.setItemValue("dbtr.name", dbtrItemCol.getItemValueString("_VENDOR_Name")); + datevWorkitem.setItemValue("dbtr.name", dbtrItemCol.getItemValueString("_VENDOR_Name")); // Anhand der Creditoren Stammdaten errrechnen wir die Sprache für diese // Rechnung String country = dbtrItemCol.getItemValueString("_VENDOR_COUNTRY"); - invoiceWorkitem.setItemValue("dbtr.country", country); + datevWorkitem.setItemValue("dbtr.country", country); if (country.equalsIgnoreCase("de") || country.equalsIgnoreCase("ch") || country.equalsIgnoreCase("at")) { - invoiceWorkitem.setItemValue("invoice.language", "DE"); + datevWorkitem.setItemValue("invoice.language", "DE"); } else { - invoiceWorkitem.setItemValue("invoice.language", "EN"); + datevWorkitem.setItemValue("invoice.language", "EN"); } } // Jezt noch das Space mapping // dazu kucken wir in alle spaces den config wert 'pos.mapping' - String text = invoiceWorkitem.getItemValueString("invoice.text"); + String text = datevWorkitem.getItemValueString("invoice.text"); if (!text.isEmpty()) { boolean found = false; for (Map.Entry> entry : spacePosMappings.entrySet()) { @@ -532,7 +561,7 @@ public class DatevCargosoftImportAdapter implements SignalAdapter { Matcher m = p.matcher(text); if (m.find()) { // we have a match - invoiceWorkitem.setItemValue("space.ref", entry.getKey()); + datevWorkitem.setItemValue("space.ref", entry.getKey()); found = true; break; } @@ -543,8 +572,18 @@ public class DatevCargosoftImportAdapter implements SignalAdapter { } } // Processe die Invoice - invoiceWorkitem.model(INITIAL_MODEL_VERSION).task(INITIAL_TASK_ID).event(INITIAL_EVENT_ID); - workflowService.processWorkItem(invoiceWorkitem); + // In Abhängkeit von der Belegart 'Ausgangsrechnung' | 'Zollanmeldung' wird ein + // neues Workitem erzeugt. + String belegNummer = datevWorkitem.getItemValueString("invoice.number"); + if (belegNummer.startsWith("ATC")) { + // Zollanmeldung + datevWorkitem.model(INITIAL_MODEL_VERSION_TAX).task(INITIAL_TASK_ID_TAX).event(INITIAL_EVENT_ID_TAX); + } else { + // Normale Ausgangsrechnung + datevWorkitem.model(INITIAL_MODEL_VERSION_INVOICE).task(INITIAL_TASK_ID_INVOICE) + .event(INITIAL_EVENT_ID_INVOICE); + } + workflowService.processWorkItem(datevWorkitem); } diff --git a/office-alexander-logistics-app/src/main/resources/imixs.properties b/office-alexander-logistics-app/src/main/resources/imixs.properties index d75dceb..7b55f60 100644 --- a/office-alexander-logistics-app/src/main/resources/imixs.properties +++ b/office-alexander-logistics-app/src/main/resources/imixs.properties @@ -2,12 +2,12 @@ # Imixs Lucene Plugin ############################## lucence.indexDir=${imixs-office.IndexDir} -index.fields=txtsearchstring,txtSubject,txtname,txtEmail,txtUserName,namCreator,txtworkflowgroup,txtworkflowstatus,txtWorkflowAbstract,txtWorkflowSummary,txtworkflowhistory,txtspacename,txtprocessname,_subject,_description,_name,_projectnumber,_projectname,_ordernumber,_contractnumber,datDueDate,txtcommentlog,htmldescription,htmldocumentation,dms,dms_names,invoice.number.stripped,_childitems,$file.names,_VENDOR_NAME,dbtr.number,cdtr.number +index.fields=txtsearchstring,txtSubject,txtname,txtEmail,txtUserName,namCreator,txtworkflowgroup,txtworkflowstatus,txtWorkflowAbstract,txtWorkflowSummary,txtworkflowhistory,txtspacename,txtprocessname,_subject,_description,_name,_projectnumber,_projectname,_ordernumber,_contractnumber,datDueDate,txtcommentlog,htmldescription,htmldocumentation,dms,dms_names,invoice.number.stripped,_childitems,$file.names,_VENDOR_NAME,dbtr.number,cdtr.number,invoice.positions index.fields.analyze=txtUsername -index.fields.noanalyze=type,$UniqueIDRef,$created,$modified,$ModelVersion,$participants,namCreator,$ProcessID,datDate,txtWorkflowGroup,txtemail, datdate, datfrom, datto, numsequencenumber,sequencenumber,dms_count,invoice.number,invoice.number.stripped,invoice.date,invoice.duedate,taxonomy.verteilung.stop,taxonomy.sachpruefung.stop,taxonomy.verteilung.start,taxonomy.sachpruefung.start,taxonomy.buchhaltung.start,taxonomy.buchhaltung.stop,dbtr.number,cdtr.number,payment.date,invoice.total,invoice.currency,$lasteventdate,payment.type +index.fields.noanalyze=type,$UniqueIDRef,$created,$modified,$ModelVersion,$participants,namCreator,$ProcessID,datDate,txtWorkflowGroup,txtemail, datdate, datfrom, datto, numsequencenumber,sequencenumber,dms_count,invoice.number,invoice.number.stripped,invoice.date,invoice.duedate,taxonomy.verteilung.stop,taxonomy.sachpruefung.stop,taxonomy.verteilung.start,taxonomy.sachpruefung.start,taxonomy.buchhaltung.start,taxonomy.buchhaltung.stop,dbtr.number,cdtr.number,payment.date,invoice.total,invoice.currency,invoice.positions,$lasteventdate,payment.type index.fields.store=process.name,txtProcessName,txtWorkflowImageURL,payment.date,invoice.number,invoice.date,invoice.duedate index.fields.category=space.name,space.ref,taxonomy.verteilung.stop.by,taxonomy.sachpruefung.stop.by,taxonomy.buchhaltung.stop.by -office.search.noanalyze=invoice.number,invoice.number.stripped +office.search.noanalyze=invoice.number,invoice.number.stripped,invoice.positions ############################## # Marty Setup diff --git a/reports/sepa/result_sepa01.xml b/reports/sepa/result_sepa01.xml index f688dab..d07d74d 100644 --- a/reports/sepa/result_sepa01.xml +++ b/reports/sepa/result_sepa01.xml @@ -6,7 +6,7 @@ bf073e72asdf512c4d60af7740872036 - 2024-04-03T15:23:47 + 2024-04-12T09:10:53 3 655.90 @@ -23,7 +23,7 @@ SEPA - 2024-04-03 + 2024-04-12 Targo Bank diff --git a/reports/sepa/result_sepa02.xml b/reports/sepa/result_sepa02.xml index 271ecac..0d6411c 100644 --- a/reports/sepa/result_sepa02.xml +++ b/reports/sepa/result_sepa02.xml @@ -6,7 +6,7 @@ bf073e72asdf512c4d60af7740872036 - 2024-04-03T15:23:47 + 2024-04-12T09:10:53 3 655.90 @@ -23,7 +23,7 @@ SEPA - 2024-04-03 + 2024-04-12 Targo Bank diff --git a/workflow/datev-import-dwc-1.0.0.bpmn b/workflow/datev-import-dwc-1.0.0.bpmn index 173152b..2da66e7 100644 --- a/workflow/datev-import-dwc-1.0.0.bpmn +++ b/workflow/datev-import-dwc-1.0.0.bpmn @@ -507,9 +507,13 @@ if (workitem['$file.count'][0]!=1) { - rechnungsausgang-dwc-1.0 -5001 -980]]> + rechnungsausgang-dwc-1.0 +5001 +980 + +zollanmeldung-dwc-1.0 +1000 +980]]> @@ -805,7 +809,6 @@ if (workitem['$file.count'][0]!=1) { - @@ -817,7 +820,6 @@ if (workitem['$file.count'][0]!=1) { - diff --git a/workflow/zollliste-de-1.0.0.bpmn b/workflow/zollanmeldung-de-1.0.0.bpmn similarity index 70% rename from workflow/zollliste-de-1.0.0.bpmn rename to workflow/zollanmeldung-de-1.0.0.bpmn index a8851bd..caa18fb 100644 --- a/workflow/zollliste-de-1.0.0.bpmn +++ b/workflow/zollanmeldung-de-1.0.0.bpmn @@ -2,7 +2,7 @@ - + @@ -72,15 +72,15 @@ th { font-weight: bold;} ]]> - + - + - + StartEvent_1 @@ -94,17 +94,18 @@ th { font-weight: bold;} DataObject_2 event_XJbC5A - event_6fY5IQ + textAnnotation_HwSKqQ + event_9fS4uw - SequenceFlow_4 + sequenceFlow_M5IK7w - space.name - date]]> + invoice.number dbtr.number dbtr.name (invoice.currency invoice.total) ]]> true @@ -134,7 +135,6 @@ th { font-weight: bold;} SequenceFlow_1 SequenceFlow_17 sequenceFlow_l0egag - sequenceFlow_GVz3vg SequenceFlow_19 @@ -143,7 +143,7 @@ th { font-weight: bold;} - space.name - date]]> + invoice.number dbtr.number dbtr.name (invoice.currency invoice.total) ]]> @@ -174,18 +174,15 @@ th { font-weight: bold;} $workflowgroup - $workflowstatus]]> - SequenceFlow_4 - sequenceFlow_4Vru0A sequenceFlow_EzmiPA - sequenceFlow_E8t80w + sequenceFlow_rbVgQA + sequenceFlow_aXX5dg + sequenceFlow_M5IK7w - - - - sequencenumber space.name - $created]]> + invoice.number dbtr.number dbtr.name (invoice.currency invoice.total) ]]> true @@ -194,7 +191,7 @@ th { font-weight: bold;} - + @@ -202,9 +199,6 @@ th { font-weight: bold;} - - - @@ -212,6 +206,7 @@ th { font-weight: bold;} $workflowgroup - $workflowstatus]]> SequenceFlow_18 SequenceFlow_19 + sequenceFlow_MTbeHA @@ -247,7 +242,7 @@ th { font-weight: bold;} - + @@ -257,107 +252,120 @@ th { font-weight: bold;} - + - + + + + Mahnwesen]]> - sequenceFlow_4Vru0A + sequenceFlow_aXX5dg + sequenceFlow_MTbeHA - - - - - - + + + + - + + + + + + + + + + ]]> - + + + + sequenceFlow_EzmiPA sequenceFlow_l0egag - - - - + + + + + - - - - - - - - - - - - + + - - - sequenceFlow_GVz3vg - sequenceFlow_E8t80w + + sequenceFlow_rbVgQA - - + + - - + + + + + + + + + + + - + - + - + - + - + - + - + - + @@ -372,99 +380,106 @@ th { font-weight: bold;} - + - + - + - + - + - + - + - + - + - - - - - - - + + - - + + - - + + - - + + - - - - + + + + - + - + - - - - - - - - + + - - + + - - - - + + + + + + + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + +