debtr multi mail funktion
This commit is contained in:
parent
d8bfc6ce39
commit
0b8ad2a15d
10 changed files with 1288 additions and 15 deletions
|
|
@ -1,7 +1,14 @@
|
|||
# Versionen
|
||||
|
||||
### 1.2.12 (Development)
|
||||
|
||||
### 1.2.10 (Development)
|
||||
- Neue Debitoren/Kreditoren Verwaltung - Zusätzliche E-Mail
|
||||
Realisiert über neue Custom Feld 'textlist'
|
||||
- validierung e-mail erfolgt über Adapter und Workflow Rule
|
||||
|
||||
|
||||
|
||||
### 1.2.10
|
||||
|
||||
Inkasso Workflow
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<artifactId>office-alexander-logistics</artifactId>
|
||||
<groupId>com.alexander-logistics</groupId>
|
||||
<version>1.2.11</version>
|
||||
<version>1.2.12</version>
|
||||
</parent>
|
||||
<artifactId>office-alexander-logistics-app</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.io.Writer;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.enterprise.context.ConversationScoped;
|
||||
import javax.faces.context.FacesContext;
|
||||
|
|
@ -246,7 +247,11 @@ public class CargosoftController implements Serializable {
|
|||
add("no", jsonVal(cdtr.getItemValueString("_VENDOR_NUM"))). //
|
||||
add("name", jsonVal(cdtr.getItemValueString("_VENDOR_Name"))). //
|
||||
add("creditperiod", jsonVal(cdtr.getItemValueString("cdtr.creditperiod"))). //
|
||||
add("mail", jsonVal(cdtr.getItemValueString("cdtr.mail"))). //
|
||||
//add("mail", jsonVal(cdtr.getItemValue("cdtr.mail"))). //
|
||||
|
||||
add("mail", jsonVal((String) cdtr.getItemValue("cdtr.mail").stream()
|
||||
.collect(Collectors.joining("\\n")) )). //
|
||||
|
||||
add("iban", jsonVal(cdtr.getItemValueString("cdtr.iban"))). //
|
||||
add("bic", jsonVal(cdtr.getItemValueString("cdtr.bic"))). //
|
||||
// add ibans für kreditoren verwaltung
|
||||
|
|
@ -338,13 +343,20 @@ public class CargosoftController implements Serializable {
|
|||
}
|
||||
|
||||
|
||||
String mail= kreditor.getItemValueString("cdtr.mail").trim();
|
||||
if (!InvoiceUtil.validateEmail(mail)) {
|
||||
throw new PluginException(CargosoftController.class.getName(),
|
||||
"INVALID_EMAIL", "Die Daten konnten nicht aktualisiert werden! Bitte geben Sie eine gültige E-Mail Adresse ein!");
|
||||
List<String> mailList= kreditor.getItemValue("cdtr.mail");
|
||||
mailList= mailList.stream()
|
||||
.filter(str -> str != null && !str.isEmpty())
|
||||
.map(String::trim)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (String mail: mailList) {
|
||||
if (!InvoiceUtil.validateEmail(mail)) {
|
||||
throw new PluginException(CargosoftController.class.getName(),
|
||||
"INVALID_EMAIL", "Die Daten konnten nicht aktualisiert werden! Bitte geben Sie eine gültige E-Mail Adresse ein!");
|
||||
}
|
||||
}
|
||||
|
||||
cargoCreditor.setItemValue("cdtr.mail",mail);
|
||||
cargoCreditor.setItemValue("cdtr.mail",mailList);
|
||||
cargoCreditor.setItemValue("cdtr.iban", kreditor.getItemValueString("cdtr.iban"));
|
||||
cargoCreditor.setItemValue("cdtr.bic", kreditor.getItemValueString("cdtr.bic"));
|
||||
cargoCreditor.setItemValue("cdtr.iban2", kreditor.getItemValueString("cdtr.iban2"));
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.alexanderlogistics.mahnlauf;
|
|||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -20,12 +21,17 @@ import org.imixs.workflow.exceptions.AdapterException;
|
|||
import org.imixs.workflow.exceptions.ModelException;
|
||||
import org.imixs.workflow.exceptions.PluginException;
|
||||
|
||||
import com.alexanderlogistics.InvoiceUtil;
|
||||
|
||||
/**
|
||||
* The MahnlaufExecuteAdapter triggers the event 300 for all linked invoices
|
||||
* <p>
|
||||
* The Adapter also creates a child item '_invoices' with the details of the
|
||||
* processed invoices. This item is used in the Workflow Model to construct a
|
||||
* HTML Table wen sending the mail.
|
||||
* <p>
|
||||
* The Adapter also splits the item 'dbtr.mail' into a multi value field if
|
||||
* the value contains email addresses separated with new lines.
|
||||
*
|
||||
*
|
||||
* @version 1.0
|
||||
|
|
@ -183,6 +189,16 @@ public class MahnlaufExecuteAdapter implements SignalAdapter {
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
// Verify the dbtr.mail item (split into multi value)
|
||||
List<String> mailListe =mahnLaufWorkitem.getItemValue("dbtr.mail");
|
||||
for (String mail: mailListe) {
|
||||
logger.info(" teste mail:'" + mail + "'");
|
||||
if (!InvoiceUtil.validateEmail(mail)) {
|
||||
throw new PluginException(MahnlaufExecuteAdapter.class.getName(),
|
||||
"INVALID_EMAIL", "Die Daten konnten nicht aktualisiert werden! Bitte geben Sie eine gültige E-Mail Adresse ein!");
|
||||
}
|
||||
}
|
||||
return mahnLaufWorkitem;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,8 +58,11 @@
|
|||
|
||||
<dl>
|
||||
<dt>E-Mail:</dt>
|
||||
<dd><h:inputText pt:data-item="cdtr.mail"
|
||||
value="#{cargosoftController.kreditor.item['cdtr.mail']}" /></dd>
|
||||
<dd><h:inputTextarea pt:data-item="cdtr.mail" rows="2"
|
||||
value="#{cargosoftController.kreditor.itemList['cdtr.mail']}"
|
||||
converter="org.imixs.VectorConverter" />
|
||||
<br />
|
||||
<span class="small">Trennen Sie mehrere Adressen durch neue Zeilen.</span></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
var inputElementZahlungsziel=$("input[data-item='cdtr.creditperiod']");
|
||||
var inputElementZahlungszielCdtr=$("input[id$='cdtr_creditperiod']");
|
||||
var inputElementInvoiceDate=$("input[id$='date_invoice']");
|
||||
var inputElementMail=$("input[data-item='cdtr.mail']");
|
||||
var inputElementMail=$("input[data-item='cdtr.mail'],textarea[data-item='cdtr.mail']");
|
||||
var inputElementIban=$("input[data-item='cdtr.iban']");
|
||||
var inputElementBic=$("input[data-item='cdtr.bic']");
|
||||
if (inputElementZahlungszielCdtr) {
|
||||
|
|
|
|||
|
|
@ -58,10 +58,18 @@
|
|||
// append span with dbtr.name....
|
||||
inputElement.after( "<span id='dbtr-name-id' class='small'>" + dbtrData.name + "</p>" );
|
||||
|
||||
|
||||
var inputElementDbtrName=$("input[id$='dbtr_name']");
|
||||
if (inputElementDbtrName) {
|
||||
inputElementDbtrName.val(dbtrData.name);
|
||||
}
|
||||
// check if we have a mail...
|
||||
if (dbtrData.mail) {
|
||||
var inputElementMail=$("input[data-item='dbtr.mail'],textarea[data-item='dbtr.mail']");
|
||||
if (inputElementMail) {
|
||||
inputElementMail.val(dbtrData.mail);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// finally we do a trick and trigger the commandScript updateDbtrNumber which
|
||||
|
|
|
|||
4
pom.xml
4
pom.xml
|
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.alexander-logistics</groupId>
|
||||
<artifactId>office-alexander-logistics</artifactId>
|
||||
<version>1.2.11</version>
|
||||
<version>1.2.12</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Imixs Office Workflow - Custom Build</name>
|
||||
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
<org.imixs.workflow.version>5.2.18</org.imixs.workflow.version>
|
||||
<org.imixs.marty.version>4.2.3</org.imixs.marty.version>
|
||||
<!-- 4.5.3 -->
|
||||
<org.imixs.office.version>4.6.1</org.imixs.office.version>
|
||||
<org.imixs.office.version>4.6.2-SNAPSHOT</org.imixs.office.version>
|
||||
<org.imixs.adapters.version>2.3.1</org.imixs.adapters.version>
|
||||
<!-- 2.2.14 -->
|
||||
<org.imixs.archive.version>2.3.1-SNAPSHOT</org.imixs.archive.version>
|
||||
|
|
|
|||
1203
workflow/mahnlauf-de-1.0.4.bpmn
Normal file
1203
workflow/mahnlauf-de-1.0.4.bpmn
Normal file
File diff suppressed because it is too large
Load diff
24
workflow/validate_mail.js
Normal file
24
workflow/validate_mail.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
var result={};
|
||||
result.isValid=true;
|
||||
|
||||
if (( workitem.get("txtcomment") == null || ''==workitem.get("txtcomment")[0]) ) {
|
||||
result.isValid=false;
|
||||
result.errorMessage='Bitte geben Sie einen Kommentar ein.';
|
||||
}
|
||||
|
||||
if (workitem['dbtr.mail'] && workitem['dbtr.mail'].length>0) {
|
||||
var liste=workitem.get("dbtr.mail");
|
||||
for (i = 0; i < liste.length; i++) {
|
||||
validateMail(liste[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function validateMail(mail) {
|
||||
if (/^(?=.{1,64}@)[A-Za-z0-9_-]+(\.[A-Za-z0-9_-]+)*@[^-][A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[A-Za-z]{2,})$/.test(mail)) {
|
||||
// OK
|
||||
} else {
|
||||
result.isValid=false;
|
||||
result.errorMessage='Bitte geben Sie eine gültige E-Mail Adresse ein ('+ mail + ')!';
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue