Neue Version mit Archiv Suche
This commit is contained in:
parent
011c9a64dd
commit
9599dbfe55
7 changed files with 240 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<artifactId>office-alexander-logistics</artifactId>
|
||||
<groupId>com.alexander-logistics</groupId>
|
||||
<version>1.2.16</version>
|
||||
<version>1.2.17</version>
|
||||
</parent>
|
||||
<artifactId>office-alexander-logistics-app</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -27,10 +27,13 @@ pos.net=Netto
|
|||
pos.gross=Brutto
|
||||
|
||||
creditor_name=Kreditor
|
||||
creditor_number=Kreditornummer
|
||||
invoicenumber=Rechnungsnummer
|
||||
invoicedate=Rechnungsdatum
|
||||
invoiceduedate=Fälligkeit
|
||||
invoiceamount=Rechnungsbetrag
|
||||
amount=Betrag
|
||||
closingdate=Abschlussdatum (nur Monat)
|
||||
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -27,10 +27,14 @@ pos.net=Net
|
|||
pos.gross=Gross
|
||||
|
||||
creditor_name=Creditor
|
||||
creditor_number=Creditor No.
|
||||
invoicenumber=Invoice No.
|
||||
invoicedate=Invoice Date
|
||||
invoiceduedate=Due Date
|
||||
invoiceamount=Invoice amount
|
||||
amount=Amount
|
||||
closingdate=Closing date (Month only)
|
||||
|
||||
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
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.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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
2
pom.xml
2
pom.xml
|
|
@ -5,7 +5,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.alexander-logistics</groupId>
|
||||
<artifactId>office-alexander-logistics</artifactId>
|
||||
<version>1.2.16</version>
|
||||
<version>1.2.17</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Imixs Office Workflow - Custom Build</name>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue