From 6545f76f431dcc81b6a29e690955b41dacf3b81a Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Thu, 24 Jul 2025 16:55:27 +0200 Subject: [PATCH] update --- docker-compose.yml | 14 +- .../com/alexanderlogistics/InvoicePlugin.java | 170 ++++++++---------- .../workitems/parts/alexander/spaceref.xhtml | 51 ++++-- .../parts/alexander/spaceref_old.xhtml | 25 +++ workflow/ams/rechnungseingang-ams-1.0.0.bpmn | 14 +- 5 files changed, 145 insertions(+), 129 deletions(-) create mode 100644 office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/spaceref_old.xhtml diff --git a/docker-compose.yml b/docker-compose.yml index 05a5207..932edcc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -56,14 +56,12 @@ services: ############################################### # Tika OCR Service ############################################### - # tika: - # #image: apache/tika:latest - # #image: apache/tika:1.24.1-full - # image: apache/tika:2.4.1-full - # environment: - # TZ: "Europe/Berlin" - # ports: - # - "9998:9998" + tika: + image: apache/tika:3.2.0.0-full + environment: + TZ: "Europe/Berlin" + ports: + - "9998:9998" ################## # Exporter Service 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 30b267a..c6e48f9 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 @@ -101,109 +101,93 @@ public class InvoicePlugin extends AbstractPlugin { boolean isPublicEvent = !("0".equals(event.getItemValueString("keypublicresult"))); - // Payment.type muss immer eingetragne werden! - if (isPublicEvent && workitem.getTaskID() >= TASK_ERFASSUNG && workitem.getEventID() < 900) { - if (workitem.getItemValueString("payment.type").trim().isEmpty()) { - // throw a plugin exception! - String message = resourceBundleHandler.findMessage("ERROR_MISSING_PAYMENT"); - throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); - } - // doppelte Rechnungsnummer prüfen - if (workitem.getTaskID() == TASK_ERFASSUNG) { - validateInvoiceNumber(workitem); - checkIBANNumber(workitem); - } + if (isPublicEvent) { + validateInvoiceNumber(workitem); + validateBuchungsperiode(workitem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD)); + checkIBANNumber(workitem); - if (workitem.getTaskID() == TASK_ERFASSUNG || ((workitem.getTaskID() == TASK_SACHPRUEFUNG - || workitem.getTaskID() == TASK_SACHPRUEFUNG_DELEGATION) - && workitem.getEventID() == EVENT_FREIGEBEN)) { - // Buchungsperiode auf plausi prüfen - if (isCargoRechnung(workitem) && "workitem".equals(workitem.getType())) { - validateBuchungsperiode(workitem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD)); - } - // Cargosoft Kreditorennnummer prüfen - if (isCargoRechnung(workitem)) { - validateCargosoftCdtrNumber(workitem); - } - } - } + // Cargosoft Kreditorennnummer prüfen + if (isCargoRechnung(workitem)) { + validateCargosoftCdtrNumber(workitem); - // die prüfung der positionsnummern und Category erfolgt nur im Status - // Sachprüfung (5200) und nur beim Freigeben (20)! - if (isCargoRechnung(workitem) - && ((workitem.getTaskID() == TASK_SACHPRUEFUNG || workitem.getTaskID() == TASK_SACHPRUEFUNG_DELEGATION) + // die prüfung der positionsnummern und Category erfolgt nur im Status + // Sachprüfung (5200) und nur beim Freigeben (20)! + if (((workitem.getTaskID() == TASK_SACHPRUEFUNG + || workitem.getTaskID() == TASK_SACHPRUEFUNG_DELEGATION) && workitem.getEventID() == EVENT_FREIGEBEN)) { - List childs = InvoiceUtil.explodeChildList(workitem); - for (ItemCollection posItem : childs) { - if (posItem.getItemValueString("name").trim().isEmpty()) { - // throw a plugin exception - because name is missing! - String message = resourceBundleHandler.findMessage("ERROR_MISSING_POSNO"); - message = message.replace("{1}", posItem.getItemValueString("numpos")); - throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); - } + List childs = InvoiceUtil.explodeChildList(workitem); + for (ItemCollection posItem : childs) { + if (posItem.getItemValueString("name").trim().isEmpty()) { + // throw a plugin exception - because name is missing! + String message = resourceBundleHandler.findMessage("ERROR_MISSING_POSNO"); + message = message.replace("{1}", posItem.getItemValueString("numpos")); + throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); + } - // validate pos for regex pattern 'XX-YYY-####-###' - if (!posItem.getItemValueString("name").matches(invoicePositionsPattern)) { - // throw a plugin exception - because name is missing! - String message = resourceBundleHandler.findMessage("ERROR_FORMAT_POSNO"); - message = message.replace("{1}", posItem.getItemValueString("numpos")); - throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); - } + // validate pos for regex pattern 'XX-YYY-####-###' + if (!posItem.getItemValueString("name").matches(invoicePositionsPattern)) { + // throw a plugin exception - because name is missing! + String message = resourceBundleHandler.findMessage("ERROR_FORMAT_POSNO"); + message = message.replace("{1}", posItem.getItemValueString("numpos")); + throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); + } - if (posItem.getItemValueString("category").trim().isEmpty()) { - // throw a plugin exception - because name is missing! - String message = resourceBundleHandler.findMessage("ERROR_MISSING_CATEGORY"); - message = message.replace("{1}", posItem.getItemValueString("numpos")); - throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, - "Eingabefehler - Die Leistungsart in Zeile " + posItem.getItemValueString("numpos") - + " muss ausgefüllt sein!"); - } + if (posItem.getItemValueString("category").trim().isEmpty()) { + // throw a plugin exception - because name is missing! + String message = resourceBundleHandler.findMessage("ERROR_MISSING_CATEGORY"); + message = message.replace("{1}", posItem.getItemValueString("numpos")); + throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, + "Eingabefehler - Die Leistungsart in Zeile " + posItem.getItemValueString("numpos") + + " muss ausgefüllt sein!"); + } - if (posItem.getItemValueString("tax").trim().isEmpty()) { - // throw a plugin exception - because name is missing! - String message = resourceBundleHandler.findMessage("ERROR_MISSING_TAX"); - message = message.replace("{1}", posItem.getItemValueString("numpos")); - throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); - } + if (posItem.getItemValueString("tax").trim().isEmpty()) { + // throw a plugin exception - because name is missing! + String message = resourceBundleHandler.findMessage("ERROR_MISSING_TAX"); + message = message.replace("{1}", posItem.getItemValueString("numpos")); + throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); + } - if (posItem.getItemValueFloat("amount") == 0) { - // throw a plugin exception - because name is missing! - String message = resourceBundleHandler.findMessage("ERROR_MISSING_NET"); - message = message.replace("{1}", posItem.getItemValueString("numpos")); - throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); - } + if (posItem.getItemValueFloat("amount") == 0) { + // throw a plugin exception - because name is missing! + String message = resourceBundleHandler.findMessage("ERROR_MISSING_NET"); + message = message.replace("{1}", posItem.getItemValueString("numpos")); + throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); + } - // Buchunsperiode - if (!posItem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD).trim().isEmpty()) { - validateBuchungsperiode(posItem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD)); + // Buchunsperiode + if (!posItem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD).trim().isEmpty()) { + validateBuchungsperiode(posItem.getItemValueString(InvoiceUtil.ITEM_INVOICE_PERIOD)); - } - } - - // Ergaenzung 18.05.2021: - // es kann vorkommen, das die Anwender abweichende Buchungsperioden eingeben so - // das die Hauptbuchungsperiode gar ncht merh vorkommt. Das darf aber nicht der - // fall sein. - // Im folgenden überprüfen wir ob eine Buchungszeile vorkommt in der keine oder - // die Hauptbuchunsperiode ausgewählt wurde. Ist das nicht der Fal gibt es eine - // Fehlermeldung für den Anwendere - if (isCargoRechnung(workitem) && childs.size() > 0) { - String hauptBuchungsperiode = workitem.getItemValueString("invoice.period"); - boolean buchungsperiodenValid = false; - for (ItemCollection posItem : childs) { - String posBuchungsperiode = posItem.getItemValueString("invoice.period"); - if (posBuchungsperiode.isEmpty() || posBuchungsperiode.equals(hauptBuchungsperiode)) { - // alles fein! - buchungsperiodenValid = true; + } } - } - if (buchungsperiodenValid == false) { - // fehlerhafte Buchungsperioden. - String message = resourceBundleHandler.findMessage("ERROR_MAIN_BOOKING_PERIOD"); - throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); + + // Ergaenzung 18.05.2021: + // es kann vorkommen, das die Anwender abweichende Buchungsperioden eingeben so + // das die Hauptbuchungsperiode gar ncht merh vorkommt. Das darf aber nicht der + // fall sein. + // Im folgenden überprüfen wir ob eine Buchungszeile vorkommt in der keine oder + // die Hauptbuchunsperiode ausgewählt wurde. Ist das nicht der Fal gibt es eine + // Fehlermeldung für den Anwendere + if (childs.size() > 0) { + String hauptBuchungsperiode = workitem.getItemValueString("invoice.period"); + boolean buchungsperiodenValid = false; + for (ItemCollection posItem : childs) { + String posBuchungsperiode = posItem.getItemValueString("invoice.period"); + if (posBuchungsperiode.isEmpty() || posBuchungsperiode.equals(hauptBuchungsperiode)) { + // alles fein! + buchungsperiodenValid = true; + } + } + if (buchungsperiodenValid == false) { + // fehlerhafte Buchungsperioden. + String message = resourceBundleHandler.findMessage("ERROR_MAIN_BOOKING_PERIOD"); + throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message); + } + } + } } - } return workitem; @@ -309,7 +293,7 @@ public class InvoicePlugin extends AbstractPlugin { // wenn _invoicenumber_duplicate bereits gesetzt ist - dann geht es ohne prüfung // weiter if (!invoiceNumberDuplicate.isEmpty()) { - logger.warning("...validateion skipped by user with duplicate invoice number: " + invoiceNumber); + logger.warning("...validation skipped by user with duplicate invoice number: " + invoiceNumber); } else { // set _invoicenumber_duplicate - dadurch wird die warnmeldung ausgegeben und @@ -335,7 +319,7 @@ public class InvoicePlugin extends AbstractPlugin { * Datensatz übertragen. Dadurch muss man nicht extra die Kreditoren Verwaltung * aufrufen. Es ist ein art selbst-lernendes System. *

- * Die Mehtode ruft eine Plugin Exception aus um den User zu fragen ob er das + * Die Methode ruft eine Plugin Exception aus um den User zu fragen ob er das * möchte. * * @throws PluginException diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/spaceref.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/spaceref.xhtml index 94593e0..da2a96d 100644 --- a/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/spaceref.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/spaceref.xhtml @@ -2,24 +2,39 @@ xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core" xmlns:h="http://xmlns.jcp.org/jsf/html"> + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/spaceref_old.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/spaceref_old.xhtml new file mode 100644 index 0000000..94593e0 --- /dev/null +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/spaceref_old.xhtml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/workflow/ams/rechnungseingang-ams-1.0.0.bpmn b/workflow/ams/rechnungseingang-ams-1.0.0.bpmn index 478ce7b..c7534f3 100644 --- a/workflow/ams/rechnungseingang-ams-1.0.0.bpmn +++ b/workflow/ams/rechnungseingang-ams-1.0.0.bpmn @@ -3242,13 +3242,6 @@ result.isValid=true; - - - - - - - @@ -3258,7 +3251,7 @@ result.isValid=true; - + /> @@ -3831,10 +3824,10 @@ Export erfolgt über eine asynchrone Verarbeitung im Modell 'cargosoft-export']] suggest false - rechnungseingang-sachrechnung-de-1.0 + (^rechnungseingang-sachrechnung-[a-z]{2,3}-\d+(?:\.\d+)?$) 5001 980 - ]]> +]]> @@ -4450,6 +4443,7 @@ Export erfolgt über eine asynchrone Verarbeitung im Modell 'cargosoft-export']] +