verbesserter XML import - skip rückstellungen

This commit is contained in:
Ralph Soika 2024-06-05 09:19:18 +02:00
parent 7a728fc298
commit d0dc2167ff
3 changed files with 4085 additions and 2 deletions

View file

@ -4,7 +4,7 @@
### 1.2.19 (Development) ### 1.2.19 (Development)
- Neue XML Invoice Schnittstelle - Neue XML Invoice Schnittstelle
- Mahnwesen englisch (noch nicht begonnen!) - Mahnwesen englisch
### 1.2.18 ### 1.2.18

View file

@ -114,6 +114,7 @@ public class CargosoftXMLInvoiceImportImportService {
private static Logger logger = Logger.getLogger(CargosoftXMLInvoiceImportImportService.class.getName()); private static Logger logger = Logger.getLogger(CargosoftXMLInvoiceImportImportService.class.getName());
public static final String OPTION_MANDANT_ID = "mandant.id"; 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 DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
public static final String REGEX_IMPORTTEXTPATTERN = "^R[1-8] .*$";
@EJB @EJB
WorkflowService workflowService; WorkflowService workflowService;
@ -443,11 +444,17 @@ public class CargosoftXMLInvoiceImportImportService {
} }
// Row Positions lesen // Row Positions lesen
// InvoiceRows/InvoiceRow
readXMLRows(doc, workitem); readXMLRows(doc, workitem);
// Jetzt noch das Space mapping // Jetzt noch das Space mapping
mahnlaufService.mapInvoiceTextToSpace(workitem, spacePosMappings); 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. // Finally we attache the pdf file and the XML conent to the workitem.
attacheFiles(doc, workitem); attacheFiles(doc, workitem);
@ -458,6 +465,19 @@ public class CargosoftXMLInvoiceImportImportService {
return workitem; 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 * Reads a tag value from the xml tree and set the value into the given
* workitem. * workitem.

File diff suppressed because it is too large Load diff