Neue Version mit Archiv Suche

This commit is contained in:
Ralph Soika 2024-03-11 16:00:25 +01:00
parent 011c9a64dd
commit 9599dbfe55
7 changed files with 240 additions and 3 deletions

View file

@ -6,7 +6,7 @@
<parent> <parent>
<artifactId>office-alexander-logistics</artifactId> <artifactId>office-alexander-logistics</artifactId>
<groupId>com.alexander-logistics</groupId> <groupId>com.alexander-logistics</groupId>
<version>1.2.16</version> <version>1.2.17</version>
</parent> </parent>
<artifactId>office-alexander-logistics-app</artifactId> <artifactId>office-alexander-logistics-app</artifactId>
<packaging>war</packaging> <packaging>war</packaging>

View file

@ -0,0 +1,173 @@
/*******************************************************************************
* Imixs Workflow Technology
* Copyright (C) 2003, 2008 Imixs Software Solutions GmbH,
* http://www.imixs.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You can receive a copy of the GNU General Public
* License at http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Imixs Software Solutions GmbH - initial API and implementation
* Ralph Soika
*
*******************************************************************************/
package com.alexanderlogistics;
import java.io.Serializable;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.enterprise.context.ConversationScoped;
import javax.enterprise.event.Observes;
import javax.inject.Named;
import org.imixs.workflow.office.views.SearchEvent;
/**
* Der CustomSearchController reagiert auf SeachEvents und erweitert das Search
* Query um Rechnungbetrag von-bis.
*
* @author rsoika
* @version 1.0
*/
@Named
@ConversationScoped
public class CustomSearchController implements Serializable {
private static final long serialVersionUID = 1L;
/**
* Erweitere Query
*
* _amount_brutto_from, _amount_brutto_to
*
* @param searchEvent
*
**/
/*
* Aktuell ist es nicht möglich nach Long oder Double zu suchen. Hierzu muss die
* LuceneUpdate Funktion in Imixs-Workflow verändert werden
*/
public void onSearchEvent(@Observes SearchEvent searchEvent) {
String query = searchEvent.getQuery();
float invoiceTotal = searchEvent.getSearchFilter().getItemValueFloat("invoice.total");
Date invoiceDate = searchEvent.getSearchFilter().getItemValueDate("invoice.date");
Date dueDate = searchEvent.getSearchFilter().getItemValueDate("invoice.duedate");
Date closingDate = searchEvent.getSearchFilter().getItemValueDate("invoice.closingdate");
String cdtrNumber = searchEvent.getSearchFilter().getItemValueString("cdtr.number");
// invoice.total
if (invoiceTotal != 0) {
// format form and to with at least one digit
DecimalFormat decimalFormat = new DecimalFormat("#.00");
query += " (invoice.total:" + decimalFormat.format(invoiceTotal) + ")";
}
// invoice.date
if (invoiceDate != null) {
query += " (invoice.date:" + CustomSearchController.getRangeDay(invoiceDate) + ")";
}
// invoice.duedate
if (dueDate != null) {
query += " (invoice.duedate:" + CustomSearchController.getRangeDay(dueDate) + ")";
}
// invoice.closingdate
if (closingDate != null) {
query += " ($lasteventdate:" + CustomSearchController.getRangeMonth(closingDate) + ")";
}
// dbtr.number
if (cdtrNumber != null && !cdtrNumber.isEmpty()) {
cdtrNumber = cdtrNumber.trim();
if (!cdtrNumber.startsWith("K")) {
cdtrNumber = "K" + cdtrNumber;
}
query += " (cdtr.number:" + cdtrNumber + ")";
}
// Udpate query
searchEvent.setQuery(query);
}
private static String getRangeDay(Date dueDate) {
// Setze die Uhrzeit auf Mitternacht (00:00)
Calendar startCalendar = Calendar.getInstance();
startCalendar.setTime(dueDate);
startCalendar.set(Calendar.HOUR_OF_DAY, 0);
startCalendar.set(Calendar.MINUTE, 0);
startCalendar.set(Calendar.SECOND, 0);
startCalendar.set(Calendar.MILLISECOND, 0);
Date startDate = startCalendar.getTime();
// Setze die Uhrzeit auf 23:59:59.999
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(dueDate);
endCalendar.set(Calendar.HOUR_OF_DAY, 23);
endCalendar.set(Calendar.MINUTE, 59);
endCalendar.set(Calendar.SECOND, 59);
endCalendar.set(Calendar.MILLISECOND, 999);
Date endDate = endCalendar.getTime();
SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMddHHmm");
String dateRange = "[" + dateformat.format(startDate) + " TO "
+ dateformat.format(endDate) + "]";
return dateRange;
}
private static String getRangeMonth(Date dueDate) {
// Setze die Uhrzeit auf Mitternacht (00:00)
Calendar startCalendar = Calendar.getInstance();
startCalendar.setTime(dueDate);
startCalendar.set(Calendar.HOUR_OF_DAY, 0);
startCalendar.set(Calendar.MINUTE, 0);
startCalendar.set(Calendar.SECOND, 0);
startCalendar.set(Calendar.MILLISECOND, 0);
startCalendar.set(Calendar.DAY_OF_MONTH, 1);
Date startDate = startCalendar.getTime();
// Setze die Uhrzeit auf 23:59:59.999
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(dueDate);
endCalendar.set(Calendar.HOUR_OF_DAY, 23);
endCalendar.set(Calendar.MINUTE, 59);
endCalendar.set(Calendar.SECOND, 59);
endCalendar.set(Calendar.MILLISECOND, 999);
endCalendar.set(Calendar.DAY_OF_MONTH, 1);
endCalendar.add(Calendar.MONTH, 1);
endCalendar.add(Calendar.DAY_OF_MONTH, -1);
Date endDate = endCalendar.getTime();
SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMddHHmm");
String dateRange = "[" + dateformat.format(startDate) + " TO "
+ dateformat.format(endDate) + "]";
return dateRange;
}
}

View file

@ -27,10 +27,13 @@ pos.net=Netto
pos.gross=Brutto pos.gross=Brutto
creditor_name=Kreditor creditor_name=Kreditor
creditor_number=Kreditornummer
invoicenumber=Rechnungsnummer invoicenumber=Rechnungsnummer
invoicedate=Rechnungsdatum invoicedate=Rechnungsdatum
invoiceduedate=Fälligkeit invoiceduedate=Fälligkeit
invoiceamount=Rechnungsbetrag
amount=Betrag amount=Betrag
closingdate=Abschlussdatum (nur Monat)
ERROR_CDTR_INVALID=Die Kreditorennummer ist nicht gültig ERROR_CDTR_INVALID=Die Kreditorennummer ist nicht gültig
ERROR_BOOKING_PERIOD=Eingabefehler - Bitte geben Sie eine gültige Buchungsperiode ein! Prüfen Sie auch die Spalte BP in der Positionstabelle. ERROR_BOOKING_PERIOD=Eingabefehler - Bitte geben Sie eine gültige Buchungsperiode ein! Prüfen Sie auch die Spalte BP in der Positionstabelle.

View file

@ -27,10 +27,14 @@ pos.net=Net
pos.gross=Gross pos.gross=Gross
creditor_name=Creditor creditor_name=Creditor
creditor_number=Creditor No.
invoicenumber=Invoice No. invoicenumber=Invoice No.
invoicedate=Invoice Date invoicedate=Invoice Date
invoiceduedate=Due Date invoiceduedate=Due Date
invoiceamount=Invoice amount
amount=Amount amount=Amount
closingdate=Closing date (Month only)
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.

View file

@ -4,7 +4,7 @@
lucence.indexDir=${imixs-office.IndexDir} 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 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
index.fields.analyze=txtUsername index.fields.analyze=txtUsername
index.fields.noanalyze=type,$UniqueIDRef,$created,$modified,$ModelVersion,$participants,namCreator,$ProcessID,datDate,txtWorkflowGroup,txtemail, datdate, datfrom, datto, numsequencenumber,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 index.fields.noanalyze=type,$UniqueIDRef,$created,$modified,$ModelVersion,$participants,namCreator,$ProcessID,datDate,txtWorkflowGroup,txtemail, datdate, datfrom, datto, numsequencenumber,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,$lasteventdate
index.fields.store=process.name,txtProcessName,txtWorkflowImageURL,payment.date,invoice.number,invoice.date,invoice.duedate 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 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 office.search.noanalyze=invoice.number,invoice.number.stripped

View file

@ -0,0 +1,57 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:a="http://xmlns.jcp.org/jsf/passthrough"
xmlns:marty="http://xmlns.jcp.org/jsf/composite/marty" xmlns:i="http://xmlns.jcp.org/jsf/composite/imixs">
<!-- *** Krieger Custom Search form *** -->
<div class="imixs-form-section-3">
<dl>
<dt>#{custom.invoiceamount}:</dt>
<dd>
<h:inputText style="width:12em;" value="#{searchController.searchFilter.item['invoice.total']}">
<f:convertNumber minFractionDigits="2" locale="de" />
</h:inputText>
</dd>
</dl>
<dl>
<dt>#{custom.invoicedate}:</dt>
<dd>
<h:inputText styleClass="imixs-date" value="#{searchController.searchFilter.item['invoice.date']}">
<f:convertDateTime pattern="#{message.datePatternShort}" timeZone="#{message.timeZone}" />
</h:inputText>
</dd>
</dl>
<dl>
<dt>#{custom.invoiceduedate}:</dt>
<dd>
<h:inputText styleClass="imixs-date" value="#{searchController.searchFilter.item['invoice.duedate']}">
<f:convertDateTime pattern="#{message.datePatternShort}" timeZone="#{message.timeZone}" />
</h:inputText>
</dd>
</dl>
<dl>
<dt>#{custom.closingdate}:</dt>
<dd>
<h:inputText styleClass="imixs-date"
value="#{searchController.searchFilter.item['invoice.closingdate']}">
<f:convertDateTime pattern="#{message.datePatternShort}" timeZone="#{message.timeZone}" />
</h:inputText>
</dd>
</dl>
<dl>
<dt>#{custom.creditor_number}:</dt>
<dd>
<h:inputText value="#{searchController.searchFilter.item['cdtr.number']}">
</h:inputText>
</dd>
</dl>
</div>
</ui:composition>

View file

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.alexander-logistics</groupId> <groupId>com.alexander-logistics</groupId>
<artifactId>office-alexander-logistics</artifactId> <artifactId>office-alexander-logistics</artifactId>
<version>1.2.16</version> <version>1.2.17</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Imixs Office Workflow - Custom Build</name> <name>Imixs Office Workflow - Custom Build</name>