swt23w23/src/main/resources/templates/inventory-mutate.html

43 lines
1.8 KiB
HTML
Raw Normal View History

2023-11-05 16:11:36 +01:00
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
<head>
</head>
<body>
<h1>Lagerverwaltung</h1>
<h2 th:text="${'Produkt ' + (product == null ? 'anlegen' : 'bearbeiten')}"></h2>
<!-- TODO: maybe migrate to th:field (which is a pain) -->
<form method="post">
<div>
<label for="type">Typ</label>
<input type="radio" name="type" th:each="type : ${T(catering.catalog.CatalogDummyType).values()}" th:value="${type}" th:text="${type}" th:checked="${type.name() == product?.type?.name()}" required/>
</div>
<div>
<label for="name">Produktname</label>
<input type="text" name="name" th:value="${product?.name}" required/>
</div>
<div>
<label for="quantity">Menge im Bestand</label>
<input type="number" name="quantity" th:value="${item?.quantity}" required/>
</div>
<div>
<label for="wholesalePrice">Einkaufspreis</label>
<input type="number" name="wholesalePrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.wholesalePrice?.getNumber()?.doubleValueExact(), 1, 2)}" required/>
</div>
<div>
<label for="retailPrice">UVP</label>
<input type="number" name="retailPrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.price?.getNumber()?.doubleValueExact(), 1, 2)}" required/>
</div>
<div>
<!-- FIXME darf nur bei angeboten als teil von partyservice angezeigt werden -->
<label for="promotionPrice">Aktionspreis</label>
<input type="number" name="promotionPrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.promotionPrice?.getNumber()?.doubleValueExact(), 1, 2)}"/>
</div>
<div>
<button type="submit" th:text="${product == null ? 'Hinzufügen' : 'Bearbeiten'}"></button>
</div>
<!-- KANN: Bild und Beschreibungstext -->
</form>
</body>
</html>