update op listen

This commit is contained in:
Ralph Soika 2024-11-28 15:50:32 +01:00
parent 11ccddb529
commit 03d4fe241a
8 changed files with 49 additions and 24 deletions

View file

@ -12,6 +12,7 @@ import org.imixs.workflow.ItemCollection;
import org.imixs.workflow.engine.DocumentService; import org.imixs.workflow.engine.DocumentService;
import org.imixs.workflow.exceptions.QueryException; import org.imixs.workflow.exceptions.QueryException;
import org.imixs.workflow.faces.data.WorkflowController; import org.imixs.workflow.faces.data.WorkflowController;
import org.imixs.workflow.faces.util.ResourceBundleHandler;
import org.imixs.workflow.office.forms.AnalyticController; import org.imixs.workflow.office.forms.AnalyticController;
import org.imixs.workflow.office.forms.AnalyticEvent; import org.imixs.workflow.office.forms.AnalyticEvent;
@ -47,6 +48,9 @@ public class AGLAnalyticControllerOPListe implements Serializable {
@Inject @Inject
TeamService teamService; TeamService teamService;
@Inject
ResourceBundleHandler resourceBundleHandler;
TreeMap<String, DebitorStatistikData> stats = null; TreeMap<String, DebitorStatistikData> stats = null;
String departmentID; String departmentID;
@ -92,36 +96,36 @@ public class AGLAnalyticControllerOPListe implements Serializable {
ItemCollection process = documentService ItemCollection process = documentService
.load(workflowController.getWorkitem().getItemValueString("process.ref")); .load(workflowController.getWorkitem().getItemValueString("process.ref"));
if (process != null) { if (process != null) {
link = link + "&processref=" + process.getUniqueID() link = link + "?processref=" + process.getUniqueID() // + "&modelversion=rechnungsausgang*"
+ "&spaceref=" + departmentID; + "&spaceref=" + departmentID;
} }
if ("analytic.invoices.count.all".equals(event.getKey())) { if ("analytic.invoices.count.all".equals(event.getKey())) {
event.setValue("" + countAll); event.setValue("" + countAll);
event.setLabel("Invoices"); event.setLabel(resourceBundleHandler.findMessage("oplist.invoices"));
event.setDescription("open"); event.setDescription(resourceBundleHandler.findMessage("oplist.invoices.description.all"));
event.getWorkitem().setItemValue("invoices.total", event.getValue()); event.getWorkitem().setItemValue("invoices.total", event.getValue());
event.setLink(link); event.setLink(link);
} }
if ("analytic.invoices.count.open".equals(event.getKey())) { if ("analytic.invoices.count.open".equals(event.getKey())) {
event.setValue("" + (countOpen - countDunning - countDue)); event.setValue("" + (countOpen));
event.setLabel("Invoices"); event.setLabel(resourceBundleHandler.findMessage("oplist.invoices"));
event.setDescription("Total invoices not yet in due"); event.setDescription(resourceBundleHandler.findMessage("oplist.invoices.description.open"));
event.getWorkitem().setItemValue("invoices.total.open", event.getValue()); event.getWorkitem().setItemValue("invoices.total.open", event.getValue());
event.setLink(link); event.setLink(link);
} }
if ("analytic.invoices.count.due".equals(event.getKey())) { if ("analytic.invoices.count.due".equals(event.getKey())) {
event.setValue("" + countDue); event.setValue("" + countDue);
event.setLabel("Invoices"); event.setLabel(resourceBundleHandler.findMessage("oplist.invoices"));
event.setDescription("Total invoices in due"); event.setDescription(resourceBundleHandler.findMessage("oplist.invoices.description.due"));
event.getWorkitem().setItemValue("invoices.total.due", event.getValue()); event.getWorkitem().setItemValue("invoices.total.due", event.getValue());
event.setLink(link); event.setLink(link);
} }
if ("analytic.invoices.count.dunning".equals(event.getKey())) { if ("analytic.invoices.count.dunning".equals(event.getKey())) {
event.setValue("" + countDunning); event.setValue("" + countDunning);
event.setLabel("Invoices"); event.setLabel(resourceBundleHandler.findMessage("oplist.invoices"));
event.setDescription("Total invoices in dunning"); event.setDescription(resourceBundleHandler.findMessage("oplist.invoices.description.dunning"));
event.getWorkitem().setItemValue("invoices.total.dunning", event.getValue()); event.getWorkitem().setItemValue("invoices.total.dunning", event.getValue());
event.setLink(link); event.setLink(link);
} }
@ -151,8 +155,8 @@ public class AGLAnalyticControllerOPListe implements Serializable {
*/ */
private void calculateStats() { private void calculateStats() {
long l = System.currentTimeMillis(); long l = System.currentTimeMillis();
countAll = 0; countAll = 0;
countOpen = 0;
countDue = 0; countDue = 0;
countDunning = 0; countDunning = 0;
logger.info(" ├──calculate stats for " + departmentID + "...."); logger.info(" ├──calculate stats for " + departmentID + "....");
@ -160,18 +164,28 @@ public class AGLAnalyticControllerOPListe implements Serializable {
try { try {
if (departmentID == null || !departmentID.isEmpty()) { if (departmentID == null || !departmentID.isEmpty()) {
countOpen = documentService.count("(type:workitem) AND $uniqueidref:" + departmentID countAll = documentService.count("(type:workitem) AND $uniqueidref:" + departmentID
+ " AND $modelversion:rechnungsausgang-*"); + " AND $modelversion:rechnungsausgang-*");
countDue = documentService.count("(type:workitem) AND $uniqueidref:" + departmentID countDue = documentService.count("(type:workitem) AND $uniqueidref:" + departmentID
+ " AND $modelversion:rechnungsausgang-* AND $taskid:[5100 TO 5199]"); + " AND $modelversion:rechnungsausgang-* AND $taskid:[5100 TO 5199]");
countDunning = documentService.count("(type:workitem) AND $uniqueidref:" + departmentID countDunning = documentService.count("(type:workitem) AND $uniqueidref:" + departmentID
+ " AND $modelversion:rechnungsausgang-* AND $taskid:[5200 TO 5399]"); + " AND $modelversion:rechnungsausgang-* AND $taskid:[5200 TO 5399]");
countOpen = countAll - countDue - countDunning;
} else { } else {
countOpen = documentService.count("(type:workitem) AND $modelversion:rechnungsausgang-*");
// countAll=documentService.count("(type:workitem OR type:workitemarchive) AND
// $modelversion:rechnungsausgang-*")
countAll = documentService.count("(type:workitem) AND $modelversion:rechnungsausgang-*");
countDue = documentService countDue = documentService
.count("(type:workitem) AND $modelversion:rechnungsausgang-* AND $taskid:[5100 TO 5199]"); .count("(type:workitem) AND $modelversion:rechnungsausgang-* AND $taskid:[5100 TO 5199]");
countDunning = documentService countDunning = documentService
.count("(type:workitem) AND $modelversion:rechnungsausgang-* AND $taskid:[5200 TO 5399]"); .count("(type:workitem) AND $modelversion:rechnungsausgang-* AND $taskid:[5200 TO 5399]");
countOpen = countAll - countDue - countDunning;
} }
} catch (QueryException e) { } catch (QueryException e) {

View file

@ -20,8 +20,8 @@ import jakarta.inject.Inject;
import jakarta.inject.Named; import jakarta.inject.Named;
/** /**
* Der InvoiceAnalyseController dient zur Auswertung der Sachprüfungs WOrklfow * Der InvoiceAnalyseController dient zur Auswertung der Sachprüfungs Workflow
* Schritte. Die Analyse Seite ist büer das Admin Menü erreichbar. * Schritte. Die Analyse Seite ist über das Admin Menü erreichbar.
* *
* @author rsoika * @author rsoika
* *

View file

@ -50,6 +50,11 @@ oplist.total.base=Basisumsatz
oplist.saldo=Saldo oplist.saldo=Saldo
oplist.saldo.base=Saldo oplist.saldo.base=Saldo
oplist.payment=Zahlbetrag oplist.payment=Zahlbetrag
oplist.invoices=Rechnungen
oplist.invoices.description.all=Alle unbezahlten Rechnungen
oplist.invoices.description.open=Anzahl der Rechnungen die noch nicht fällig sind
oplist.invoices.description.due=Anzahl der fälligen Rechnungen
oplist.invoices.description.dunning=Anzahl Rechnungen bereits gemahnt

View file

@ -47,9 +47,15 @@ oplist.invoicenumber=No.
oplist.total=Total oplist.total=Total
oplist.rate=Rate oplist.rate=Rate
oplist.total.base=Total Base oplist.total.base=Total Base
oplist.saldo=Saldo oplist.saldo=Balance
oplist.saldo.base=Saldo oplist.saldo.base=Balance
oplist.payment=Payment oplist.payment=Payment
oplist.invoices=Invoices
oplist.invoices.description.all=All unpaid invoices
oplist.invoices.description.open=Number of invoices that are not yet due
oplist.invoices.description.due=Number of invoices due
oplist.invoices.description.dunning=Number of invoices already dunned
ERROR_CDTR_INVALID=The creditor number is not valid ERROR_CDTR_INVALID=The creditor number is not valid
ERROR_BOOKING_PERIOD=Input error - Please enter a valid booking period! Also check the BP column in the position table. ERROR_BOOKING_PERIOD=Input error - Please enter a valid booking period! Also check the BP column in the position table.

Binary file not shown.

View file

@ -335,10 +335,10 @@ Nach Prüfung schließen Sie bitte den Vorgang über die Schaltfläche "Erledigt
</imixs-form-section> </imixs-form-section>
<imixs-form-section columns="4" label="Rechnungen"> <imixs-form-section columns="4" label="Rechnungen">
<item name="analytic.invoices.count.all" type="custom" path="alexander/analyze_plain" label="Alle Rechnungen:" /> <item name="analytic.invoices.count.all" type="custom" path="alexander/analyze_plain" label="Alle:" />
<item name="analytic.invoices.count.open" type="custom" path="alexander/analyze_plain" label="Offene Rechnungen:" /> <item name="analytic.invoices.count.open" type="custom" path="alexander/analyze_plain" label="Offen:" />
<item name="analytic.invoices.count.due" type="custom" path="alexander/analyze_plain" label="Fällige Rechnungen:" /> <item name="analytic.invoices.count.due" type="custom" path="alexander/analyze_plain" label="Fällig:" />
<item name="analytic.invoices.count.dunning" type="custom" path="alexander/analyze_plain" label="Rechnungen in Mahnung:" /> <item name="analytic.invoices.count.dunning" type="custom" path="alexander/analyze_plain" label="In Mahnung:" />
</imixs-form-section> </imixs-form-section>
</imixs-form>]]></bpmn2:documentation> </imixs-form>]]></bpmn2:documentation>
@ -440,8 +440,8 @@ if (workitem.get(refField) == null || ''==workitem.get(refField)[0]) {
<imixs:item name="txtactivityresult" type="xs:string"> <imixs:item name="txtactivityresult" type="xs:string">
<imixs:value><![CDATA[<opliste name="excel-export"> <imixs:value><![CDATA[<opliste name="excel-export">
<textblock>OP-Liste KW Template</textblock> <textblock>OP-Liste KW Template</textblock>
<template>op-liste_kw_template.xlsx</template> <template>op-liste_kw_template_de.xlsx</template>
<target-name>op-liste_<itemvalue>space.name</itemvalue>_<itemvalue format="yyyy-MM-dd">$lasteventdate</itemvalue>.xlsx</target-name> <target-name>op_liste_nach_kw_<itemvalue format="yyyy-MM-dd">$lasteventdate</itemvalue>.xlsx</target-name>
</opliste> </opliste>
<poi-update name="findreplace"> <poi-update name="findreplace">
<find>A8</find> <find>A8</find>

View file

@ -439,7 +439,7 @@ if (workitem.get(refField) == null || ''==workitem.get(refField)[0]) {
<imixs:item name="txtactivityresult" type="xs:string"> <imixs:item name="txtactivityresult" type="xs:string">
<imixs:value><![CDATA[<opliste name="excel-export"> <imixs:value><![CDATA[<opliste name="excel-export">
<textblock>OP-Liste KW Template</textblock> <textblock>OP-Liste KW Template</textblock>
<template>op-liste_kw_template.xlsx</template> <template>op-liste_kw_template_en.xlsx</template>
<target-name>outstanding_items_by_week_<itemvalue format="yyyy-MM-dd">$lasteventdate</itemvalue>.xlsx</target-name> <target-name>outstanding_items_by_week_<itemvalue format="yyyy-MM-dd">$lasteventdate</itemvalue>.xlsx</target-name>
</opliste> </opliste>
<poi-update name="findreplace"> <poi-update name="findreplace">