improve kreditor suche

This commit is contained in:
Ralph Soika 2024-08-15 10:05:02 +02:00
parent 9654b42d48
commit 49c01370eb
3 changed files with 11 additions and 26 deletions

View file

@ -97,8 +97,14 @@ public class CargosoftController implements Serializable {
// die cargosoft Kreditornummer beginnt seltsamerweise mit einem K // die cargosoft Kreditornummer beginnt seltsamerweise mit einem K
// und die Debitoren mit einem D..... // und die Debitoren mit einem D.....
String query = "(type:" + KreditorDebitorService.TYPE_CARGOSOFTKREDITOR + ") AND ( (name:K" + phrase String query = "(type:" + KreditorDebitorService.TYPE_CARGOSOFTKREDITOR + ")";
+ "*) OR (name:D" + phrase + "*) OR (" + phrase.toLowerCase() + "*) )"; if (phrase.toUpperCase().startsWith("K") || phrase.toUpperCase().startsWith("D")) {
query = query + " AND ( (name:" + phrase + "*) OR (" + phrase.toLowerCase() + "*) )";
} else {
// query with K and D prafix
query = query + " AND ( (name:K" + phrase + "*) OR (name:D" + phrase + "*) "
+ " OR (" + phrase.toLowerCase() + "*) )";
}
try { try {
List<ItemCollection> result = documentService.find(query, 20, 0, "$modified", true); List<ItemCollection> result = documentService.find(query, 20, 0, "$modified", true);

View file

@ -5,11 +5,7 @@
template="/layout/template.xhtml"> template="/layout/template.xhtml">
<ui:define name="content"> <ui:define name="content">
<f:view> <f:view>
<h:form id="zahlungsziel_form_id"> <h:form id="zahlungsziel_form_id">
<!-- ########## Error ########## --> <!-- ########## Error ########## -->
@ -26,16 +22,11 @@
<h:outputText value="Accounts " /> <h:outputText value="Accounts " />
</h1> </h1>
</div> </div>
<!-- ########## Error ########## --> <!-- ########## Error ########## -->
<ui:include src="/error_message.xhtml" /> <ui:include src="/error_message.xhtml" />
<div class="imixs-body"> <div class="imixs-body">
<div class="imixs-form-panel"> <div class="imixs-form-panel">
<div class="imixs-form-section-2"> <div class="imixs-form-section-2">
<dl> <dl>
<dt>Creditor/Debtor:</dt> <dt>Creditor/Debtor:</dt>
@ -44,11 +35,8 @@
pt:data-item="cdtr.number" /> pt:data-item="cdtr.number" />
</dd> </dd>
</dl> </dl>
</div> </div>
<h:panelGroup layout="block" styleClass="imixs-form-section-2" id="contentIputID"> <h:panelGroup layout="block" styleClass="imixs-form-section-2" id="contentIputID">
<dl> <dl>
<dt>E-Mail:</dt> <dt>E-Mail:</dt>
<dd> <dd>
@ -59,8 +47,6 @@
<span class="small">Separate multiple addresses with new lines.</span> <span class="small">Separate multiple addresses with new lines.</span>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt>Term of Payment:</dt> <dt>Term of Payment:</dt>
<dd> <dd>
@ -69,10 +55,6 @@
pt:data-item="cdtr.creditperiod" /> days pt:data-item="cdtr.creditperiod" /> days
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt>Country:</dt> <dt>Country:</dt>
<dd> <dd>
@ -80,11 +62,8 @@
value="#{cargosoftController.kreditor.item['country']}" /> value="#{cargosoftController.kreditor.item['country']}" />
</dd> </dd>
</dl> </dl>
</h:panelGroup> </h:panelGroup>
<div class="imixs-form-section-2"> <div class="imixs-form-section-2">
<dl> <dl>

View file

@ -66,11 +66,11 @@
$("input[data-item='invoice.number']").focus().select(); $("input[data-item='invoice.number']").focus().select();
} }
// update iban/bic // update iban/bic if available
if (inputElementIban) { if (inputElementIban && cdtrData.iban && cdtrData.iban != '') {
inputElementIban.val(cdtrData.iban); inputElementIban.val(cdtrData.iban);
} }
if (inputElementBic) { if (inputElementBic && cdtrData.bic && cdtrData.bic != '') {
inputElementBic.val(cdtrData.bic); inputElementBic.val(cdtrData.bic);
} }
if (inputElementMail) { if (inputElementMail) {