From e5811ad0200cc3edb5a68786d65ec9235e8762b9 Mon Sep 17 00:00:00 2001 From: Mathis Kral Date: Sun, 5 Nov 2023 17:05:56 +0100 Subject: [PATCH] Add full order data to orders.html table --- src/main/java/catering/order/CustomOrder.java | 9 ++++++++ src/main/resources/templates/orders.html | 23 +++++++++++-------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/main/java/catering/order/CustomOrder.java b/src/main/java/catering/order/CustomOrder.java index 8c93cd9..2d92d06 100644 --- a/src/main/java/catering/order/CustomOrder.java +++ b/src/main/java/catering/order/CustomOrder.java @@ -1,10 +1,13 @@ package catering.order; +import com.querydsl.core.Tuple; import org.aspectj.weaver.ast.Or; import org.salespointframework.quantity.Quantity; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Collection; import java.util.Map; /** @@ -60,6 +63,12 @@ public class CustomOrder { return products; } + public Collection getFormattedProducts() { + ArrayList formattedProducts = new ArrayList<>(); + getProducts().forEach((k, v) -> formattedProducts.add(k + ": " + v)); + return formattedProducts; + } + public boolean invoiceAvailable() { return invoiceAvailable; } diff --git a/src/main/resources/templates/orders.html b/src/main/resources/templates/orders.html index 3ad4fe5..c65c4a7 100644 --- a/src/main/resources/templates/orders.html +++ b/src/main/resources/templates/orders.html @@ -16,17 +16,17 @@
-

Auftragsliste

+

Auftragsliste

- - - - - + + + + + @@ -36,7 +36,12 @@
VonBisKundeProduktdetailsRechnungVonBisKundeProduktdetailsRechnung Bezahlt Preis - +
@@ -69,8 +74,8 @@