diff --git a/office-alexander-logistics-app/pom.xml b/office-alexander-logistics-app/pom.xml index b4a5edd..eef04ef 100644 --- a/office-alexander-logistics-app/pom.xml +++ b/office-alexander-logistics-app/pom.xml @@ -5,7 +5,7 @@ office-alexander-logistics com.alexander-logistics - 1.1.0 + 1.1.1 office-alexander-logistics-app war 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 ba64fed..31c9501 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 @@ -43,7 +43,6 @@ public class InvoicePlugin extends AbstractPlugin { // XX-YYY-####-### public static final String REGEX_POSNUMER = "([A-Z]{2}-[A-Z]{3}-[0-9]{4}-[0-9]{3})"; - @SuppressWarnings("unused") private static Logger logger = Logger.getLogger(InvoicePlugin.class.getName()); /** @@ -74,13 +73,15 @@ public class InvoicePlugin extends AbstractPlugin { "Eingabefehler - Bitte wählen Sie eine Zahlungsart aus!"); } // doppelte Rechnungsnummer prüfen - if (workitem.getTaskID() == TASK_ERFASSUNG ) { + if (workitem.getTaskID() == TASK_ERFASSUNG) { validateInvoiceNumber(workitem); } if (workitem.getTaskID() == TASK_ERFASSUNG || workitem.getTaskID() == TASK_SACHPRUEFUNG) { // Buchungsperiode auf plausi prüfen - validateBuchungsperiode(workitem); + if ("workitem".equals(workitem.getType())) { + validateBuchungsperiode(workitem.getItemValueString("invoice.period")); + } // Cargosoft Kreditorennnummer prüfen validateCargosoftCdtrNumber(workitem); } @@ -126,6 +127,12 @@ public class InvoicePlugin extends AbstractPlugin { "Eingabefehler - Der Nettobetrag in in Zeile " + posItem.getItemValueString("numpos") + " darf nicht 0 sein!"); } + + // Buchunsperiode + if (!posItem.getItemValueString("invoice.period").trim().isEmpty()) { + validateBuchungsperiode(posItem.getItemValueString("invoice.period")); + + } } } @@ -142,10 +149,10 @@ public class InvoicePlugin extends AbstractPlugin { * @param workitem * @throws PluginException */ - private void validateBuchungsperiode(ItemCollection workitem) throws PluginException { - String period = workitem.getItemValueString("invoice.period"); + private void validateBuchungsperiode(String period) throws PluginException { + // buchungsperionde nur prüfen wenn noch nicht archiviert - if (!period.isEmpty() && "workitem".equals(workitem.getType())) { + if (!period.isEmpty()) { LocalDate localDate = LocalDate.now(); int year = localDate.getYear(); // build regex.... @@ -217,6 +224,13 @@ public class InvoicePlugin extends AbstractPlugin { } } + /** + * Hilfsmethod prüft ob die cdtr.nummer mit einer nummer aus der Cargosoft + * Import Datei übereinstimmt. + * + * @param workitem + * @throws PluginException + */ private void validateCargosoftCdtrNumber(ItemCollection workitem) throws PluginException { String crdtrNumber = workitem.getItemValueString("cdtr.number"); @@ -249,7 +263,7 @@ public class InvoicePlugin extends AbstractPlugin { * converts the Map List of a workitem into a List of ItemCollectons */ @SuppressWarnings({ "rawtypes", "unchecked" }) - protected List explodeChildList(ItemCollection workitem) { + protected static List explodeChildList(ItemCollection workitem) { // convert current list of childItems into ItemCollection elements ArrayList childItems = new ArrayList(); diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen.xhtml index 1159ac5..29325e9 100644 --- a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen.xhtml @@ -20,6 +20,8 @@ * Leistungsart * + BP * Netto Brutto @@ -71,6 +73,13 @@ + + + + + + Steuer Leistungsart + BP Netto Brutto @@ -34,6 +35,8 @@ + + @@ -49,7 +52,7 @@ - + Summe: diff --git a/pom.xml b/pom.xml index 74a56f5..8d4dea5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.alexander-logistics office-alexander-logistics - 1.1.0 + 1.1.1 pom Imixs Office Workflow - Custom Build