From 625adb3aa5b66947530d571e85a12ef0a724098f Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Wed, 31 Jul 2024 12:17:45 +0200 Subject: [PATCH] fix ai prompt and date imput --- Dockerfile | 2 +- .../ai/PromptExampleAdapterXML.java | 12 +- .../src/main/resources/imixs.properties | 2 +- .../webapp/js/imixs-office.workitem.custom.js | 56 ++++----- reports/sepa/result_sepa01.xml | 2 +- reports/sepa/result_sepa02.xml | 2 +- workflow/dwc/posteingang-dwc-2.0.0.bpmn | 118 ++++++++++++++---- 7 files changed, 127 insertions(+), 67 deletions(-) diff --git a/Dockerfile b/Dockerfile index 96bb63f..f640879 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,4 @@ FROM imixs/imixs-office-workflow # Deploy artefact RUN rm -r /opt/jboss/wildfly/standalone/deployments/* -COPY ./*-app/target/*-app.war /opt/jboss/wildfly/standalone/deployments/ +COPY ./*-app/target/*.war /opt/jboss/wildfly/standalone/deployments/ diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ai/PromptExampleAdapterXML.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ai/PromptExampleAdapterXML.java index 1f6830d..74d9505 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ai/PromptExampleAdapterXML.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ai/PromptExampleAdapterXML.java @@ -73,8 +73,8 @@ public class PromptExampleAdapterXML { String exampleHeaderData = "\n\n### Example Invoice Data:\n\n"; String exampleHeaderXML = "\n\n### Example XML Object:\n\n"; - String cdtrName = event.getWorkitem().getItemValueString("document.company"); - List invoices = findLastInvoices(cdtrName, event.getWorkitem().getUniqueID()); + String companyName = event.getWorkitem().getItemValueString("document.company"); + List invoices = findLastInvoices(companyName, event.getWorkitem().getUniqueID()); String promptExamples = ""; if (invoices != null && invoices.size() > 0) { // Build an example for each invoice @@ -150,19 +150,19 @@ public class PromptExampleAdapterXML { * @param cdtrName * @return */ - private List findLastInvoices(String cdtrName, String currentID) { + private List findLastInvoices(String companyName, String currentID) { List result = new ArrayList<>(); String searchTerm = "(type:workitemarchive) AND ($modelversion:rechnungseingang*) AND ($taskid:5900) AND NOT ($uniqueid:" - + currentID + ") AND (cdtr.name:\"" - + cdtrName + "\")"; + + currentID + ") AND (document.company:\"" + + companyName + "\")"; try { result = documentService.find(searchTerm, 3, 0, "$modified", true); } catch (QueryException e) { logger.log(Level.SEVERE, "findLastInvoices - invalid query: {0}", e.getMessage()); } - logger.info("Found " + result.size() + " examples for '" + cdtrName + "'"); + logger.info("Found " + result.size() + " examples for '" + companyName + "'"); return result; } diff --git a/office-alexander-logistics-app/src/main/resources/imixs.properties b/office-alexander-logistics-app/src/main/resources/imixs.properties index bcbf27e..47ce238 100644 --- a/office-alexander-logistics-app/src/main/resources/imixs.properties +++ b/office-alexander-logistics-app/src/main/resources/imixs.properties @@ -4,7 +4,7 @@ lucence.indexDir=${imixs-office.IndexDir} index.fields=txtsearchstring,txtSubject,txtname,txtEmail,txtUserName,namCreator,txtworkflowgroup,txtworkflowstatus,txtWorkflowAbstract,txtWorkflowSummary,txtworkflowhistory,txtspacename,txtprocessname,_subject,_description,_name,_projectnumber,_projectname,_ordernumber,_contractnumber,datDueDate,txtcommentlog,htmldescription,htmldocumentation,dms,dms_names,invoice.number.stripped,_childitems,$file.names,_VENDOR_NAME,dbtr.number,cdtr.number,invoice.positions index.fields.analyze=txtUsername -index.fields.noanalyze=type,$UniqueIDRef,$created,$modified,$ModelVersion,$participants,namCreator,$ProcessID,datDate,txtWorkflowGroup,txtemail, datdate, datfrom, datto, numsequencenumber,sequencenumber,dms_count,invoice.number,invoice.number.stripped,invoice.date,invoice.duedate,taxonomy.verteilung.stop,taxonomy.sachpruefung.stop,taxonomy.verteilung.start,taxonomy.sachpruefung.start,taxonomy.buchhaltung.start,taxonomy.buchhaltung.stop,dbtr.number,cdtr.number,payment.date,invoice.total,invoice.currency,invoice.positions,$lasteventdate,payment.type,cdtr.name +index.fields.noanalyze=type,$UniqueIDRef,$created,$modified,$ModelVersion,$participants,namCreator,$ProcessID,datDate,txtWorkflowGroup,txtemail, datdate, datfrom, datto, numsequencenumber,sequencenumber,dms_count,invoice.number,invoice.number.stripped,invoice.date,invoice.duedate,taxonomy.verteilung.stop,taxonomy.sachpruefung.stop,taxonomy.verteilung.start,taxonomy.sachpruefung.start,taxonomy.buchhaltung.start,taxonomy.buchhaltung.stop,dbtr.number,cdtr.number,payment.date,invoice.total,invoice.currency,invoice.positions,$lasteventdate,payment.type,cdtr.name,document.company index.fields.store=process.name,txtProcessName,txtWorkflowImageURL,payment.date,invoice.number,invoice.date,invoice.duedate index.fields.category=space.name,space.ref,taxonomy.verteilung.stop.by,taxonomy.sachpruefung.stop.by,taxonomy.buchhaltung.stop.by office.search.noanalyze=invoice.number,invoice.number.stripped,invoice.positions diff --git a/office-alexander-logistics-app/src/main/webapp/js/imixs-office.workitem.custom.js b/office-alexander-logistics-app/src/main/webapp/js/imixs-office.workitem.custom.js index 5864b2d..ba5eb52 100644 --- a/office-alexander-logistics-app/src/main/webapp/js/imixs-office.workitem.custom.js +++ b/office-alexander-logistics-app/src/main/webapp/js/imixs-office.workitem.custom.js @@ -5,7 +5,7 @@ /** * */ -$(document).ready(function() { +$(document).ready(function () { initFaelligkeit(); }); @@ -15,28 +15,22 @@ $(document).ready(function() { * ein neues Datum auf basis des Rechnungsdatum (date_invoice) */ function initFaelligkeit(ajax_event) { - $(".alexander-logistic-date-days").change(function(e) { + $(".alexander-logistic-date-days").change(function (e) { var days = $(this).val(); - if (days=='') { + if (days == '') { return true; } - + // find the basis date 'date_invoice' - var basisDateString=$("input[id$='date_invoice']").val(); + var basisDateString = $("input[id$='date_invoice']").val(); const parts = basisDateString.split("."); - var basisDay=parts[0]; - var basisMonth=parts[1]; - var basisYear=parts[2]; - - - var basisDate = new Date(); - basisDate.setFullYear(basisYear); - basisDate.setMonth(basisMonth-1); - basisDate.setDate(basisDay); - - - // get days,month,year from - var newDate = new Date(basisDate.getTime() + (days * 24 * 60 * 60 * 1000)); + var basisDay = parts[0]; + var basisMonth = (parts[1]) - 1; + var basisYear = parts[2]; + var basisDate = new Date(basisYear, basisMonth, basisDay); + var newDate = new Date(basisYear, basisMonth, basisDay); + let tageVerschiebung = 10; + newDate.setDate(newDate.getDate() + tageVerschiebung); var day = '' + newDate.getDate(); if (day.length == 1) { @@ -53,13 +47,13 @@ function initFaelligkeit(ajax_event) { var dateFormated = day + month + year; //alert(dateFormated); - var dateInput=$(this).next(); + var dateInput = $(this).next(); dateInput.val(dateFormated); validateBuchungsDatum(dateInput); // clear input $(this).val(''); - + }); } @@ -91,7 +85,7 @@ function validateBuchungsDatum(item) { text = text.substring(0, 2) + "." + text.substring(2, 4) + "." + text.substring(4); } - + // check for TTMM if (text.length == 4 && text.indexOf('.') == -1) { text = text.substring(0, 2) + "." + text.substring(2); @@ -106,27 +100,27 @@ function validateBuchungsDatum(item) { var right = text.substring(n + 1); text = left + "20" + right; } - - + + // validate if year has more then 4 digits // TT.MM.YYYY is allowed - if (text.length!=10) { + if (text.length != 10) { console.log("Invalid Date=" + text); - text=""; + text = ""; } // update field.... $(mhd).val(text); - - + + // hier aktualisiereh wir die Fälligkeit wenn das Rechnungsdatum sich ändert // und wir ein Zahlungsziel kennen. - var inputElementZahlungszielCdtr=$("input[id$='cdtr_creditperiod']"); - var itemID=item.id; + var inputElementZahlungszielCdtr = $("input[id$='cdtr_creditperiod']"); + var itemID = item.id; if (itemID && itemID.endsWith('date_invoice')) { // update zahlungsziel - if (inputElementZahlungszielCdtr && inputElementZahlungszielCdtr.val()!='') { - var inputElementZahlungsziel=$("input[data-item='cdtr.creditperiod']"); + if (inputElementZahlungszielCdtr && inputElementZahlungszielCdtr.val() != '') { + var inputElementZahlungsziel = $("input[data-item='cdtr.creditperiod']"); if (inputElementZahlungsziel) { inputElementZahlungsziel.val(inputElementZahlungszielCdtr.val()); inputElementZahlungsziel.change(); diff --git a/reports/sepa/result_sepa01.xml b/reports/sepa/result_sepa01.xml index 24c1c0c..d710033 100644 --- a/reports/sepa/result_sepa01.xml +++ b/reports/sepa/result_sepa01.xml @@ -6,7 +6,7 @@ bf073e72asdf512c4d60af7740872036 - 2024-07-30T15:43:40 + 2024-07-30T16:29:44 3 655.90 diff --git a/reports/sepa/result_sepa02.xml b/reports/sepa/result_sepa02.xml index 674148a..a625e61 100644 --- a/reports/sepa/result_sepa02.xml +++ b/reports/sepa/result_sepa02.xml @@ -6,7 +6,7 @@ bf073e72asdf512c4d60af7740872036 - 2024-07-30T15:43:40 + 2024-07-30T16:29:44 3 655.90 diff --git a/workflow/dwc/posteingang-dwc-2.0.0.bpmn b/workflow/dwc/posteingang-dwc-2.0.0.bpmn index 3a88953..8d79a43 100644 --- a/workflow/dwc/posteingang-dwc-2.0.0.bpmn +++ b/workflow/dwc/posteingang-dwc-2.0.0.bpmn @@ -98,6 +98,9 @@ Possible ImageTypes are: dataObject_KPUiiw event_wmNwPA event_tFxV0w + event_88sCAA + event_T901Jg + event_7rbeVA @@ -181,7 +184,7 @@ Betrag: _amount (Brutto € _amount_brutto - + @@ -369,7 +372,7 @@ Betrag: _amount (Brutto € _amount_brutto - + @@ -413,7 +416,7 @@ Betrag: _amount (Brutto € _amount_brutto - + cdtr.name (invoice.language)]]> @@ -642,6 +645,7 @@ Betrag: _amount (Brutto € _amount_brutto sequenceFlow_aC0skQ sequenceFlow_YMtfiw + sequenceFlow_PWXjog @@ -652,7 +656,7 @@ Betrag: _amount (Brutto € _amount_brutto - + cdtr.name (invoice.language)]]> @@ -897,6 +901,7 @@ Transfer the individual invoice data to the XML tags, taking into account the fo sequenceFlow_fN22Gg sequenceFlow_naZnAA + sequenceFlow_PgyOMw @@ -1024,6 +1029,7 @@ Note: Do not generate any other information instead of the XML object. sequenceFlow_8SpIiA sequenceFlow_A62nqQ + sequenceFlow_Di4BQA @@ -1143,6 +1149,30 @@ Betrag: _amount (Brutto € _amount_brutto + + + + sequenceFlow_PgyOMw + + + + + sequenceFlow_Di4BQA + + + + + + + + + + + sequenceFlow_PWXjog + + + + @@ -1309,9 +1339,9 @@ Betrag: _amount (Brutto € _amount_brutto - + - + @@ -1319,23 +1349,23 @@ Betrag: _amount (Brutto € _amount_brutto - + - + - + - + - - - - + + + + @@ -1354,16 +1384,16 @@ Betrag: _amount (Brutto € _amount_brutto - + - + - - - - + + + + @@ -1388,16 +1418,16 @@ Betrag: _amount (Brutto € _amount_brutto - + - + - - - - + + + + @@ -1424,6 +1454,42 @@ Betrag: _amount (Brutto € _amount_brutto + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +