diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 671e411..2f97af6 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -4,7 +4,7 @@
### 1.2.19 (Development)
- Neue XML Invoice Schnittstelle
- - Mahnwesen englisch (noch nicht begonnen!)
+ - Mahnwesen englisch
### 1.2.18
diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/CargosoftXMLInvoiceImportImportService.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/CargosoftXMLInvoiceImportImportService.java
index 4f734ae..3c6433e 100644
--- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/CargosoftXMLInvoiceImportImportService.java
+++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/CargosoftXMLInvoiceImportImportService.java
@@ -114,6 +114,7 @@ public class CargosoftXMLInvoiceImportImportService {
private static Logger logger = Logger.getLogger(CargosoftXMLInvoiceImportImportService.class.getName());
public static final String OPTION_MANDANT_ID = "mandant.id";
public static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
+ public static final String REGEX_IMPORTTEXTPATTERN = "^R[1-8] .*$";
@EJB
WorkflowService workflowService;
@@ -443,11 +444,17 @@ public class CargosoftXMLInvoiceImportImportService {
}
// Row Positions lesen
- // InvoiceRows/InvoiceRow
readXMLRows(doc, workitem);
+
// Jetzt noch das Space mapping
mahnlaufService.mapInvoiceTextToSpace(workitem, spacePosMappings);
+ // Rückstellungen ignorieren
+ if (isRueckStellung(workitem)) {
+ // Ignore invoice!
+ return null;
+ }
+
// Finally we attache the pdf file and the XML conent to the workitem.
attacheFiles(doc, workitem);
@@ -458,6 +465,19 @@ public class CargosoftXMLInvoiceImportImportService {
return workitem;
}
+ /**
+ * Prüft ob die Rechnung eine Rückstellung ist also mit R1 bis R8 beginnt
+ *
+ * ^R[1-8] .
+ *
+ * @param workitem
+ * @return
+ */
+ private boolean isRueckStellung(ItemCollection workitem) {
+ String text = workitem.getItemValueString("invoice.text");
+ return text.matches(REGEX_IMPORTTEXTPATTERN);
+ }
+
/**
* Reads a tag value from the xml tree and set the value into the given
* workitem.
diff --git a/workflow/rechnungsausgang-de-1.0.7.bpmn b/workflow/rechnungsausgang-de-1.0.7.bpmn
new file mode 100644
index 0000000..ff60fbb
--- /dev/null
+++ b/workflow/rechnungsausgang-de-1.0.7.bpmn
@@ -0,0 +1,4063 @@
+
+
Thank you for your cooperation.
++
Kind regards
Alexander Global Logistics GmbH