fix validierung
This commit is contained in:
parent
988a831200
commit
c7ec908f4e
1 changed files with 19 additions and 1 deletions
|
|
@ -104,7 +104,7 @@ public class InvoicePlugin extends AbstractPlugin {
|
||||||
if (isPublicEvent) {
|
if (isPublicEvent) {
|
||||||
|
|
||||||
// validate Partner id....
|
// validate Partner id....
|
||||||
if (businessPartner == null) {
|
if (businessPartner == null && isCargoRechnung(workitem)) {
|
||||||
String message = resourceBundleHandler.findMessage("ERROR_MISSING_BUSINESSPARTNER");
|
String message = resourceBundleHandler.findMessage("ERROR_MISSING_BUSINESSPARTNER");
|
||||||
throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message);
|
throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA, message);
|
||||||
}
|
}
|
||||||
|
|
@ -424,4 +424,22 @@ public class InvoicePlugin extends AbstractPlugin {
|
||||||
// Überprüfen, ob das Muster übereinstimmt
|
// Überprüfen, ob das Muster übereinstimmt
|
||||||
return matcher.matches();
|
return matcher.matches();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method returns true if the current workitem is a Sachrechnung.
|
||||||
|
*
|
||||||
|
* This can be based on different model versions e.g. rechnungseingang-de-1.2,
|
||||||
|
* rechnungseingang-pl-1.0, rechnungseingang-dwc-1.0, ...
|
||||||
|
*
|
||||||
|
* @param workitem
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isSachrechnungRechnung(ItemCollection workitem) {
|
||||||
|
String REGEX_PATTERN = "rechnungseingang-sachrechnung-([a-z]{2}|[a-z]{3})-\\d.\\d";
|
||||||
|
// Erstellen Sie ein Pattern-Objekt
|
||||||
|
Pattern pattern = Pattern.compile(REGEX_PATTERN);
|
||||||
|
Matcher matcher = pattern.matcher(workitem.getModelVersion());
|
||||||
|
// Überprüfen, ob das Muster übereinstimmt
|
||||||
|
return matcher.matches();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue