From 29f62710a96b33402ead22a9f78fc0c70b744e9a Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Mon, 19 Jun 2023 16:00:32 +0200 Subject: [PATCH] =?UTF-8?q?op=20section=20w=C3=A4hrungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/alexanderlogistics/OPListController.java | 12 ++++++++++++ .../forms/alexander/section_opliste.xhtml | 16 +++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListController.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListController.java index fa889df..230224f 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListController.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListController.java @@ -306,6 +306,18 @@ public class OPListController implements Serializable { } + public double calculateInvoiceTotal(String currency) { + double result = 0; + for (ItemCollection invoice : invoiceList) { + if (currency.equals(invoice.getItemValueString("invoice.currency"))) { + result = result + invoice.getItemValueDouble("invoice.total"); + } + } + // rond with 2 digits + return InvoiceUtil.round(result); + + } + /** * Berechnet den gesammten OP Saldo * 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 41f81ce..7eff773 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 @@ -9,7 +9,6 @@ - @@ -149,12 +148,23 @@ - + + + + +
+ +
- + + + EUR
USD
+ + +