update mahnlauf
This commit is contained in:
parent
1870d0856a
commit
7bc51dd69b
12 changed files with 7384 additions and 351 deletions
6
MAIL_OAUTH2.md
Normal file
6
MAIL_OAUTH2.md
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
https://techcommunity.microsoft.com/t5/exchange/javamail-connecting-to-office-365-xoauth2-for-imap/m-p/1505026
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -39,109 +39,113 @@ import org.imixs.workflow.faces.data.WorkflowEvent;
|
||||||
@ConversationScoped
|
@ConversationScoped
|
||||||
public class OPListController implements Serializable {
|
public class OPListController implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public static final int TASK_ERSTELLUNG = 1000;
|
public static final int TASK_ERSTELLUNG = 1000;
|
||||||
private static Logger logger = Logger.getLogger(OPListController.class.getName());
|
private static Logger logger = Logger.getLogger(OPListController.class.getName());
|
||||||
|
|
||||||
private String lastDbtrNumber = null;
|
private String lastDbtrNumber = null;
|
||||||
|
|
||||||
private List<ItemCollection> invoiceList = null;
|
private List<ItemCollection> invoiceList = null;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
protected WorkflowController workflowController;
|
protected WorkflowController workflowController;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
protected WorkflowService workflowService;
|
protected WorkflowService workflowService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ZahlungseingangService zahlungseingangService;
|
ZahlungseingangService zahlungseingangService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
protected DocumentService documentService;
|
protected DocumentService documentService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Diese Methode liefert die Rechnungen zur gegebenen dbtrNumber. Die Methode
|
* Diese Methode liefert die Rechnungen zur gegebenen dbtrNumber. Die Methode
|
||||||
* nutzt einen lokalen cache um die Zugriffe zu beschleunigen.
|
* nutzt einen lokalen cache um die Zugriffe zu beschleunigen.
|
||||||
* <p>
|
* <p>
|
||||||
* Befindet sich der Zahlungseingang in Erstellung (Task=1000) werden alle
|
* Befindet sich der Zahlungseingang in Erstellung (Task=1000) werden alle
|
||||||
* offenen Rechnungen geholt
|
* offenen Rechnungen geholt
|
||||||
* <p>
|
* <p>
|
||||||
* Befindet sich der Zahlungseingang nicht mehr in erstellung werden nur die
|
* Befindet sich der Zahlungseingang nicht mehr in erstellung werden nur die
|
||||||
* Rechnugnen aus $workitemRef geholt!
|
* Rechnugnen aus $workitemRef geholt!
|
||||||
*
|
*
|
||||||
* @param _dbtrNumber
|
* @param _dbtrNumber
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public List<ItemCollection> getInvoices(String _dbtrNumber) {
|
public List<ItemCollection> getInvoices(String _dbtrNumber) {
|
||||||
|
|
||||||
// Compute all open invoices if TASK_ERSTELLUNG....
|
// Compute all open invoices if TASK_ERSTELLUNG....
|
||||||
if (workflowController.getWorkitem().getTaskID() == TASK_ERSTELLUNG) {
|
if (workflowController.getWorkitem().getTaskID() == TASK_ERSTELLUNG) {
|
||||||
|
|
||||||
// return empty list if dbtr is not set
|
// return empty list if dbtr is not set
|
||||||
if (_dbtrNumber == null || _dbtrNumber.isEmpty()) {
|
if (_dbtrNumber == null || _dbtrNumber.isEmpty()) {
|
||||||
invoiceList = new ArrayList<ItemCollection>();
|
invoiceList = new ArrayList<ItemCollection>();
|
||||||
return invoiceList;
|
return invoiceList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if last dbtr number is equal then return the current list....
|
// if last dbtr number is equal then return the current list....
|
||||||
if (invoiceList != null && lastDbtrNumber != null && lastDbtrNumber.equals(_dbtrNumber)) {
|
if (invoiceList != null && lastDbtrNumber != null && lastDbtrNumber.equals(_dbtrNumber)) {
|
||||||
return invoiceList;
|
return invoiceList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// load new invoice list....
|
// load new invoice list....
|
||||||
|
|
||||||
lastDbtrNumber = _dbtrNumber;
|
lastDbtrNumber = _dbtrNumber;
|
||||||
invoiceList = new ArrayList<ItemCollection>();
|
invoiceList = new ArrayList<ItemCollection>();
|
||||||
logger.info("....loading open Invoices for " + _dbtrNumber);
|
logger.info("....loading open Invoices for " + _dbtrNumber);
|
||||||
|
|
||||||
// Aus der dbtrNummer muss das führendde D entfernt werden
|
// Aus der dbtrNummer muss das führendde D entfernt werden
|
||||||
// wir speichern dieses zwar im Zahlungseingangs Workflow, aber eine
|
// wir speichern dieses zwar im Zahlungseingangs Workflow, aber eine
|
||||||
// Ausganksrechnung kennt das nicht
|
// Ausganksrechnung kennt das nicht
|
||||||
// Das ganze ist ein übles Relikt aus Cargosoft und kann nicht vermieden werden
|
// Das ganze ist ein übles Relikt aus Cargosoft und kann nicht vermieden werden
|
||||||
if (_dbtrNumber.startsWith("D")) {
|
if (_dbtrNumber.startsWith("D")) {
|
||||||
_dbtrNumber = _dbtrNumber.substring(1);
|
_dbtrNumber = _dbtrNumber.substring(1);
|
||||||
}
|
}
|
||||||
//(type:workitem OR type:workitemarchive)
|
// (type:workitem OR type:workitemarchive)
|
||||||
String query = "(type:workitem) AND ($modelversion:rechnungsausgang-*) AND (dbtr.number:"
|
String query = "(type:workitem) AND ($modelversion:rechnungsausgang-*) AND (dbtr.number:" + _dbtrNumber
|
||||||
+ _dbtrNumber + ")";
|
+ ")";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
invoiceList = documentService.find(query, 999, 0, "$created", false);
|
invoiceList = documentService.find(query, 999, 0, "$created", false);
|
||||||
} catch (QueryException e) {
|
} catch (QueryException e) {
|
||||||
logger.severe("Failed to get op liste:" + e.getMessage());
|
logger.severe("Failed to get op liste:" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// We are no longer in TASK_ERSTELLUNG, so
|
// We are no longer in TASK_ERSTELLUNG, so
|
||||||
// fetch only selected invoices
|
// fetch only selected invoices
|
||||||
invoiceList = new ArrayList<ItemCollection>();
|
invoiceList = new ArrayList<ItemCollection>();
|
||||||
List<String> selection = workflowController.getWorkitem().getItemValue("$workitemref");
|
if (!workflowController.getWorkitem().isItemEmpty("$workitemref")) {
|
||||||
for (String id : selection) {
|
List<String> selection = workflowController.getWorkitem().getItemValue("$workitemref");
|
||||||
invoiceList.add(documentService.load(id));
|
for (String id : selection) {
|
||||||
}
|
if (id != null && !id.isEmpty()) {
|
||||||
}
|
invoiceList.add(documentService.load(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// finally we set the 'selection' item depending on the $workitemList
|
// finally we set the 'selection' item depending on the $workitemList
|
||||||
// and the payment amount form the 'payment.details'
|
// and the payment amount form the 'payment.details'
|
||||||
List<String> selection = workflowController.getWorkitem().getItemValue("$workitemref");
|
List<String> selection = workflowController.getWorkitem().getItemValue("$workitemref");
|
||||||
List<ItemCollection> paymentList = zahlungseingangService.loadPaymentDetails(workflowController.getWorkitem());
|
List<ItemCollection> paymentList = zahlungseingangService.loadPaymentDetails(workflowController.getWorkitem());
|
||||||
for (ItemCollection invoice : invoiceList) {
|
for (ItemCollection invoice : invoiceList) {
|
||||||
if (selection.contains(invoice.getUniqueID())) {
|
if (selection.contains(invoice.getUniqueID())) {
|
||||||
invoice.setItemValue("selected", true);
|
invoice.setItemValue("selected", true);
|
||||||
// set amount
|
// set amount
|
||||||
for (ItemCollection payment : paymentList) {
|
for (ItemCollection payment : paymentList) {
|
||||||
if (invoice.getUniqueID().equals(payment.getUniqueID())) {
|
if (invoice.getUniqueID().equals(payment.getUniqueID())) {
|
||||||
invoice.setItemValue("payment.amount", payment.getItemValue("payment.amount"));
|
invoice.setItemValue("payment.amount", payment.getItemValue("payment.amount"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return invoiceList;
|
return invoiceList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * Liefert die Payments die mit diesem workitem verbunden sind...
|
// * Liefert die Payments die mit diesem workitem verbunden sind...
|
||||||
|
|
@ -165,112 +169,113 @@ public class OPListController implements Serializable {
|
||||||
// return result;
|
// return result;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On Before Process we store the selected invoices in $worktiemRef
|
* On Before Process we store the selected invoices in $worktiemRef
|
||||||
*
|
*
|
||||||
* @param workflowEvent
|
* @param workflowEvent
|
||||||
*/
|
*/
|
||||||
public void onWorkflowEvent(@Observes WorkflowEvent workflowEvent) {
|
public void onWorkflowEvent(@Observes WorkflowEvent workflowEvent) {
|
||||||
if (workflowEvent == null || workflowEvent.getWorkitem() == null) {
|
if (workflowEvent == null || workflowEvent.getWorkitem() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// store a collection of child items if you are in a Zahlungseingang
|
// store a collection of child items if you are in a Zahlungseingang
|
||||||
if (workflowEvent.getWorkitem().getModelVersion().startsWith("zahlungseingang")
|
if (workflowEvent.getWorkitem().getModelVersion().startsWith("zahlungseingang")
|
||||||
&& workflowEvent.getEventType() == WorkflowEvent.WORKITEM_BEFORE_PROCESS) {
|
&& workflowEvent.getEventType() == WorkflowEvent.WORKITEM_BEFORE_PROCESS) {
|
||||||
updateChildList(workflowEvent.getWorkitem());
|
updateChildList(workflowEvent.getWorkitem());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemCollection loadInvoice(String id) {
|
public ItemCollection loadInvoice(String id) {
|
||||||
return documentService.load(id);
|
return documentService.load(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Diese Methode aktualisiert das item ChildWOrkitems mit allen selektierten
|
* Diese Methode aktualisiert das item ChildWOrkitems mit allen selektierten
|
||||||
* Invoices udn berechnet den payment total
|
* Invoices udn berechnet den payment total
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public void updateChildList(ItemCollection workitem) {
|
public void updateChildList(ItemCollection workitem) {
|
||||||
double paymentTotal = 0;
|
double paymentTotal = 0;
|
||||||
List<Map> mapInvoiceItems = new ArrayList<Map>();
|
List<Map> mapInvoiceItems = new ArrayList<Map>();
|
||||||
// convert the child ItemCollection elements into a List of Map
|
// convert the child ItemCollection elements into a List of Map
|
||||||
logger.info("Convert child items into Map...");
|
logger.info("Convert child items into Map...");
|
||||||
// iterate over all order items..
|
// iterate over all order items..
|
||||||
List<String> selectionList = new ArrayList<String>();
|
List<String> selectionList = new ArrayList<String>();
|
||||||
for (ItemCollection invoice : invoiceList) {
|
for (ItemCollection invoice : invoiceList) {
|
||||||
if (invoice.getItemValueBoolean("selected")) {
|
if (invoice.getItemValueBoolean("selected")) {
|
||||||
logger.info("calculate - " + invoice.getUniqueID());
|
logger.info("calculate - " + invoice.getUniqueID());
|
||||||
selectionList.add(invoice.getUniqueID());
|
selectionList.add(invoice.getUniqueID());
|
||||||
paymentTotal = paymentTotal + invoice.getItemValueDouble("payment.amount");
|
paymentTotal = paymentTotal + invoice.getItemValueDouble("payment.amount");
|
||||||
ItemCollection invoiceStub = new ItemCollection();
|
ItemCollection invoiceStub = new ItemCollection();
|
||||||
invoiceStub.setItemValue(WorkflowKernel.UNIQUEID, invoice.getUniqueID());
|
invoiceStub.setItemValue(WorkflowKernel.UNIQUEID, invoice.getUniqueID());
|
||||||
invoiceStub.setItemValue("payment.amount", invoice.getItemValue("payment.amount"));
|
invoiceStub.setItemValue("payment.amount", invoice.getItemValue("payment.amount"));
|
||||||
mapInvoiceItems.add(invoiceStub.getAllItems());
|
mapInvoiceItems.add(invoiceStub.getAllItems());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// rond with 2 digits
|
// rond with 2 digits
|
||||||
workitem.replaceItemValue("payment.total", Math.round(paymentTotal * 100.0) / 100.0);
|
workitem.replaceItemValue("payment.total", Math.round(paymentTotal * 100.0) / 100.0);
|
||||||
// update childitems
|
// update childitems
|
||||||
workitem.replaceItemValue(ZahlungseingangService.ITEM_PAYMENT_DETAILS, mapInvoiceItems);
|
workitem.replaceItemValue(ZahlungseingangService.ITEM_PAYMENT_DETAILS, mapInvoiceItems);
|
||||||
// Update $workitemref
|
// Update $workitemref
|
||||||
workitem.setItemValue("$workitemref", selectionList);
|
workitem.setItemValue("$workitemref", selectionList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This JSF backing method is called by cargosft-debitor-serach.xhtml after the
|
* This JSF backing method is called by cargosft-debitor-serach.xhtml after the
|
||||||
* user has selected a new debitor.
|
* user has selected a new debitor.
|
||||||
* <p>
|
* <p>
|
||||||
* The new dbtrNumber is slected form the curren ajax request param 'dbtrNumber'
|
* The new dbtrNumber is slected form the curren ajax request param 'dbtrNumber'
|
||||||
* <p>
|
* <p>
|
||||||
* The method just updates the dbtr.number of the current workitem. The form
|
* The method just updates the dbtr.number of the current workitem. The form
|
||||||
* will than rerender the opList section.
|
* will than rerender the opList section.
|
||||||
*/
|
*/
|
||||||
public void updateDbtrNumber() {
|
public void updateDbtrNumber() {
|
||||||
FacesContext fc = FacesContext.getCurrentInstance();
|
FacesContext fc = FacesContext.getCurrentInstance();
|
||||||
String dbtrNumber = fc.getExternalContext().getRequestParameterMap().get("dbtrNumber");
|
String dbtrNumber = fc.getExternalContext().getRequestParameterMap().get("dbtrNumber");
|
||||||
logger.fine(".........dbtrNumber = " + dbtrNumber);
|
logger.fine(".........dbtrNumber = " + dbtrNumber);
|
||||||
workflowController.getWorkitem().setItemValue("dbtr.number", dbtrNumber);
|
workflowController.getWorkitem().setItemValue("dbtr.number", dbtrNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
* Hilfsmethode delegates to ZahlungseingangServcie
|
||||||
* Hilfsmethode delegates to ZahlungseingangServcie
|
*
|
||||||
* @param payment
|
* @param payment
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<ItemCollection> loadPaymentDetails(ItemCollection payment) {
|
public List<ItemCollection> loadPaymentDetails(ItemCollection payment) {
|
||||||
return zahlungseingangService.loadPaymentDetails(payment);
|
return zahlungseingangService.loadPaymentDetails(payment);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Berechnet den gesammten OP Saldo
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public double calculateInvoiceTotal() {
|
|
||||||
double result = 0;
|
|
||||||
for (ItemCollection invoice : invoiceList) {
|
|
||||||
result = result + invoice.getItemValueDouble("invoice.total");
|
|
||||||
}
|
|
||||||
// rond with 2 digits
|
|
||||||
return Math.round(result * 100.0) / 100.0;
|
|
||||||
|
|
||||||
}
|
/**
|
||||||
|
* Berechnet den gesammten OP Saldo
|
||||||
/**
|
*
|
||||||
* Berechnet den gesammten OP Saldo
|
* @return
|
||||||
*
|
*/
|
||||||
* @return
|
public double calculateInvoiceTotal() {
|
||||||
*/
|
double result = 0;
|
||||||
public double calculateInvoiceSaldo() {
|
for (ItemCollection invoice : invoiceList) {
|
||||||
double result = 0;
|
result = result + invoice.getItemValueDouble("invoice.total");
|
||||||
for (ItemCollection invoice : invoiceList) {
|
}
|
||||||
result = result + invoice.getItemValueDouble("invoice.saldo");
|
// rond with 2 digits
|
||||||
}
|
return Math.round(result * 100.0) / 100.0;
|
||||||
// rond with 2 digits
|
|
||||||
return Math.round(result * 100.0) / 100.0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Berechnet den gesammten OP Saldo
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public double calculateInvoiceSaldo() {
|
||||||
|
double result = 0;
|
||||||
|
for (ItemCollection invoice : invoiceList) {
|
||||||
|
result = result + invoice.getItemValueDouble("invoice.saldo");
|
||||||
|
}
|
||||||
|
// rond with 2 digits
|
||||||
|
return Math.round(result * 100.0) / 100.0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import java.io.InputStream;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
|
@ -49,7 +50,7 @@ import org.imixs.workflow.exceptions.PluginException;
|
||||||
import org.imixs.workflow.exceptions.QueryException;
|
import org.imixs.workflow.exceptions.QueryException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The CargosoftExportScheduler exportier eine csv Datei auf eine FTP Laufwerk
|
* The CargosoftExportScheduler exportiert eine csv Datei auf eine FTP Laufwerk
|
||||||
* mit allen noch offenen Rechnungen. Diese Datei wird von Cargosoft ann
|
* mit allen noch offenen Rechnungen. Diese Datei wird von Cargosoft ann
|
||||||
* verwendet um den Kreditramen für einen kunden zu ermitteln. Es werden
|
* verwendet um den Kreditramen für einen kunden zu ermitteln. Es werden
|
||||||
* praktisch von Cargosoft nur die offenen Salen aus unserer CSV Datei pro
|
* praktisch von Cargosoft nur die offenen Salen aus unserer CSV Datei pro
|
||||||
|
|
@ -66,191 +67,204 @@ import org.imixs.workflow.exceptions.QueryException;
|
||||||
*/
|
*/
|
||||||
public class CargosoftExportScheduler implements Scheduler {
|
public class CargosoftExportScheduler implements Scheduler {
|
||||||
|
|
||||||
public static final int MAX_COUNT = 999;
|
public static final int MAX_COUNT = 999;
|
||||||
public static final String FTP_ERROR = "FTP_ERROR";
|
public static final String FTP_ERROR = "FTP_ERROR";
|
||||||
|
|
||||||
public static DateFormat dateFormat = new SimpleDateFormat("ddMMyyyy");
|
public static DateFormat dateFormat = new SimpleDateFormat("ddMMyyyy");
|
||||||
public static DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
public static DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
||||||
public static DecimalFormat rateFormat = new DecimalFormat("0.000000");
|
public static DecimalFormat rateFormat = new DecimalFormat("0.000000");
|
||||||
|
|
||||||
@EJB
|
@EJB
|
||||||
DocumentService documentService;
|
DocumentService documentService;
|
||||||
|
|
||||||
@EJB
|
@EJB
|
||||||
WorkflowService workflowService;
|
WorkflowService workflowService;
|
||||||
|
|
||||||
@EJB
|
@EJB
|
||||||
ModelService modelService;
|
ModelService modelService;
|
||||||
|
|
||||||
@EJB
|
@EJB
|
||||||
ReportService reportService;
|
ReportService reportService;
|
||||||
|
|
||||||
private static Logger logger = Logger.getLogger(CargosoftExportScheduler.class.getName());
|
private static Logger logger = Logger.getLogger(CargosoftExportScheduler.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the method which processes the timeout event depending on the running
|
* This is the method which processes the timeout event depending on the running
|
||||||
* timer settings.
|
* timer settings.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param timer
|
* @param timer
|
||||||
* @throws QueryException
|
* @throws QueryException
|
||||||
*/
|
*/
|
||||||
public ItemCollection run(ItemCollection configuration) throws SchedulerException {
|
public ItemCollection run(ItemCollection configuration) throws SchedulerException {
|
||||||
List<ItemCollection> invoices = null;
|
List<ItemCollection> invoices = null;
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
int lines = 0;
|
int lines = 0;
|
||||||
|
|
||||||
configuration.removeItem("_scheduler_logmessage");
|
configuration.removeItem("_scheduler_logmessage");
|
||||||
logMessage(configuration, "....export to Cargosoft...");
|
logMessage(configuration, "....export to Cargosoft...");
|
||||||
// $taskID<5900
|
// $taskID<5900
|
||||||
String sQuery = "(type:workitem AND $modelversion:rechnungsausgang* AND $taskid:[5000 TO 5899])";
|
String sQuery = "(type:workitem AND $modelversion:rechnungsausgang* AND $taskid:[5000 TO 5899])";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// find the textblock...
|
// find the textblock...
|
||||||
invoices = documentService.find(sQuery, 9999, 0);
|
invoices = documentService.find(sQuery, 9999, 0);
|
||||||
} catch (QueryException e) {
|
} catch (QueryException e) {
|
||||||
logMessage(configuration, "failed to search invoices by query: " + e.getMessage());
|
logMessage(configuration, "failed to search invoices by query: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (invoices != null && invoices.size() > 0) {
|
if (invoices != null && invoices.size() > 0) {
|
||||||
// File csvOutputFile = new File(CSV_FILE_NAME);
|
// File csvOutputFile = new File(CSV_FILE_NAME);
|
||||||
for (ItemCollection doc : invoices) {
|
for (ItemCollection doc : invoices) {
|
||||||
String line = "";
|
String line = "";
|
||||||
line = line + doc.getItemValueString("dbtr.number") + ";";
|
line = line + doc.getItemValueString("dbtr.number") + ";";
|
||||||
line = line + "\"" + doc.getItemValueString("dbtr.name") + "\";";
|
line = line + "\"" + doc.getItemValueString("dbtr.name") + "\";";
|
||||||
line = line + "\"" + doc.getItemValueString("invoice.number") + "\";";
|
line = line + "\"" + doc.getItemValueString("invoice.number") + "\";";
|
||||||
line = line + dateFormat.format(doc.getItemValueDate("invoice.date")) + ";";
|
line = line + dateFormat.format(doc.getItemValueDate("invoice.date")) + ";";
|
||||||
line = line + dateFormat.format(doc.getItemValueDate("invoice.duedate")) + ";";
|
line = line + dateFormat.format(doc.getItemValueDate("invoice.duedate")) + ";";
|
||||||
|
|
||||||
// Betrag soll; Betrag Haben;
|
// Betrag soll; Betrag Haben;
|
||||||
double betrag = doc.getItemValueDouble("invoice.total");
|
double betrag = doc.getItemValueDouble("invoice.total");
|
||||||
if (betrag >= 0) {
|
if (betrag >= 0) {
|
||||||
// Soll
|
// Soll
|
||||||
line = line + decimalFormat.format(betrag) + ";0,00;";
|
line = line + decimalFormat.format(betrag) + ";0,00;";
|
||||||
} else {
|
} else {
|
||||||
// Haben
|
// Haben
|
||||||
line = line + "0,00;" + decimalFormat.format(Math.abs(betrag)) + ";";
|
line = line + "0,00;" + decimalFormat.format(Math.abs(betrag)) + ";";
|
||||||
|
|
||||||
}
|
}
|
||||||
// Saldo; S/H Saldo
|
// Saldo; S/H Saldo
|
||||||
betrag = doc.getItemValueDouble("invoice.saldo");
|
betrag = doc.getItemValueDouble("invoice.saldo");
|
||||||
if (betrag >= 0) {
|
|
||||||
// Soll
|
|
||||||
line = line + decimalFormat.format(betrag) + ";S;";
|
|
||||||
} else {
|
|
||||||
// Haben
|
|
||||||
line = line + decimalFormat.format(Math.abs(betrag)) + ";H;";
|
|
||||||
}
|
|
||||||
|
|
||||||
// WKZ
|
// convert to hauswahrung
|
||||||
String wkz = doc.getItemValueString("invoice.currency");
|
double rate = doc.getItemValueDouble("invoice.rate");
|
||||||
if (!"EUR".equals(wkz)) {
|
double hausWaehrung = betrag;
|
||||||
line = line + wkz + ";" + rateFormat.format(doc.getItemValueDouble("invoice.rate")) + ";"
|
if (rate != 0.0) {
|
||||||
+ decimalFormat.format(doc.getItemValueDouble("invoice.base.amount")) + ";";
|
hausWaehrung = betrag / rate;
|
||||||
} else {
|
}
|
||||||
line = line + ";0,000000;0,00;";
|
|
||||||
}
|
|
||||||
|
|
||||||
// auffüllen mit 77 mal ';'
|
if (hausWaehrung >= 0) {
|
||||||
int i = 77;
|
// Soll
|
||||||
while (i > 0) {
|
line = line + decimalFormat.format(hausWaehrung) + ";S;";
|
||||||
line = line + ";";
|
} else {
|
||||||
i--;
|
// Haben
|
||||||
}
|
line = line + decimalFormat.format(Math.abs(hausWaehrung)) + ";H;";
|
||||||
buffer.append(line + "\n");
|
}
|
||||||
lines++;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
// WKZ
|
||||||
|
String wkz = doc.getItemValueString("invoice.currency");
|
||||||
|
if (!"EUR".equals(wkz)) {
|
||||||
|
line = line + //
|
||||||
|
wkz + ";" + //
|
||||||
|
decimalFormat.format(doc.getItemValueDouble("invoice.base.amount")) + ";" + //
|
||||||
|
rateFormat.format(doc.getItemValueDouble("invoice.rate")) + ";";
|
||||||
|
} else {
|
||||||
|
line = line + ";0,00;0,000000;";
|
||||||
|
}
|
||||||
|
line = line + ";;;;;;" +doc.getItemValueString("invoice.text");
|
||||||
|
// auffüllen mit 77 mal ';'
|
||||||
|
int i = 69;
|
||||||
|
while (i > 0) {
|
||||||
|
line = line + ";";
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
buffer.append(line + "\n");
|
||||||
|
lines++;
|
||||||
|
}
|
||||||
|
|
||||||
// transfer file via FTP...
|
}
|
||||||
FileData fileData = new FileData("OPD28.txt", String.valueOf(buffer).getBytes(), null, null);
|
|
||||||
|
|
||||||
put(configuration, fileData);
|
// transfer file via FTP...
|
||||||
|
DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmm");
|
||||||
|
// MMM d, yyyy HH:mm a
|
||||||
|
FileData fileData = new FileData("OPD_" + formatter.format(new Date()) + ".txt",
|
||||||
|
String.valueOf(buffer).getBytes(), null, null);
|
||||||
|
|
||||||
logMessage(configuration, "...Export completed: " + lines + " lines");
|
put(configuration, fileData);
|
||||||
return configuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void logMessage(ItemCollection configuration, String message) {
|
logMessage(configuration, "...Export completed: " + lines + " lines");
|
||||||
configuration.appendItemValue("_scheduler_logmessage", message);
|
return configuration;
|
||||||
logger.info(message);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
private void logMessage(ItemCollection configuration, String message) {
|
||||||
* Diese Hilfsmehtode überträgt eine Datei an einen FTP Server. Die
|
configuration.appendItemValue("_scheduler_logmessage", message);
|
||||||
* Verbindugnsdaten stehen im Configuraiton Workitem.
|
logger.info(message);
|
||||||
*
|
}
|
||||||
* @param fileData object
|
|
||||||
* @throws PluginException
|
|
||||||
*/
|
|
||||||
public void put(ItemCollection configuration, FileData fileData) {
|
|
||||||
|
|
||||||
String ftpServer = configuration.getItemValueString("_datev_ftp_host");
|
/**
|
||||||
String ftpUser = configuration.getItemValueString("_datev_ftp_userid");
|
* Diese Hilfsmehtode überträgt eine Datei an einen FTP Server. Die
|
||||||
String ftpPassword = configuration.getItemValueString("_datev_ftp_password");
|
* Verbindugnsdaten stehen im Configuraiton Workitem.
|
||||||
String ftpWorkingPath = configuration.getItemValueString("_datev_ftp_path_buchungsstapel");
|
*
|
||||||
int ftpPort = configuration.getItemValueInteger("_datev_ftp_port");
|
* @param fileData object
|
||||||
if (ftpPort <= 0) {
|
* @throws PluginException
|
||||||
// set default port
|
*/
|
||||||
ftpPort = 21;
|
public void put(ItemCollection configuration, FileData fileData) {
|
||||||
}
|
|
||||||
|
|
||||||
String fileName = fileData.getName();
|
String ftpServer = configuration.getItemValueString("_datev_ftp_host");
|
||||||
|
String ftpUser = configuration.getItemValueString("_datev_ftp_userid");
|
||||||
|
String ftpPassword = configuration.getItemValueString("_datev_ftp_password");
|
||||||
|
String ftpWorkingPath = configuration.getItemValueString("_datev_ftp_path_buchungsstapel");
|
||||||
|
int ftpPort = configuration.getItemValueInteger("_datev_ftp_port");
|
||||||
|
if (ftpPort <= 0) {
|
||||||
|
// set default port
|
||||||
|
ftpPort = 21;
|
||||||
|
}
|
||||||
|
|
||||||
// Compute file path
|
String fileName = fileData.getName();
|
||||||
if (!ftpWorkingPath.startsWith("/")) {
|
|
||||||
ftpWorkingPath = "/" + ftpWorkingPath;
|
|
||||||
}
|
|
||||||
if (!ftpWorkingPath.endsWith("/")) {
|
|
||||||
ftpWorkingPath = ftpWorkingPath + "/";
|
|
||||||
}
|
|
||||||
InputStream writer = null;
|
|
||||||
|
|
||||||
FTPClient ftpClient = null;
|
// Compute file path
|
||||||
try {
|
if (!ftpWorkingPath.startsWith("/")) {
|
||||||
logMessage(configuration, "......put " + fileName + " to FTP server: " + ftpServer + "...");
|
ftpWorkingPath = "/" + ftpWorkingPath;
|
||||||
ftpClient = new FTPSClient("TLS", false);
|
}
|
||||||
ftpClient.setBufferSize(8192);
|
if (!ftpWorkingPath.endsWith("/")) {
|
||||||
ftpClient.connect(ftpServer, ftpPort);
|
ftpWorkingPath = ftpWorkingPath + "/";
|
||||||
if (ftpClient.login(ftpUser, ftpPassword) == false) {
|
}
|
||||||
logMessage(configuration, "FTP file transfer failed: login failed!");
|
InputStream writer = null;
|
||||||
}
|
|
||||||
ftpClient.enterLocalPassiveMode();
|
|
||||||
ftpClient.setFileType(FTP.ASCII_FILE_TYPE);
|
|
||||||
ftpClient.setControlEncoding("UTF-8");
|
|
||||||
|
|
||||||
// verify directories
|
FTPClient ftpClient = null;
|
||||||
if (!ftpClient.changeWorkingDirectory(ftpWorkingPath)) {
|
try {
|
||||||
logMessage(configuration, "FTP file transfer failed: missing working directory '" + ftpWorkingPath
|
logMessage(configuration, "......put " + fileName + " to FTP server: " + ftpServer + "...");
|
||||||
+ "' : " + ftpClient.getReplyString());
|
ftpClient = new FTPSClient("TLS", false);
|
||||||
}
|
ftpClient.setBufferSize(8192);
|
||||||
|
ftpClient.connect(ftpServer, ftpPort);
|
||||||
|
if (ftpClient.login(ftpUser, ftpPassword) == false) {
|
||||||
|
logMessage(configuration, "FTP file transfer failed: login failed!");
|
||||||
|
}
|
||||||
|
ftpClient.enterLocalPassiveMode();
|
||||||
|
ftpClient.setFileType(FTP.ASCII_FILE_TYPE);
|
||||||
|
ftpClient.setControlEncoding("UTF-8");
|
||||||
|
|
||||||
// upload file to FTP server.
|
// verify directories
|
||||||
writer = new ByteArrayInputStream(fileData.getContent());
|
if (!ftpClient.changeWorkingDirectory(ftpWorkingPath)) {
|
||||||
|
logMessage(configuration, "FTP file transfer failed: missing working directory '" + ftpWorkingPath
|
||||||
|
+ "' : " + ftpClient.getReplyString());
|
||||||
|
}
|
||||||
|
|
||||||
if (!ftpClient.storeFile(fileName, writer)) {
|
// upload file to FTP server.
|
||||||
logMessage(configuration, "FTP file transfer failed: unable to write '" + ftpWorkingPath + fileName
|
writer = new ByteArrayInputStream(fileData.getContent());
|
||||||
+ "' : " + ftpClient.getReplyString());
|
|
||||||
}
|
|
||||||
|
|
||||||
logMessage(configuration, "...." + ftpWorkingPath + fileName + " transfered successfull to " + ftpServer);
|
if (!ftpClient.storeFile(fileName, writer)) {
|
||||||
|
logMessage(configuration, "FTP file transfer failed: unable to write '" + ftpWorkingPath + fileName
|
||||||
|
+ "' : " + ftpClient.getReplyString());
|
||||||
|
}
|
||||||
|
|
||||||
} catch (IOException e) {
|
logMessage(configuration, "...." + ftpWorkingPath + fileName + " transfered successfull to " + ftpServer);
|
||||||
logMessage(configuration, "FTP file transfer failed: " + e.getMessage());
|
|
||||||
} finally {
|
} catch (IOException e) {
|
||||||
// do logout....
|
logMessage(configuration, "FTP file transfer failed: " + e.getMessage());
|
||||||
try {
|
} finally {
|
||||||
if (writer != null) {
|
// do logout....
|
||||||
writer.close();
|
try {
|
||||||
}
|
if (writer != null) {
|
||||||
ftpClient.logout();
|
writer.close();
|
||||||
ftpClient.disconnect();
|
}
|
||||||
} catch (IOException e) {
|
ftpClient.logout();
|
||||||
logMessage(configuration, "FTP file transfer failed: " + e.getMessage());
|
ftpClient.disconnect();
|
||||||
}
|
} catch (IOException e) {
|
||||||
}
|
logMessage(configuration, "FTP file transfer failed: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,17 @@ public class MahnlaufExecuteAdapter implements SignalAdapter {
|
||||||
public ItemCollection execute(ItemCollection mahnLaufWorkitem, ItemCollection event)
|
public ItemCollection execute(ItemCollection mahnLaufWorkitem, ItemCollection event)
|
||||||
throws AdapterException, PluginException {
|
throws AdapterException, PluginException {
|
||||||
|
|
||||||
|
if (mahnLaufWorkitem.isItemEmpty("$workitemref")) {
|
||||||
|
throw new PluginException(MahnlaufRefAddAdapter.class.getName(), MahnlaufService.ERROR_WORKFLOW,
|
||||||
|
"Es wurden keine Rechnungen ausgewählt. Der Mahnlauf kann nicht gestartet werden.");
|
||||||
|
}
|
||||||
|
|
||||||
// get all Invoices of this Mahnlauf
|
// get all Invoices of this Mahnlauf
|
||||||
List<String> refList = mahnLaufWorkitem.getItemValue("$workitemref");
|
List<String> refList = mahnLaufWorkitem.getItemValue("$workitemref");
|
||||||
|
|
||||||
for (String uniqueId : refList) {
|
for (String uniqueId : refList) {
|
||||||
ItemCollection invoice = workflowService.getWorkItem(uniqueId);
|
ItemCollection invoice = workflowService.getWorkItem(uniqueId);
|
||||||
if (invoice != null && (invoice.getTaskID()>=MahnlaufService.TASK_MAHNLAUF_START && invoice.getTaskID()<=MahnlaufService.TASK_MAHNLAUF_END)) {
|
if (invoice != null && (invoice.getTaskID() >= MahnlaufService.TASK_MAHNLAUF_START
|
||||||
|
&& invoice.getTaskID() <= MahnlaufService.TASK_MAHNLAUF_END)) {
|
||||||
mahnlaufService.processInvoice(invoice.event(MahnlaufService.EVENT_MAHNLAUF_EXECUTE));
|
mahnlaufService.processInvoice(invoice.event(MahnlaufService.EVENT_MAHNLAUF_EXECUTE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ import org.imixs.workflow.exceptions.PluginException;
|
||||||
import org.imixs.workflow.exceptions.QueryException;
|
import org.imixs.workflow.exceptions.QueryException;
|
||||||
import org.imixs.workflow.sepa.services.SepaWorkflowService;
|
import org.imixs.workflow.sepa.services.SepaWorkflowService;
|
||||||
|
|
||||||
|
import com.alexanderlogistics.KreditorDebitorService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The MahnlaufRefAddAdapter links an invoice with a Mahnlauf for the
|
* The MahnlaufRefAddAdapter links an invoice with a Mahnlauf for the
|
||||||
* dbtr.number item . If there is currently no open Mahnlauf for this key, the
|
* dbtr.number item . If there is currently no open Mahnlauf for this key, the
|
||||||
|
|
@ -37,6 +39,9 @@ public class MahnlaufRefAddAdapter implements SignalAdapter {
|
||||||
|
|
||||||
@EJB
|
@EJB
|
||||||
ModelService modelService;
|
ModelService modelService;
|
||||||
|
|
||||||
|
@EJB
|
||||||
|
KreditorDebitorService kreditorDebitorService;
|
||||||
|
|
||||||
@EJB
|
@EJB
|
||||||
WorkflowService workflowService = null;
|
WorkflowService workflowService = null;
|
||||||
|
|
@ -55,6 +60,12 @@ public class MahnlaufRefAddAdapter implements SignalAdapter {
|
||||||
public ItemCollection execute(ItemCollection invoice, ItemCollection event)
|
public ItemCollection execute(ItemCollection invoice, ItemCollection event)
|
||||||
throws AdapterException, PluginException {
|
throws AdapterException, PluginException {
|
||||||
|
|
||||||
|
|
||||||
|
if (invoice.getTaskID()<MahnlaufService.TASK_MAHNLAUF_START || invoice.getTaskID()>MahnlaufService.TASK_MAHNLAUF_END) {
|
||||||
|
throw new PluginException(MahnlaufRefAddAdapter.class.getName(),
|
||||||
|
MahnlaufService.ERROR_CONFIG, "Der Mahnlauf kann nur für Rechnungen erstellt werden die bereits die Fälligkeit erreicht haben.");
|
||||||
|
}
|
||||||
|
|
||||||
String dbtrNumber = invoice.getItemValueString(MahnlaufService.ITEM_DBTR_NUMBER);
|
String dbtrNumber = invoice.getItemValueString(MahnlaufService.ITEM_DBTR_NUMBER);
|
||||||
ItemCollection mahnLaufWorkitem;
|
ItemCollection mahnLaufWorkitem;
|
||||||
try {
|
try {
|
||||||
|
|
@ -139,7 +150,15 @@ public class MahnlaufRefAddAdapter implements SignalAdapter {
|
||||||
|
|
||||||
// copy dbtr_iban
|
// copy dbtr_iban
|
||||||
mahnlaufWorkitem.setItemValue(MahnlaufService.ITEM_DBTR_NAME, invoice.getItemValue(MahnlaufService.ITEM_DBTR_NAME));
|
mahnlaufWorkitem.setItemValue(MahnlaufService.ITEM_DBTR_NAME, invoice.getItemValue(MahnlaufService.ITEM_DBTR_NAME));
|
||||||
mahnlaufWorkitem.setItemValue(MahnlaufService.ITEM_DBTR_EMAIL, invoice.getItemValue(MahnlaufService.ITEM_DBTR_EMAIL));
|
|
||||||
|
|
||||||
|
// lookup email....
|
||||||
|
String dbtrNumber=invoice.getItemValueString("dbtr.number");
|
||||||
|
ItemCollection dbtrItemCol=kreditorDebitorService.findDebitor("D"+dbtrNumber);
|
||||||
|
if (dbtrItemCol!=null) {
|
||||||
|
mahnlaufWorkitem.setItemValue(MahnlaufService.ITEM_DBTR_EMAIL, dbtrItemCol.getItemValueString("cdtr.mail"));// dbtr.mail
|
||||||
|
}
|
||||||
|
|
||||||
mahnlaufWorkitem.setItemValue(MahnlaufService.ITEM_DBTR_NUMBER, invoice.getItemValue(MahnlaufService.ITEM_DBTR_NUMBER));
|
mahnlaufWorkitem.setItemValue(MahnlaufService.ITEM_DBTR_NUMBER, invoice.getItemValue(MahnlaufService.ITEM_DBTR_NUMBER));
|
||||||
|
|
||||||
mahnlaufWorkitem.setItemValue("invoice.language", invoice.getItemValue("invoice.language"));
|
mahnlaufWorkitem.setItemValue("invoice.language", invoice.getItemValue("invoice.language"));
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ public class MahnlaufService {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
WorkflowService workflowService;
|
WorkflowService workflowService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||||
|
xmlns:f="http://xmlns.jcp.org/jsf/core"
|
||||||
|
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
|
||||||
|
xmlns:h="http://xmlns.jcp.org/jsf/html">
|
||||||
|
|
||||||
|
<!-- Zeit alle verknüften Zahlungen an -->
|
||||||
|
|
||||||
|
|
||||||
|
<h:panelGroup layout="block" styleClass="imixs-form-section"
|
||||||
|
id="paymentlist">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="imixsdatatable ">
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th style="">Mahnungen</th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<ui:param name="dunnings"
|
||||||
|
value="#{workitemLinkController.getExternalReferences('$workflowgroup:Mahnlauf')}"></ui:param>
|
||||||
|
<ui:repeat var="dunning_stub" value="#{dunnings}">
|
||||||
|
<ui:param name="dunning"
|
||||||
|
value="#{opListController.loadInvoice(dunning_stub.getUniqueID())}"></ui:param>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><h:link outcome="/pages/workitems/workitem">
|
||||||
|
#{dunning.item['$workflowsummary']}
|
||||||
|
<f:param name="id" value="#{dunning.item['$uniqueid']}" />
|
||||||
|
</h:link></td>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</ui:repeat>
|
||||||
|
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</h:panelGroup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ui:composition>
|
||||||
|
|
@ -67,7 +67,6 @@
|
||||||
<td style="text-align: right; color: red;"><h:outputText
|
<td style="text-align: right; color: red;"><h:outputText
|
||||||
value="#{invoice.item['invoice.saldo']}">
|
value="#{invoice.item['invoice.saldo']}">
|
||||||
<f:convertNumber minFractionDigits="2" locale="de" />
|
<f:convertNumber minFractionDigits="2" locale="de" />
|
||||||
|
|
||||||
</h:outputText></td>
|
</h:outputText></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -75,13 +74,18 @@
|
||||||
|
|
||||||
|
|
||||||
<!-- CheckBox -->
|
<!-- CheckBox -->
|
||||||
<td style="text-align: center;"><h:selectBooleanCheckbox class="invoice_selector" rendered="#{!readonly}"
|
<td style="text-align: center;">
|
||||||
|
|
||||||
|
<ui:fragment rendered="#{invoice.taskID ge 5100 and invoice.taskID lt 5299}">
|
||||||
|
<h:selectBooleanCheckbox class="invoice_selector" rendered="#{!readonly}"
|
||||||
value="#{invoice.item['selected']}"
|
value="#{invoice.item['selected']}"
|
||||||
onclick="initInvoicePayment(this)">
|
onclick="initInvoicePayment(this)">
|
||||||
<f:ajax event="change" execute="#{opListContainer.clientId}"
|
<f:ajax event="change" execute="#{opListContainer.clientId}"
|
||||||
listener="#{opListController.updateChildList(workitem)}"
|
listener="#{opListController.updateChildList(workitem)}"
|
||||||
render="#{opListContainer.clientId}"></f:ajax>
|
render="#{opListContainer.clientId}"></f:ajax>
|
||||||
</h:selectBooleanCheckbox></td>
|
</h:selectBooleanCheckbox>
|
||||||
|
</ui:fragment>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<table class="imixsdatatable ">
|
<table class="imixsdatatable ">
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -29,7 +28,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<ui:param name="payments"
|
<ui:param name="payments"
|
||||||
value="#{workitemLinkController.getExternalReferences('($WorkflowGroup:Zahlungseingang)')}"></ui:param>
|
value="#{workitemLinkController.getExternalReferences('$workflowgroup:Zahlungseingang')}"></ui:param>
|
||||||
<ui:repeat var="payment_stub" value="#{payments}">
|
<ui:repeat var="payment_stub" value="#{payments}">
|
||||||
<ui:param name="payment"
|
<ui:param name="payment"
|
||||||
value="#{opListController.loadInvoice(payment_stub.getUniqueID())}"></ui:param>
|
value="#{opListController.loadInvoice(payment_stub.getUniqueID())}"></ui:param>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.alexanderlogistics;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import javax.mail.MessagingException;
|
||||||
|
import javax.mail.NoSuchProviderException;
|
||||||
|
import javax.mail.Session;
|
||||||
|
import javax.mail.Store;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test generates random test data
|
||||||
|
*
|
||||||
|
* @author rsoika
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class TestIMAPOauth2 {
|
||||||
|
|
||||||
|
final static String FILE = "/DTVF_SKBeschrift_21010.csv";
|
||||||
|
|
||||||
|
private final static Logger logger = Logger.getLogger(TestIMAPOauth2.class.getName());
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test imap connect via oauth
|
||||||
|
*
|
||||||
|
* https://techcommunity.microsoft.com/t5/exchange/javamail-connecting-to-office-365-xoauth2-for-imap/m-p/1505026
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testIMAP() {
|
||||||
|
try {
|
||||||
|
Properties properties = new Properties();
|
||||||
|
properties.put("mail.imap.ssl.enable", "true");
|
||||||
|
properties.put("mail.imap.auth.mechanisms", "XOAUTH2");
|
||||||
|
properties.put("mail.imap.auth.mechanisms", "XOAUTH2");
|
||||||
|
properties.put("mail.imap.sasl.mechanisms", "XOAUTH2");
|
||||||
|
properties.put("mail.imap.sasl.enable", "true");
|
||||||
|
// properties.put("mail.imap.sasl.enable", "true"); un-commented still results
|
||||||
|
// are same
|
||||||
|
properties.put("mail.imap.auth.login.disable", "true");
|
||||||
|
properties.put("mail.imap.auth.plain.disable", "true");
|
||||||
|
properties.put("mail.debug", "true");
|
||||||
|
properties.put("mail.debug.auth", "true");
|
||||||
|
|
||||||
|
String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
|
||||||
|
properties.setProperty("mail.imap.socketFactory.class", SSL_FACTORY);
|
||||||
|
properties.setProperty("mail.imap.socketFactory.fallback", "false");
|
||||||
|
properties.setProperty("mail.imap.socketFactory.port", "993");
|
||||||
|
properties.setProperty("mail.imap.starttls.enable", "true");
|
||||||
|
|
||||||
|
|
||||||
|
Session session = Session.getInstance(properties);
|
||||||
|
session.setDebug(true);
|
||||||
|
|
||||||
|
String userEmail = "imixs@alexander-logistics.com";
|
||||||
|
// i^i$oe-!+o1o0io(
|
||||||
|
String accessToken = "accessToken";
|
||||||
|
|
||||||
|
Store store;
|
||||||
|
|
||||||
|
store = session.getStore("imap");
|
||||||
|
|
||||||
|
String url="outlook.office365.com";
|
||||||
|
//String url="https://outlook.office.com/IMAP.AccessAsUser.All";
|
||||||
|
store.connect(url, 993, userEmail, accessToken);
|
||||||
|
} catch (MessagingException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
Assert.fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
6850
office-alexander-logistics-app/src/test/resources/datev/OPD28.csv
Normal file
6850
office-alexander-logistics-app/src/test/resources/datev/OPD28.csv
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -413,6 +413,7 @@ Bei Fragen wenden Sie sich bitte an info@imixs.com
|
||||||
<imixs-form-section label="Positionen" path="alexander/section_datevbuchung" />
|
<imixs-form-section label="Positionen" path="alexander/section_datevbuchung" />
|
||||||
|
|
||||||
<imixs-form-section label="Zahlungseingänge" path="alexander/section_payments" />
|
<imixs-form-section label="Zahlungseingänge" path="alexander/section_payments" />
|
||||||
|
<imixs-form-section label="Mahnläufe" path="alexander/section_dunnings" />
|
||||||
</imixs-form>]]></bpmn2:documentation>
|
</imixs-form>]]></bpmn2:documentation>
|
||||||
<bpmn2:dataState id="DataState_1"/>
|
<bpmn2:dataState id="DataState_1"/>
|
||||||
</bpmn2:dataObject>
|
</bpmn2:dataObject>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue