Add full order data to orders.html table

This commit is contained in:
Mathis Kral 2023-11-05 17:05:56 +01:00 committed by Simon Bruder
parent f5454ddab5
commit b3b817b869
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 23 additions and 9 deletions

View file

@ -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<String> getFormattedProducts() {
ArrayList<String> formattedProducts = new ArrayList<>();
getProducts().forEach((k, v) -> formattedProducts.add(k + ": " + v));
return formattedProducts;
}
public boolean invoiceAvailable() {
return invoiceAvailable;
}

View file

@ -16,17 +16,17 @@
</div>
<div>
<h1>Auftragsliste</h1>
<h1>Auftragsliste</h1>
</div>
<div> <!--th:unless"${cart.empty}"-->
<table style="width:100%; text-align:left">
<tr>
<th>Von</th>
<th>Bis</th>
<th>Kunde</th>
<th>Produktdetails</th>
<th>Rechnung</th>
<th style="width:10%">Von</th>
<th style="width:10%">Bis</th>
<th style="width:15%">Kunde</th>
<th style="width:30%">Produktdetails</th>
<th style="width:10%">Rechnung</th>
<th>Bezahlt</th>
<th>Preis</th>
<th></th>
@ -36,7 +36,12 @@
<td th:text="${order.getFormattedFinish()}">
<td th:text="BeispielKunde"/>
<td>
<a href="#productDetails" th:text="${order.getOrderType()}"/>
<div>
<a href="#productDetails" th:text="${order.getOrderType()}"/>
<ul th:each="product : ${order.getFormattedProducts()}">
<li th:text="${product}"/>
</ul>
</div>
</td>
<td>
<div th:if="${order.invoiceAvailable()}">
@ -69,8 +74,8 @@
</body>
<footer style="bottom: 0; position: absolute;">
<p>© Hannes Wurst @ Mampf GmbH</p>
<p>
<p>© Hannes Wurst @ Mampf GmbH</p>
<p>
<a href="mailto:catering@mampf.com">catering@mampf.com</a>
</p>
</footer>