mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-19 21:04:36 +02:00
Add full order data to orders.html table
This commit is contained in:
parent
f5454ddab5
commit
b3b817b869
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
<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>
|
||||
<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()}">
|
||||
|
|
Loading…
Reference in a new issue