From e8219ca579e8389af7eb92c4c041cd0c2199bdc2 Mon Sep 17 00:00:00 2001
From: Ralph Soika
Date: Thu, 31 Oct 2024 12:30:11 +0100
Subject: [PATCH] update
---
RELEASENOTES.md | 2 +
.../ZahlungseingangSaldoAdapter.java | 43 +-
.../forms/alexander/section_opliste.xhtml | 404 +-
workflow/rechnungsausgang-de-1.0.13.bpmn | 4279 +++++++++++++++++
workflow/zahlungseingang-de-1.0.5.bpmn | 1000 ++++
5 files changed, 5525 insertions(+), 203 deletions(-)
create mode 100644 workflow/rechnungsausgang-de-1.0.13.bpmn
create mode 100644 workflow/zahlungseingang-de-1.0.5.bpmn
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 968a79f..39bc52e 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -11,6 +11,8 @@
- Lucene Index: item 'cdtr.name' und 'document.company' wurde in den index aufgenommen wegen AI Examples Adapter
- Fix Fälligkeit in maske
- Fix XML Schnittstelle Cargosoft Sammelgutschrift
+ - Zahlungseingang kann nun korrigiert werden. => modell update 'zahlungseingang-de-1.0.5' und 'rechnungsausgang-de-1.0.13'
+ - fix Zahlungseingangs Formular
**Migration**
diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ZahlungseingangSaldoAdapter.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ZahlungseingangSaldoAdapter.java
index b9d3c34..d354b37 100644
--- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ZahlungseingangSaldoAdapter.java
+++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ZahlungseingangSaldoAdapter.java
@@ -35,7 +35,7 @@ public class ZahlungseingangSaldoAdapter implements SignalAdapter {
ZahlungseingangService zahlungseingangService;
/**
- * This method finds the outgoing invoicdes and updates the saldo
+ * This method finds the outgoing invoices and updates the saldo
* (payment.total).
*
* @throws PluginException
@@ -50,20 +50,20 @@ public class ZahlungseingangSaldoAdapter implements SignalAdapter {
}
/**
- * Diese method hängt eine referenz der aktuellen Rechnung an den Zahlungsavis
+ * Diese methode aktuallisiert alle referenzen der aktuellen Rechnungen
*
- * @param document
+ * @param workitem
* @throws PluginException
*/
- private void updateSaldo(ItemCollection document) throws PluginException {
+ private void updateSaldo(ItemCollection workitem) throws PluginException {
// payment currency
- String paymentCurrency = document.getItemValueString("payment.currency");
- double masterPaymentAmount = document.getItemValueDouble("payment.amount");
- double masterPaymentDifference = document.getItemValueDouble("payment.difference");
- String paymentWarning = document.getItemValueString("payment.warning");
+ String paymentCurrency = workitem.getItemValueString("payment.currency");
+ double masterPaymentAmount = workitem.getItemValueDouble("payment.amount");
+ double masterPaymentDifference = workitem.getItemValueDouble("payment.difference");
+ String paymentWarning = workitem.getItemValueString("payment.warning");
- List paymentDetails = zahlungseingangService.loadPaymentDetails(document);
+ List paymentDetails = zahlungseingangService.loadPaymentDetails(workitem);
if (paymentDetails.size() == 0) {
throw new PluginException(PluginException.class.getName(),
@@ -84,7 +84,7 @@ public class ZahlungseingangSaldoAdapter implements SignalAdapter {
// falls mehr einzelsummen eingeben wurden als der oben angegeben Total Pamyment
// dann soll eine Warnung ausgegen werden.
if (InvoiceUtil.round(masterPaymentAmount + masterPaymentDifference) != InvoiceUtil.round(einzelPayments)) {
- document.setItemValue("payment.warning", "invalid saldo");
+ workitem.setItemValue("payment.warning", "invalid saldo");
throw new PluginException(PluginException.class.getName(),
ZahlungseingangService.ERROR_PAYMENT_BOOKING_FAILED,
"Der Zahlungseingang ist nicht identisch mit den ausgebuchten Rechnungssalden. Sollte die Eingabe korrekt sein, wiederholen Sie die Aktion.");
@@ -123,7 +123,8 @@ public class ZahlungseingangSaldoAdapter implements SignalAdapter {
}
// vergeiche Restsaldo mit payment für diese Rechnung
- if (Math.abs(InvoiceUtil.round(invoicePaymentAmount)) > Math.abs(InvoiceUtil.round(invoiceSaldo))) {
+ if (!isPaymentBooked(workitem) && Math.abs(InvoiceUtil.round(invoicePaymentAmount)) > Math
+ .abs(InvoiceUtil.round(invoiceSaldo))) {
throw new PluginException(PluginException.class.getName(),
ZahlungseingangService.ERROR_PAYMENT_BOOKING_FAILED,
"Der Zahlungseingang kann nicht verbucht werden, da der Restsaldo der Rechnung "
@@ -131,8 +132,14 @@ public class ZahlungseingangSaldoAdapter implements SignalAdapter {
}
// jetzt den Rechnungsbetrag verkleinern
- invoiceSaldo = invoiceSaldo - invoicePaymentAmount;
-
+ // Falls die Rechnung bereits 5900 (Bezahlt) ist wird der Saldo korrigiert und
+ // wieder aufgerechnet
+ if (isPaymentBooked(workitem)) {
+ // STORNO
+ invoiceSaldo = invoiceSaldo + invoicePaymentAmount;
+ } else {
+ invoiceSaldo = invoiceSaldo - invoicePaymentAmount;
+ }
invoiceSaldo = (float) InvoiceUtil.round(invoiceSaldo);
invoice.setItemValue("invoice.saldo", invoiceSaldo);
invoice.event(ZahlungseingangService.EVENT_UPDATE_INVOICE);
@@ -147,4 +154,14 @@ public class ZahlungseingangSaldoAdapter implements SignalAdapter {
}
+ /**
+ * Returns true wenn der Zahlungseingang bereits gebucht ist
+ *
+ * @param workitem
+ * @return
+ */
+ public boolean isPaymentBooked(ItemCollection workitem) {
+ return (workitem.getTaskID() == 1900);
+ }
+
}
\ No newline at end of file
diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/section_opliste.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/section_opliste.xhtml
index d94892f..180ca43 100644
--- a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/section_opliste.xhtml
+++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/section_opliste.xhtml
@@ -1,19 +1,14 @@
-
-
+
-
+
@@ -22,9 +17,9 @@
-
+
-
+
@@ -36,107 +31,124 @@
| S/H |
|
- Kurs |
- Basisumsatz | |
+ Kurs |
+ Basisumsatz |
+ |
- Saldo | |
+ Saldo |
+ |
Saldo in EUR |
|
Zahlbetrag |
|
-
+
-
- #{invoice.item['invoice.number']}
-
+ |
+
+ #{invoice.item['invoice.number']}
+
- |
+ |
-
-
- |
-
-
- |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+ |
- |
-
-
+ |
+
- |
-
- |
-
-
-
- |
-
-
-
-
+
|
-
-
-
+
+ |
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
|
-
+ |
+
- |
-
- |
+
+ |
+
+
+
+ |
-
+ |
+
- |
-
- |
+
+ |
+
+
+
+ |
-
+ |
+
-
-
+
|
-
+ |
+
- |
+
+ |
| |
@@ -144,59 +156,63 @@
|
- | |
+ |
+ |
Summary |
-
+
+
-
+
- |
+ |
EUR USD |
-
-
- | | | |
+
+
+ |
+ |
+ |
+ |
+ |
+ |
|
- | |
-
+
+
-
-
-
-
- EUR
-
-
-
+
+
+
+
+ EUR
+
+
+
|
-
-
+
+
|
-
+
|
-
@@ -204,112 +220,121 @@
@@ -317,5 +342,4 @@
-
-
+
\ No newline at end of file
diff --git a/workflow/rechnungsausgang-de-1.0.13.bpmn b/workflow/rechnungsausgang-de-1.0.13.bpmn
new file mode 100644
index 0000000..1583113
--- /dev/null
+++ b/workflow/rechnungsausgang-de-1.0.13.bpmn
@@ -0,0 +1,4279 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+$workflowstatus
+
+]]>
+
+
+ In case you have already made the payment, please disregard this notice. If you require any information regarding your account, please do not hesitate to contact us.
+Thank you for your cooperation.
+
+Kind regards
Alexander Global Logistics GmbH
+
+