neue Version 1.2.14 - neues invoicePlugin für AGL PL
This commit is contained in:
parent
719d86468e
commit
67fe602844
7 changed files with 64 additions and 12 deletions
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<artifactId>office-alexander-logistics</artifactId>
|
||||
<groupId>com.alexander-logistics</groupId>
|
||||
<version>1.2.13</version>
|
||||
<version>1.2.14</version>
|
||||
</parent>
|
||||
<artifactId>office-alexander-logistics-app</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<version>3.3.2</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<webResources>
|
||||
|
|
|
|||
|
|
@ -145,7 +145,8 @@ public class CargosoftExportAdapter implements SignalAdapter {
|
|||
List<String> refs = document.getItemValue(WorkflowService.UNIQUEIDREF);
|
||||
for (String ref : refs) {
|
||||
origin = workflowService.getWorkItem(ref);
|
||||
if ("Rechnungseingang".equals(origin.getWorkflowGroup())) {
|
||||
// "Rechnungseingang".equals(origin.getWorkflowGroup())
|
||||
if (InvoicePlugin.isCargoRechnung(origin)) {
|
||||
break;
|
||||
}
|
||||
origin = null;
|
||||
|
|
|
|||
|
|
@ -155,9 +155,9 @@ public class CargosoftSplitAdapter implements SignalAdapter {
|
|||
// ab dem zweiten durchlauf benötigen wir immer eine neue sequencenumer
|
||||
if (nextSequencenumber) {
|
||||
workitemSubProcess.removeItem("numsequencenumber");
|
||||
// wegen numernkreis bildung muss hier die WrokflowGroup kurzfirstig auf
|
||||
// wegen numernkreis bildung muss hier die WorkflowGroup kurzfristig auf
|
||||
// 'Rechnungseingang' gesetzt werden!
|
||||
workitemSubProcess.setItemValue(WorkflowKernel.WORKFLOWGROUP, "Rechnungseingang");
|
||||
workitemSubProcess.setItemValue(WorkflowKernel.WORKFLOWGROUP, workitem.getWorkflowGroup());
|
||||
sequenceService.computeSequenceNumber(workitemSubProcess);
|
||||
logger.info(".......compute new sequence number: "
|
||||
+ workitemSubProcess.getItemValueLong("numsequencenumber"));
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
|
@ -77,7 +79,6 @@ public class InvoicePlugin extends AbstractPlugin {
|
|||
}
|
||||
|
||||
boolean isPublicEvent = !("0".equals(event.getItemValueString("keypublicresult")));
|
||||
boolean isCargoRechnung = ("Rechnungseingang".equals(workitem.getWorkflowGroup()));
|
||||
|
||||
// Payment.type muss immer eingetragne werden!
|
||||
if (isPublicEvent && workitem.getTaskID() >= TASK_ERFASSUNG && workitem.getEventID() < 900) {
|
||||
|
|
@ -98,11 +99,11 @@ public class InvoicePlugin extends AbstractPlugin {
|
|||
|| workitem.getTaskID() == TASK_SACHPRUEFUNG_DELEGATION)
|
||||
&& workitem.getEventID() == EVENT_FREIGEBEN)) {
|
||||
// Buchungsperiode auf plausi prüfen
|
||||
if (isCargoRechnung && "workitem".equals(workitem.getType())) {
|
||||
if (isCargoRechnung(workitem) && "workitem".equals(workitem.getType())) {
|
||||
validateBuchungsperiode(workitem.getItemValueString(ITEM_INVOICE_PERIOD));
|
||||
}
|
||||
// Cargosoft Kreditorennnummer prüfen
|
||||
if (isCargoRechnung) {
|
||||
if (isCargoRechnung(workitem)) {
|
||||
validateCargosoftCdtrNumber(workitem);
|
||||
}
|
||||
}
|
||||
|
|
@ -110,7 +111,7 @@ public class InvoicePlugin extends AbstractPlugin {
|
|||
|
||||
// die prüfung der positionsnummern und Category erfolgt nur im Status
|
||||
// Sachprüfung (5200) und nur beim Freigeben (20)!
|
||||
if (isCargoRechnung
|
||||
if (isCargoRechnung(workitem)
|
||||
&& ((workitem.getTaskID() == TASK_SACHPRUEFUNG || workitem.getTaskID() == TASK_SACHPRUEFUNG_DELEGATION)
|
||||
&& workitem.getEventID() == EVENT_FREIGEBEN)) {
|
||||
List<ItemCollection> childs = explodeChildList(workitem);
|
||||
|
|
@ -165,7 +166,7 @@ public class InvoicePlugin extends AbstractPlugin {
|
|||
// Im folgenden überprüfen wir ob eine Buchungszeile vorkommt in der keine oder
|
||||
// die Hauptbuchunsperiode ausgewählt wurde. Ist das nicht der Fal gibt es eine
|
||||
// Fehlermeldung für den Anwendere
|
||||
if (isCargoRechnung && childs.size() > 0) {
|
||||
if (isCargoRechnung(workitem) && childs.size() > 0) {
|
||||
String hauptBuchungsperiode = workitem.getItemValueString("invoice.period");
|
||||
boolean buchungsperiodenValid = false;
|
||||
for (ItemCollection posItem : childs) {
|
||||
|
|
@ -430,4 +431,22 @@ public class InvoicePlugin extends AbstractPlugin {
|
|||
}
|
||||
return childItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns true if the current workitem is a Cargosoft Invoice.
|
||||
*
|
||||
* This can be based on different model versions e.g. rechnungseingang-de-1.2,
|
||||
* rechnungseingang-pl-1.0, ...
|
||||
*
|
||||
* @param workitem
|
||||
* @return
|
||||
*/
|
||||
public static boolean isCargoRechnung(ItemCollection workitem) {
|
||||
String REGEX_PATTERN = "rechnungseingang-([a-z]{2})-\\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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ alexander_sub_positionen_read=
|
|||
alexander_sub_responsible=
|
||||
|
||||
space.sub_custom=Konfiguration
|
||||
space.help_custom=Bitte verwenden Sie hier Reguläre Ausdrücke wie z.B. \\bEX-SAL Dieser Ausdruck sucht nach dem Wert "EX-SAL" in einem String und achtet darauf, dass es nicht Teil eines größeren Ausdrucks ist (z.B. "EX-SALES").
|
||||
space.help_custom=Bitte verwenden Sie hier Reguläre Ausdrücke wie z.B. \\bEX-SAL Dieser Ausdruck sucht nach dem Wert "EX-SAL" in einem String und achtet darauf, dass es nicht Teil eines größeren Ausdrucks ist (z.B. "EX-SALES").
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package com.alexanderlogistics;
|
||||
|
||||
import org.imixs.workflow.ItemCollection;
|
||||
import org.junit.Test;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
/**
|
||||
* This test tests the InvoicePlugin isCargosoft method
|
||||
*
|
||||
* @author rsoika
|
||||
*
|
||||
*/
|
||||
public class TestModelMatcher {
|
||||
|
||||
@Test
|
||||
public void testModels() {
|
||||
|
||||
ItemCollection workitem = new ItemCollection();
|
||||
|
||||
workitem.setModelVersion("rechnungseingang-de-1.0");
|
||||
Assert.assertTrue(InvoicePlugin.isCargoRechnung(workitem));
|
||||
|
||||
workitem.setModelVersion("rechnungseingang-pl-1.2");
|
||||
Assert.assertTrue(InvoicePlugin.isCargoRechnung(workitem));
|
||||
|
||||
workitem.setModelVersion("rechnungseingang-sachrechnung-pl-1.2");
|
||||
Assert.assertFalse(InvoicePlugin.isCargoRechnung(workitem));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
2
pom.xml
2
pom.xml
|
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.alexander-logistics</groupId>
|
||||
<artifactId>office-alexander-logistics</artifactId>
|
||||
<version>1.2.13</version>
|
||||
<version>1.2.14</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Imixs Office Workflow - Custom Build</name>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue