From 7217b76b433eef558501cfac2c7c2b0fe7df3862 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Tue, 22 Oct 2024 12:03:59 +0200 Subject: [PATCH] fix steuerbescheid ATC --- .../api/CargosoftMigrationRestService.java | 126 ++ .../xml/CargosoftXMLInvoiceImportService.java | 3 +- pom.xml | 8 +- workflow/steuerbescheid-de-1.0.6.bpmn | 1387 +++++++++++++++++ 4 files changed, 1519 insertions(+), 5 deletions(-) create mode 100644 workflow/steuerbescheid-de-1.0.6.bpmn diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java index e1c0e09..bdaf303 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java @@ -396,6 +396,132 @@ public class CargosoftMigrationRestService implements Serializable { return log; } + /** + * Dieser agent prüft die Rechnungen der letzten 2 Wochen auf einen Billingtext + * der mit "24DE" beginnt und übernimmt dann diesen Text als neue ATC number + * + * @return + * @throws QueryException + * @throws AccessDeniedException + * @throws ProcessingErrorException + * @throws PluginException + * @throws ModelException + */ + @GET + @Path("/fix-atc") + @Produces({ MediaType.TEXT_PLAIN }) + public String fixATCNumber() + throws QueryException, AccessDeniedException, ProcessingErrorException, PluginException, ModelException { + String query = "($modelversion:rechnungsausgang-de-1.0) " + + "AND $created:[20241001 TO 20241201]"; + logger.info("query=" + query); + log = "Query\n\n" + query; + + List result = documentService.find(query, 9999, 0); + + log = log + "\n\nSelection Count=" + result.size(); + log = log + "\n\nFixes:\n\n"; + + for (ItemCollection workitem : result) { + logger.info("verify: " + workitem.getUniqueID()); + + if (!workitem.hasItem("invoice.atc.number")) { + // Fetch _childitems and check billingText + List childs = InvoiceUtil.explodeChildList(workitem); + for (ItemCollection child : childs) { + List billingTexts = child.getItemValueList("billingtext", String.class); + boolean contains24DE = false; + String atcNumber = ""; + for (String str : billingTexts) { + if (str.startsWith("24DE")) { + contains24DE = true; + atcNumber = str; + logger.info(" found in " + workitem.getUniqueID()); + break; + } + } + if (contains24DE) { + count++; + workitem.setItemValue("invoice.atc.number", atcNumber); + // save only + logger.info(" update: " + workitem.getUniqueID()); + log = log + "\n - " + workitem.getUniqueID(); + documentService.save(workitem); + break; + } + } + + } + } + + log = log + "\n\n=== Completed! " + count + " fixes! ===\n\n"; + return log; + } + + /** + * Dieser agent prüft die Rechnungen der letzten 2 Wochen auf einen Billingtext + * der mit "24DE" beginnt und übernimmt dann diesen Text als neue ATC number + * + * @return + * @throws QueryException + * @throws AccessDeniedException + * @throws ProcessingErrorException + * @throws PluginException + * @throws ModelException + */ + @GET + @Path("/fix-atc2") + @Produces({ MediaType.TEXT_PLAIN }) + public String fixATCNumber2() + throws QueryException, AccessDeniedException, ProcessingErrorException, PluginException, ModelException { + String query = "($modelversion:rechnungsausgang-de-1.0) " + + "AND $created:[20241001 TO 20241201]"; + logger.info("query=" + query); + log = "Query\n\n" + query; + + List result = documentService.find(query, 9999, 0); + + log = log + "\n\nSelection Count=" + result.size(); + log = log + "\n\nFixes:\n\n"; + + for (ItemCollection workitem : result) { + logger.info("verify: " + workitem.getUniqueID()); + + if (workitem.hasItem("invoice.atc.number")) { + // Fetch _childitems and check billingText + List childs = InvoiceUtil.explodeChildList(workitem); + for (ItemCollection child : childs) { + List billingTexts = child.getItemValueList("billingtext", String.class); + boolean contains24DE = false; + String atcNumber = ""; + for (String str : billingTexts) { + if (str.startsWith("24DE")) { + contains24DE = true; + atcNumber = str; + logger.info(" found in " + workitem.getUniqueID()); + child.setItemValue("atc.number", atcNumber); + break; + } + } + if (contains24DE) { + count++; + + InvoiceUtil.implodeChildList(workitem, childs); + // save only + logger.info(" update: " + workitem.getUniqueID()); + log = log + "\n - " + workitem.getUniqueID(); + documentService.save(workitem); + break; + } + } + + } + } + + log = log + "\n\n=== Completed! " + count + " fixes! ===\n\n"; + return log; + } + public String fixFehlerhafteCargosoftDatenMitSnapshot() throws QueryException, AccessDeniedException, ProcessingErrorException, PluginException, ModelException { diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/CargosoftXMLInvoiceImportService.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/CargosoftXMLInvoiceImportService.java index 0fd6b37..ee65284 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/CargosoftXMLInvoiceImportService.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/CargosoftXMLInvoiceImportService.java @@ -701,7 +701,8 @@ public class CargosoftXMLInvoiceImportService { String val = billingTextNodes.item(bi).getTextContent(); childItemCol.appendItemValue("BillingText", val); // handelt es sich um eine ATC Nummer? - if (val.startsWith("ATC")) { + // Änderung 22.10.2024 - jetzt auch auf 24DE prüfen + if (val.startsWith("ATC") || val.startsWith("24DE")) { childItemCol.setItemValue("atc.number", val); } } diff --git a/pom.xml b/pom.xml index 408a23b..4b7ac54 100644 --- a/pom.xml +++ b/pom.xml @@ -26,16 +26,16 @@ 10.0.0 5.0.3-SNAPSHOT - 6.0.8-SNAPSHOT + 6.0.8 5.0.0 3.0.2 - 3.0.2-SNAPSHOT - 2.0.0-SNAPSHOT + 3.0.2 + 2.0.2 6.0 9.9.1-4 2.0.26 - 1.1.0-SNAPSHOT + 1.1.0 src/main/webapp diff --git a/workflow/steuerbescheid-de-1.0.6.bpmn b/workflow/steuerbescheid-de-1.0.6.bpmn new file mode 100644 index 0000000..ba24a0f --- /dev/null +++ b/workflow/steuerbescheid-de-1.0.6.bpmn @@ -0,0 +1,1387 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + +<itemvalue>$workflowstatus</itemvalue> + +]]> + + + +]]> + + + + + + + + + + + + + + + + + + + + StartEvent_1 + Task_1 + IntermediateCatchEvent_3 + Task_4 + EndEvent_3 + + DataObject_2 + event_XJbC5A + textAnnotation_HwSKqQ + event_9fS4uw + event_mPDOzA + gateway_u86UTw + gateway_5riVig + event_0j5Tyg + gateway_4Jce4w + task_Xtwzqw + textAnnotation_SkyWAQ + task_O06T6Q + event_uYUtGg + event_SXqpPw + gateway_yONKfQ + gateway_XuJUAw + event_CGDJnQ + event_q0jrHA + event_bQtvJQ + event_gskJ4Q + task_OLIdnQ + event_x7R5Sw + event_ZEDh4Q + task_Em0QgQ + dataObject_P0BaVA + + + + + sequenceFlow_ikwt6g + + + SequenceFlow_19 + + + + + + invoice.number invoice.booking_text invoice.atc.number vom invoice.date ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AbteilungBelegdatumSumme Zoll/EUStSaldo + + + space.name + invoice.date + invoice.total.net + invoice.saldo + +]]> + + + $workflowgroup - $workflowstatus]]> + sequenceFlow_EzmiPA + sequenceFlow_rbVgQA + sequenceFlow_KOaBSw + sequenceFlow_tpBldQ + + + + + true + + + + + + + + + + + + + + + + + + invoice.number invoice.booking_text invoice.atc.number vom invoice.date ]]> + + + + + AbteilungBelegdatumSumme Zoll/EUStSaldo + + + space.name + invoice.date + invoice.total.net + invoice.saldo + +]]> + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_19 + sequenceFlow_d60CVg + + + + + + + + + + + + + + + + + + + + + Mahnwesen]]> + + + + sequenceFlow_ikwt6g + sequenceFlow_60LKZw + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + sequenceFlow_hLkSLA + sequenceFlow_oRy3qw + sequenceFlow_UW18Jw + + + + + + + + + + + + + + + + sequenceFlow_rbVgQA + + + + + + + + + + + + + + + + + + + + + + + + + sequenceFlow_tpBldQ + sequenceFlow_lrR0DQ + sequenceFlow_GmmBvA + + + + sequenceFlow_lrR0DQ + sequenceFlow_KOaBSw + sequenceFlow_hLkSLA + + + + sequenceFlow_EzmiPA + sequenceFlow_omVTTA + sequenceFlow_r7sdOg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + sequenceFlow_hLkSLA + sequenceFlow_aaLOTA + sequenceFlow_r7sdOg + sequenceFlow_HWrJ6A + + + + sequenceFlow_oRy3qw + sequenceFlow_d60CVg + sequenceFlow_aaLOTA + + + + + + + + + + + invoice.number invoice.booking_text invoice.atc.number vom invoice.date ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AbteilungBelegdatumSumme Zoll/EUStSaldo + + + space.name + invoice.date + invoice.total.net + invoice.saldo + +]]> + + + $workflowgroup - $workflowstatus]]> + sequenceFlow_J0GjVg + sequenceFlow_60LKZw + sequenceFlow_n9vw7A + Association_3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + invoice.number invoice.booking_text invoice.atc.number vom invoice.date ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AbteilungBelegdatumSumme Zoll/EUStSaldo + + + space.name + invoice.date + invoice.total.net + invoice.saldo + +]]> + + + $workflowgroup - $workflowstatus]]> + sequenceFlow_KOaBSw + sequenceFlow_HvXbYg + sequenceFlow_HWrJ6A + sequenceFlow_FTi0cA + sequenceFlow_QxNNCQ + sequenceFlow_QxaZJA + + + + + + + + + + + + + + + + + + + + + + + Html-Header +Mahnung +Html-Footer]]> + + + + + + + + + + + + invoice.atc.number wurde noch nicht abgerechnet!]]> + + + $lasteventdate + + reminder + @weekly +]]> + + + + + + + + + + + sequenceFlow_n9vw7A + sequenceFlow_omVTTA + sequenceFlow_o6glqQ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sequenceFlow_n9vw7A + sequenceFlow_HvXbYg + sequenceFlow_0AEnAQ + + + + + + + sequenceFlow_hLkSLA + sequenceFlow_0AEnAQ + sequenceFlow_sNhh5g + sequenceFlow_UW18Jw + + + + + + + + + + + + + + + + + sequenceFlow_o6glqQ + sequenceFlow_FTi0cA + sequenceFlow_sNhh5g + + + + + + + + + + + + + + + + + + + + + sequenceFlow_QxNNCQ + + + + + + + + + + + Html-Header +Mahnung +Html-Footer]]> + + + + + + + + + + + + invoice.atc.number wurde wiederholt noch nicht abgerechnet!]]> + + + + reminder + @weekly +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + sequenceFlow_QxaZJA + + + + + + + + + + + + + + + + + + + + + +X-Tika-OCRLanguage=deu +X-Tika-PDFocrStrategy=OCR_ONLY +(PDF|pdf)$ +10 +]]> + + + + sequenceFlow_n9vw7A + sequenceFlow_Kw58EQ + sequenceFlow_lwTFxw + + + + + + 1000 + + sequenceFlow_Kw58EQ + + + + + + + + invoice.number invoice.booking_text invoice.atc.number vom invoice.date ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AbteilungBelegdatumSumme Zoll/EUStSaldo + + + space.name + invoice.date + invoice.total.net + invoice.saldo + +]]> + + + $workflowgroup - $workflowstatus]]> + sequenceFlow_J0GjVg + Association_3 + sequenceFlow_lwTFxw + sequenceFlow_PMoo7w + + + + + + + + + + + + + + + + + + + + + false + + https://llama.cpp.imixs.com/ + XML + false +]]> + + + + sequenceFlow_Kw58EQ + sequenceFlow_PMoo7w + sequenceFlow_2NTSsQ + sequenceFlow_8NjTWw + + + + + + + + + sequenceFlow_2NTSsQ + + + + + + + + invoice.number invoice.booking_text invoice.atc.number vom invoice.date ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AbteilungBelegdatumSumme Zoll/EUStSaldo + + + space.name + invoice.date + invoice.total.net + invoice.saldo + +]]> + + + $workflowgroup - $workflowstatus]]> + sequenceFlow_J0GjVg + Association_3 + sequenceFlow_8NjTWw + sequenceFlow_GmmBvA + + + + + + + + + + + {"n_predict": 4096, "temperature": 0 } + ^.+\.([pP][dD][fF])$ + +[INST] Übertrage die Informationen aus dem Steuerbescheid in eine XML Struktur: + + + .... + + ... + + + + ... + + + + +Den Anmelder findest du im Absatz 'Anmelder'. Hier ist nur der Firmenname interessant und nicht die Steuernummer und Adresse. +Die Tabelle mit den Positionsnummern enthält einen oder mehrere Buchungsschlüssel (key) mit Detailinformationen. +Eine einzelne Positionszeile beginnt entweder mit dem Buchungsschlüssel 'A....' oder 'B....' und enthält optional ein Fälligkeitsdatum (duedate). + +Beachte: Füge keine Erklärungen oder Kommentare hinzu. Formatiere Datumswerte im ISO 8601-Format (YYYY-MM-DD). + +[/INST] + +]]]]> + + ]]> + + + + + + + + + + Hallo,

+

+folgender Steuerbescheid wurde bisher noch nicht abgerechnet. Bitte prüfen Sie diesen Vorgang: +

+

+application.urlpages/workitems/workitem.jsf?id=$uniqueid +

+

+Nachdem Sie die Rechnung erstellt haben, wird dieser Vorgang automatisch abgeschlossen. +

+

+Einen Überblick über alle überflälligen noch offenen Steuerbescheide finden Sie +hier + +([^\s]+(\.(?i)(pdf))$)]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +