Fix wrong price calculation on invoice

This commit is contained in:
Mathis Kral 2024-01-26 17:57:16 +01:00 committed by Simon Bruder
parent 580489d216
commit fbe8ce6953
Signed by: simon
GPG key ID: 347FF8699CDA0776

View file

@ -25,21 +25,24 @@ SPDX-FileCopyrightText: 2023-2024 swt23w23
<th scope="col">Beschreibung</th>
<th scope="col">Einzelpreis/Basispreis</th>
<th scope="col">Menge</th>
<th scope="col">Mietpreis</th>
<th scope="col">Gesamtpreis</th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr th:each="orderLine : ${order.getOrderLines()}">
<td th:text="${orderLine.getProductName()}"></td>
<td th:text="${orderLine.getPrice()}"></td>
<td th:text="${orderLine.getPrice().divide(orderLine.getQuantity().getAmount())}"></td>
<td th:text="${orderLine.getQuantity()}"></td>
<td th:text="${orderLine.getPrice().multiply(orderLine.getQuantity().getAmount()).add(order.getChargeLines(orderLine).getTotal())}"></td>
<td th:text="${order.getChargeLines(orderLine).getTotal()}"></td>
<td th:text="${orderLine.getPrice().add(order.getChargeLines(orderLine).getTotal())}"></td>
</tr>
<tr th:each="chargeLine : ${order.getChargeLines()}">
<td th:text="${staffCharges.get(chargeLine).getName()}"></td>
<td th:text="${chargeLine.getPrice()}"></td>
<td>-</td>
<td>1</td>
<td th:text="${chargeLine.getPrice()}"></td>
<td th:text="${chargeLine.getPrice()}"></td>
</tr>
</tbody>
</table>