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 0cb5cf5..0c4d8a6 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 @@ -190,8 +190,8 @@ public class InvoicePlugin extends AbstractPlugin { LocalDate localDate = LocalDate.now(); int year = localDate.getYear(); // build regex.... - String regex = "(" + year + "|" + (year + 1) + ")(1[0-2]|0[1-9])"; - + String regex = "(" + year + "|" + (year + 1) + "|" + (year - 1) + ")(1[0-2]|0[1-9])"; + if (!period.matches(regex)) { // throw a plugin exception - because name is missing! throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA,