From 510493e849743b2c59b7f8735b84cf7134864eee Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Thu, 11 Jan 2024 14:03:17 +0100 Subject: [PATCH] neuer Sepa Workflow (manual) --- .../resources/bundle/custom_de.properties | 7 ++ .../resources/bundle/custom_en.properties | 5 ++ .../workitems/forms/sepa_export_manual.xhtml | 87 +++++++++++++++++++ .../com/alexanderlogistics/TestFormat.java | 85 +++++++++--------- workflow/sepa-export-manual-pl-3.0.1.bpmn | 7 +- 5 files changed, 143 insertions(+), 48 deletions(-) create mode 100644 office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/sepa_export_manual.xhtml diff --git a/office-alexander-logistics-app/src/main/resources/bundle/custom_de.properties b/office-alexander-logistics-app/src/main/resources/bundle/custom_de.properties index 67e782b..ab06256 100644 --- a/office-alexander-logistics-app/src/main/resources/bundle/custom_de.properties +++ b/office-alexander-logistics-app/src/main/resources/bundle/custom_de.properties @@ -26,6 +26,13 @@ pos.type=Leistungsart pos.net=Netto pos.gross=Brutto + +creditor_name=Kreditor +invoicenumber=Rechnungsnummer +invoicedate=Rechnungsdatum +amount=Betrag + + ERROR_CDTR_INVALID=Die Kreditorennummer ist nicht gültig ERROR_BOOKING_PERIOD=Eingabefehler - Bitte geben Sie eine gültige Buchungsperiode ein! Prüfen Sie auch die Spalte BP in der Positionstabelle. ERROR_MAIN_BOOKING_PERIOD=Eingabefehler - Bitte überprüfen Sie die Hauptbuchungsperiode mit den Buchungsperioden der einzelnen Positionen. diff --git a/office-alexander-logistics-app/src/main/resources/bundle/custom_en.properties b/office-alexander-logistics-app/src/main/resources/bundle/custom_en.properties index 67bb350..b50fb44 100644 --- a/office-alexander-logistics-app/src/main/resources/bundle/custom_en.properties +++ b/office-alexander-logistics-app/src/main/resources/bundle/custom_en.properties @@ -26,6 +26,11 @@ pos.type=Type pos.net=Net pos.gross=Gross +creditor_name=Creditor +invoicenumber=Invoice No. +invoicedate=Invoice Date +amount=Amount + ERROR_CDTR_INVALID=The creditor number is not valid ERROR_BOOKING_PERIOD=Input error - Please enter a valid booking period! Also check the BP column in the position table. ERROR_MAIN_BOOKING_PERIOD=Input errors - Please check the main booking period with the booking periods of each item. diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/sepa_export_manual.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/sepa_export_manual.xhtml new file mode 100644 index 0000000..5808284 --- /dev/null +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/sepa_export_manual.xhtml @@ -0,0 +1,87 @@ + + + +
+
+
IBAN
+
+ +
+
+ + +
+
BIC
+
+ +
+ +
+
+ + +
+

Invoices

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#{custom.creditor_name}#{custom.invoicenumber}#{custom.invoicedate}#{custom.amount}IBANBIC
+ + #{invoice.item['cdtr.name.cargosoft']} + + + #{invoice.item['invoice.number']} + + + + + + + + #{invoice.item['invoice.currency']}#{invoice.item ['cdtr.iban']}#{invoice.item['cdtr.bic']}
+ + Summary + + + + #{invoice.item['_currency']} + +
+
+ + +
\ No newline at end of file diff --git a/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/TestFormat.java b/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/TestFormat.java index d380543..69a596a 100644 --- a/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/TestFormat.java +++ b/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/TestFormat.java @@ -1,5 +1,7 @@ package com.alexanderlogistics; +import static org.junit.Assert.fail; + import java.text.DateFormat; import java.text.DecimalFormat; import java.text.ParseException; @@ -43,33 +45,34 @@ public class TestFormat { total = 0.5; logger.info(decimalFormat.format(total)); } - - /* - * 52329,42;"H";"EUR";0,000000;0,00;"";"8017";"14174";"";"0702";"191674";"";"";"R EX-GCA-2212-004";0;"";"";"";0;"";"";"";"Faelligkeit";"20230408";"";"";"";"";"";"";"Zahlungsbedingung";"08";"";"";"";"";"90";"";"";"DE815871706";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"SO";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";0;"01012023";"" - + * 52329,42;"H";"EUR";0,000000;0,00;"";"8017";"14174";"";"0702";"191674";""; + * "";"R EX-GCA-2212-004";0;"";"";"";0;"";"";"";"Faelligkeit";"20230408";"";""; + * "";"";"";"";"Zahlungsbedingung";"08";"";"";"";"";"90";"";"";"DE815871706";""; + * "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"" + * ;"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""; + * "";"";"";"SO";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";0;"01012023" + * ;"" + * */ @Test public void testDatum() { SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyyMMdd"); - String testDate="20230408"; + String testDate = "20230408"; try { - Date dateResult=dateFormatter.parse(testDate); - System.out.println("Result1 Date="+dateResult); - - - - testDate=DatevImportAdapter.csvVal("20230408"); - System.out.println("Result2 Date="+dateResult); - + Date dateResult = dateFormatter.parse(testDate); + System.out.println("Result1 Date=" + dateResult); + + testDate = DatevImportAdapter.csvVal("20230408"); + System.out.println("Result2 Date=" + dateResult); + } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); Assert.fail(); } - - + } @Test @@ -81,54 +84,50 @@ public class TestFormat { kurs = 0; logger.info(rateFormat.format(kurs)); } - @Test public void testRegex() { - String text="RG-EX-SAL-2211-036"; - String expr="\\bEX-SAL"; - + String text = "RG-EX-SAL-2211-036"; + String expr = "\\bEX-SAL"; + Pattern p = Pattern.compile(expr); - + p = Pattern.compile(expr); Matcher m = p.matcher(text); - if (m.find()) { - System.out.println("Ich bin ein Held"); + if (!m.find()) { + fail(); } } @Test public void testRegex2() { - String text="R IM-GCA-2210-031"; - String expr="\\bIM-GCA"; - + String text = "R IM-GCA-2210-031"; + String expr = "\\bIM-GCA"; + Pattern p = Pattern.compile(expr); - + p = Pattern.compile(expr); Matcher m = p.matcher(text); - if (m.find()) { - System.out.println("Ich bin ein Held"); - } else { - System.out.println("Ich bin Kein Held"); + if (!m.find()) { + fail(); } } - + @Test public void testSMTPMailAddress() { - - Assert.assertTrue(InvoiceUtil.validateEmail("info@imixs.com")); - - Assert.assertFalse(InvoiceUtil.validateEmail("in fo@imixs.com")); - - Assert.assertFalse(InvoiceUtil.validateEmail("SM PSP Queries ")); - - Assert.assertTrue(InvoiceUtil.validateEmail("PSP.Queries@dssmith.com")); - - Assert.assertTrue(InvoiceUtil.validateEmail("accounts-sg@swiftmarine.global")); - + + Assert.assertTrue(InvoiceUtil.validateEmail("info@imixs.com")); + + Assert.assertFalse(InvoiceUtil.validateEmail("in fo@imixs.com")); + + Assert.assertFalse(InvoiceUtil.validateEmail("SM PSP Queries ")); + + Assert.assertTrue(InvoiceUtil.validateEmail("PSP.Queries@dssmith.com")); + + Assert.assertTrue(InvoiceUtil.validateEmail("accounts-sg@swiftmarine.global")); + } - } diff --git a/workflow/sepa-export-manual-pl-3.0.1.bpmn b/workflow/sepa-export-manual-pl-3.0.1.bpmn index 7edac28..61431c5 100644 --- a/workflow/sepa-export-manual-pl-3.0.1.bpmn +++ b/workflow/sepa-export-manual-pl-3.0.1.bpmn @@ -172,7 +172,7 @@ - $created (dbtr.name)]]> + $created (dbtr.name)]]> true @@ -193,7 +193,7 @@ - + SEPA-Lauf
Corporate: dbtr.name
Erstellt am: $created
@@ -756,9 +756,6 @@ The SEPA Export process runs on a scheduled basis (e.g. once a day) - - -