korrektur validierung cargo rechnungen
This commit is contained in:
parent
a982612190
commit
9f559f5479
1 changed files with 13 additions and 10 deletions
|
|
@ -66,6 +66,7 @@ public class InvoicePlugin extends AbstractPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isPublicEvent = !("0".equals(event.getItemValueString("keypublicresult")));
|
boolean isPublicEvent = !("0".equals(event.getItemValueString("keypublicresult")));
|
||||||
|
boolean isCargoRechnung = ("Rechnungseingang".equals(workitem.getWorkflowGroup()));
|
||||||
|
|
||||||
// Payment.type muss immer eingetragne werden!
|
// Payment.type muss immer eingetragne werden!
|
||||||
if (isPublicEvent && workitem.getTaskID() >= TASK_ERFASSUNG && workitem.getEventID() < 900) {
|
if (isPublicEvent && workitem.getTaskID() >= TASK_ERFASSUNG && workitem.getEventID() < 900) {
|
||||||
|
|
@ -79,23 +80,25 @@ public class InvoicePlugin extends AbstractPlugin {
|
||||||
validateInvoiceNumber(workitem);
|
validateInvoiceNumber(workitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workitem.getTaskID() == TASK_ERFASSUNG ||
|
if (workitem.getTaskID() == TASK_ERFASSUNG || ((workitem.getTaskID() == TASK_SACHPRUEFUNG
|
||||||
( ( workitem.getTaskID() == TASK_SACHPRUEFUNG || workitem.getTaskID() == TASK_SACHPRUEFUNG_DELEGATION)
|
|| workitem.getTaskID() == TASK_SACHPRUEFUNG_DELEGATION)
|
||||||
&& workitem.getEventID() == EVENT_FREIGEBEN)
|
&& workitem.getEventID() == EVENT_FREIGEBEN)) {
|
||||||
) {
|
|
||||||
// Buchungsperiode auf plausi prüfen
|
// Buchungsperiode auf plausi prüfen
|
||||||
if ("workitem".equals(workitem.getType())) {
|
if (isCargoRechnung && "workitem".equals(workitem.getType())) {
|
||||||
validateBuchungsperiode(workitem.getItemValueString(ITEM_INVOICE_PERIOD));
|
validateBuchungsperiode(workitem.getItemValueString(ITEM_INVOICE_PERIOD));
|
||||||
}
|
}
|
||||||
// Cargosoft Kreditorennnummer prüfen
|
// Cargosoft Kreditorennnummer prüfen
|
||||||
validateCargosoftCdtrNumber(workitem);
|
if (isCargoRechnung) {
|
||||||
|
validateCargosoftCdtrNumber(workitem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// die prüfung der positionsnummern und Category erfolgt nur im Status
|
// die prüfung der positionsnummern und Category erfolgt nur im Status
|
||||||
// Sachprüfung (5200) und nur beim Freigeben (20)!
|
// Sachprüfung (5200) und nur beim Freigeben (20)!
|
||||||
if ( (workitem.getTaskID() == TASK_SACHPRUEFUNG || workitem.getTaskID() == TASK_SACHPRUEFUNG_DELEGATION)
|
if (isCargoRechnung
|
||||||
&& workitem.getEventID() == EVENT_FREIGEBEN) {
|
&& ((workitem.getTaskID() == TASK_SACHPRUEFUNG || workitem.getTaskID() == TASK_SACHPRUEFUNG_DELEGATION)
|
||||||
|
&& workitem.getEventID() == EVENT_FREIGEBEN)) {
|
||||||
List<ItemCollection> childs = explodeChildList(workitem);
|
List<ItemCollection> childs = explodeChildList(workitem);
|
||||||
for (ItemCollection posItem : childs) {
|
for (ItemCollection posItem : childs) {
|
||||||
if (posItem.getItemValueString("name").trim().isEmpty()) {
|
if (posItem.getItemValueString("name").trim().isEmpty()) {
|
||||||
|
|
@ -148,7 +151,7 @@ public class InvoicePlugin extends AbstractPlugin {
|
||||||
// Im folgenden überprüfen wir ob eine Buchungszeile vorkommt in der keine oder
|
// 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
|
// die Hauptbuchunsperiode ausgewählt wurde. Ist das nicht der Fal gibt es eine
|
||||||
// Fehlermeldung für den Anwendere
|
// Fehlermeldung für den Anwendere
|
||||||
if (childs.size() > 0) {
|
if (isCargoRechnung && childs.size() > 0) {
|
||||||
String hauptBuchungsperiode = workitem.getItemValueString("invoice.period");
|
String hauptBuchungsperiode = workitem.getItemValueString("invoice.period");
|
||||||
boolean buchungsperiodenValid = false;
|
boolean buchungsperiodenValid = false;
|
||||||
for (ItemCollection posItem : childs) {
|
for (ItemCollection posItem : childs) {
|
||||||
|
|
@ -273,7 +276,7 @@ public class InvoicePlugin extends AbstractPlugin {
|
||||||
// search creditor number in cargosoft...
|
// search creditor number in cargosoft...
|
||||||
// die cargosoft Kreditornummer beginnt seltsamerweise mit einem K.....
|
// die cargosoft Kreditornummer beginnt seltsamerweise mit einem K.....
|
||||||
try {
|
try {
|
||||||
String query = "(type:cargosoftkreditor) AND (name:K" + crdtrNumber + " OR name:" + crdtrNumber +")";
|
String query = "(type:cargosoftkreditor) AND (name:K" + crdtrNumber + " OR name:" + crdtrNumber + ")";
|
||||||
List<ItemCollection> result = this.getWorkflowService().getDocumentService().find(query, 1, 0);
|
List<ItemCollection> result = this.getWorkflowService().getDocumentService().find(query, 1, 0);
|
||||||
if (result == null || result.size() == 0) {
|
if (result == null || result.size() == 0) {
|
||||||
throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA,
|
throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue