From 8083db6b31733487d18b9ac4c05155215159897d Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Mon, 8 Feb 2021 12:37:10 +0100 Subject: [PATCH] fixed validierung --- .../com/alexanderlogistics/InvoicePlugin.java | 22 +- workflow/rechnungseingang-de-1.0.3.bpmn | 14 +- workflow/rechnungseingang-de-1.0.4.bpmn | 3022 +++++++++++++++++ 3 files changed, 3042 insertions(+), 16 deletions(-) create mode 100644 workflow/rechnungseingang-de-1.0.4.bpmn 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 a862636..de5d12e 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 @@ -21,9 +21,13 @@ import org.imixs.workflow.exceptions.PluginException; * */ public class InvoicePlugin extends AbstractPlugin { + + public static final int TASK_SACHPRUEFUNG = 5200; + public static final int EVENT_FREIGEBEN = 20; + public static final String CHILD_ITEM_PROPERTY = "_ChildItems"; public static final String ERROR_MISSING_DATA = "MISSING_DATA"; - + // XX-YYY-####-### public static final String REGEX_POSNUMER = "([A-Z]{2}-[A-Z]{3}-[0-9]{4}-[0-9]{3})"; @@ -39,8 +43,9 @@ public class InvoicePlugin extends AbstractPlugin { @Override public ItemCollection run(ItemCollection workitem, ItemCollection documentActivity) throws PluginException { - // die prüfung der positionsnummern und Category erfolgt nur im Status 5200 ! - if (workitem.getTaskID() == 5200) { + // 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.getEventID() == EVENT_FREIGEBEN) { List childs = explodeChildList(workitem); for (ItemCollection posItem : childs) { if (posItem.getItemValueString("name").trim().isEmpty()) { @@ -49,23 +54,22 @@ public class InvoicePlugin extends AbstractPlugin { "Eingabefehler - Die Positionsnummer in Zeile " + posItem.getItemValueString("numpos") + " muss aufgefüllt sein!"); } - + // validate pos for regex pattern 'XX-YYY-####-###' - if (! posItem.getItemValueString("name").matches(REGEX_POSNUMER)) { - // throw a plugin exception - because name is missing! + if (!posItem.getItemValueString("name").matches(REGEX_POSNUMER)) { + // throw a plugin exception - because name is missing! throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, "Eingabefehler - Die Positionsnummer in Zeile " + posItem.getItemValueString("numpos") + " muss im Format 'XX-YYY-####-###' eingeben werden!"); } - - + if (posItem.getItemValueString("category").trim().isEmpty()) { // throw a plugin exception - because name is missing! throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, "Eingabefehler - Die Leistungsart in Zeile " + posItem.getItemValueString("numpos") + " muss aufgefüllt sein!"); } - + if (posItem.getItemValueString("tax").trim().isEmpty()) { // throw a plugin exception - because name is missing! throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, diff --git a/workflow/rechnungseingang-de-1.0.3.bpmn b/workflow/rechnungseingang-de-1.0.3.bpmn index 6bb144d..ee02691 100644 --- a/workflow/rechnungseingang-de-1.0.3.bpmn +++ b/workflow/rechnungseingang-de-1.0.3.bpmn @@ -1058,12 +1058,12 @@ Betrag: _amount (Brutto € _amount_brutto !workitem['space.team'] || workitem['space.team'][0]=="" - + SequenceFlow_18 SequenceFlow_1 SequenceFlow_5 - + workitem['payment.type'] && workitem['payment.type'][0]!="direct_debit" @@ -1071,7 +1071,7 @@ Betrag: _amount (Brutto € _amount_bruttoSequenceFlow_5 SequenceFlow_4 - + workitem['payment.type'] && workitem['payment.type'][0]=="direct_debit" @@ -2236,7 +2236,7 @@ result.isValid=true; - Wurde ein Prozess Manager festgelegt, erfolgt eine Genehmigung. + Es handelt sich um einen SEPA Lauf. Die Rechnung muss explizit freigegeben werden. @@ -2425,7 +2425,7 @@ und invoice.total >0 (keine Gutschriften) - + @@ -2760,7 +2760,7 @@ und invoice.total >0 (keine Gutschriften) - + @@ -2768,7 +2768,7 @@ und invoice.total >0 (keine Gutschriften) - + diff --git a/workflow/rechnungseingang-de-1.0.4.bpmn b/workflow/rechnungseingang-de-1.0.4.bpmn new file mode 100644 index 0000000..ad0ea5b --- /dev/null +++ b/workflow/rechnungseingang-de-1.0.4.bpmn @@ -0,0 +1,3022 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ExclusiveGateway_4 + Task_2 + ExclusiveGateway_1 + StartEvent_1 + IntermediateCatchEvent_3 + IntermediateCatchEvent_13 + IntermediateCatchEvent_5000-20 + IntermediateCatchEvent_6 + EventBasedGateway_1 + IntermediateCatchEvent_19 + IntermediateThrowEvent_3 + + + ExclusiveGateway_3 + IntermediateCatchEvent_2 + ExclusiveGateway_6 + IntermediateCatchEvent_5005-20 + EventBasedGateway_2 + Task_5005 + IntermediateCatchEvent_5005-10 + IntermediateCatchEvent_5005-30 + ExclusiveGateway_5 + IntermediateCatchEvent_21 + + + Task_5000 + EventBasedGateway_4 + IntermediateCatchEvent_16 + IntermediateCatchEvent_15 + IntermediateThrowEvent_1 + IntermediateCatchEvent_5000-10 + + + Task_3 + IntermediateCatchEvent_17 + ExclusiveGateway_2 + IntermediateCatchEvent_4 + Task_6 + Task_7 + IntermediateCatchEvent_18 + Task_5 + EndEvent_2 + IntermediateCatchEvent_14 + IntermediateCatchEvent_8 + IntermediateCatchEvent_20 + Task_4 + Task_8 + IntermediateCatchEvent_12 + IntermediateCatchEvent_7 + EndEvent_1 + EndEvent_3 + + + IntermediateCatchEvent_9 + Task_1 + IntermediateCatchEvent_11 + IntermediateThrowEvent_5 + IntermediateCatchEvent_10 + IntermediateCatchEvent_1 + + + + + + + + + txtlastcomment]]> + + + + + + + + + numsequencenumber: cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_31 + SequenceFlow_1 + SequenceFlow_32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + false + + + + SequenceFlow_31 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + space.name]]> + + + false + + + + + + + SequenceFlow_46 + SequenceFlow_24 + + + SequenceFlow_0 + SequenceFlow_15 + SequenceFlow_21 + SequenceFlow_33 + + + + SequenceFlow_0 + + + + + + + + + txtlastcomment]]> + + + + + + + + + numsequencenumber: cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_38 + SequenceFlow_34 + SequenceFlow_37 + + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home +space.name + + + cargosoft-export-1.0 + 1000 + 100 + (?!txtworkflowhistory)(^[a-zA-Z]|^_) + +]]> + + + + + + + + + + + + false + + + 0 && (parseFloat(a)!=parseFloat(b)) ) { + result.isValid=false; + result.errorMessage="Der Rechnungsbetrag " + a+ " stimmt nicht mit dem Positionsbetrag " + b + " überein."; + }]]> + + + + SequenceFlow_8 + SequenceFlow_51 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + false + + + + SequenceFlow_38 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home +space.name +false]]> + + + + + + + + + + + + false + + + + + + + SequenceFlow_10 + SequenceFlow_41 + + + SequenceFlow_37 + SequenceFlow_8 + SequenceFlow_10 + SequenceFlow_54 + + + + + + + + + + txtlastcomment]]> + + + + + + + + + cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_33 + SequenceFlow_20 + SequenceFlow_22 + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + false + + + + + SequenceFlow_20 + + + + + + + + + txtlastcomment]]> + + + + + + + + + numsequencenumber: cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_4 + SequenceFlow_55 + SequenceFlow_50 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home +false]]> + + + + + + + + + + + + false + + + + + + + SequenceFlow_29 + SequenceFlow_52 + + + SequenceFlow_32 + SequenceFlow_29 + SequenceFlow_30 + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + false + + + + SequenceFlow_30 + SequenceFlow_7 + + + + + + + + + + + txtlastcomment]]> + + + + + + + + + numsequencenumber: cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_25 + SequenceFlow_44 + SequenceFlow_47 + + + SequenceFlow_47 + + + + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + false + + + + SequenceFlow_55 + SequenceFlow_12 + + + + + SequenceFlow_24 + SequenceFlow_13 + SequenceFlow_16 + + + workitem['space.team'] && workitem['space.team'][0]!="" + + + !workitem['space.team'] || workitem['space.team'][0]=="" + + + SequenceFlow_18 + SequenceFlow_1 + SequenceFlow_5 + + + workitem['payment.type'] && workitem['payment.type'][0]!="direct_debit" + + + SequenceFlow_7 + SequenceFlow_5 + SequenceFlow_4 + + + workitem['payment.type'] && workitem['payment.type'][0]=="direct_debit" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + SequenceFlow_6 + SequenceFlow_18 + + + SequenceFlow_51 + SequenceFlow_16 + SequenceFlow_6 + + + + SequenceFlow_15 + + + + + SequenceFlow_52 + + + + + + + SequenceFlow_12 + SequenceFlow_53 + SequenceFlow_19 + SequenceFlow_25 + + + + + + + + + + + + + + SequenceFlow_19 + SequenceFlow_23 + + + + var a=workitem.get("invoice.total")[0]; + +workitem['payment.type'] && workitem['payment.type'][0]!="direct_debit" && a>0 + + + + var a=workitem.get("invoice.total")[0]; + +!(workitem['payment.type'] && workitem['payment.type'][0]!="direct_debit" && a>0) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Rechnungscontrolling]]> + + + + + + + + + + + + false + + + + SequenceFlow_21 + + + + + + + + + + + txtlastcomment]]> + + + + + + + + + numsequencenumber: cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_13 + SequenceFlow_26 + SequenceFlow_41 + SequenceFlow_11 + SequenceFlow_28 + SequenceFlow_36 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + false + + + + SequenceFlow_26 + + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home +space.name]]> + + + + + + + + + + + + false + + + + + + + SequenceFlow_28 + SequenceFlow_34 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home +space.name +false]]> + + + + + + + + + + + + false + + + + + + + SequenceFlow_36 + SequenceFlow_35 + + + SequenceFlow_35 + + + + + + SequenceFlow_39 + + + + + + + + + txtlastcomment]]> + + + + + + + + + numsequencenumber: cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_39 + SequenceFlow_40 + + + SequenceFlow_40 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + space.name]]> + + + false + + + + SequenceFlow_11 + + + + + + + + + txtlastcomment]]> + + + + + + + + + numsequencenumber: cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_23 + SequenceFlow_45 + SequenceFlow_14 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1]]> + + + + + + + + + + + + + + + false + + + SequenceFlow_14 + SequenceFlow_42 + + + + + + + + + + + txtlastcomment]]> + + + + + + + + + numsequencenumber: cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_42 + SequenceFlow_43 + SequenceFlow_27 + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + false + + + + SequenceFlow_43 + SequenceFlow_44 + + + + + + + + + + SequenceFlow_27 + SequenceFlow_45 + + + + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + false + + + + + + + + + + + + + + + SequenceFlow_50 + SequenceFlow_53 + + + + + + + + + + + cdtr.name invoice.number]]> + + + + + + + + + cdtr.name +Rechnungsnummer: invoice.number +Betrag: invoice.total invoice.currency + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + home +false]]> + + + + + + + + + + + + false + + + + + + + + + + SequenceFlow_54 + SequenceFlow_56 + + + + + SequenceFlow_56 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + txtlastcomment]]> + + + + + + + + + numsequencenumber: cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_17 + SequenceFlow_9 + + + SequenceFlow_9 + + + + SequenceFlow_17 + + + + + SequenceFlow_22 + SequenceFlow_46 + SequenceFlow_49 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home +false +Wollen Sie den Vorgang wirklich löschen?]]> + + + + + + + + + + + + false + + + + + + + SequenceFlow_49 + SequenceFlow_48 + + + SequenceFlow_48 + + + + + + + Es handelt sich um einen SEPA Lauf. Die Rechnung muss explizit freigegeben werden. + + + + Die Rechnung wurde sachlich geprüft und genehmigt und kann nun in den Zahlungslauf übergeben werden. + + + + + Datenübergabe an Cargosoft. + +Export erfolgt über eine asynchrone Verarbeitung im Modell 'cargosoft-export' + + + + 0 (keine Gutschriften)]]> + Payment = Sepa +und invoice.total >0 (keine Gutschriften) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file