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"
|
2023-11-13 20:09:39 +01:00
|
|
|
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
|
|
|
|
layout:decorate="~{layout.html(title='Lagerverwaltung')}">
|
2023-11-05 16:11:36 +01:00
|
|
|
|
<body>
|
2023-11-15 17:27:04 +01:00
|
|
|
|
<div layout:fragment="content">
|
2023-11-21 23:01:33 +01:00
|
|
|
|
<h2 th:text="${'Produkt ' + (actionIsAdd ? 'anlegen' : 'bearbeiten')}"></h2>
|
|
|
|
|
<form method="post" th:object="${form}">
|
2023-11-15 17:27:04 +01:00
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label" for="type">Typ</label>
|
|
|
|
|
<div class="form-check form-check-inline" th:each="type : ${T(catering.catalog.CatalogDummyType).values()}">
|
2023-11-20 23:26:47 +01:00
|
|
|
|
<input class="form-check-input" type="radio" th:field="*{type}" th:value="${type}" th:text="${type}" th:errorclass="is-invalid" required/>
|
|
|
|
|
<div th:if="${#fields.hasErrors('type')}" class="invalid-feedback">Ungültiger Typ.</div>
|
2023-11-15 17:27:04 +01:00
|
|
|
|
</div>
|
2023-11-13 20:09:39 +01:00
|
|
|
|
</div>
|
2023-11-15 17:27:04 +01:00
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label" for="name">Produktname</label>
|
2023-11-20 23:26:47 +01:00
|
|
|
|
<input class="form-control" type="text" th:field="*{name}" th:errorclass="is-invalid" required/>
|
|
|
|
|
<div th:if="${#fields.hasErrors('name')}" class="invalid-feedback">Ungültiger Name.</div>
|
2023-11-13 20:09:39 +01:00
|
|
|
|
</div>
|
2023-11-15 17:27:04 +01:00
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label" for="quantity">Menge im Bestand</label>
|
2023-11-20 23:26:47 +01:00
|
|
|
|
<input class="form-control" type="number" th:field="*{quantity}" th:errorclass="is-invalid" required/>
|
|
|
|
|
<div th:if="${#fields.hasErrors('quantity')}" class="invalid-feedback">Ungültige Menge.</div>
|
2023-11-13 20:09:39 +01:00
|
|
|
|
</div>
|
2023-11-21 23:01:33 +01:00
|
|
|
|
<!-- the prices aren’t bound with th:field as they need special formatting -->
|
2023-11-15 17:27:04 +01:00
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label" for="wholesalePrice">Einkaufspreis</label>
|
2023-11-20 23:26:47 +01:00
|
|
|
|
<input class="form-control" type="number" name="wholesalePrice" th:value="${#numbers.formatDecimal(form.wholesalePrice, 1, 2)}" th:errorclass="is-invalid" step="0.01" min="0" required/>
|
|
|
|
|
<div th:if="${#fields.hasErrors('wholesalePrice')}" class="invalid-feedback">Ungültiger Einkaufspreis.</div>
|
2023-11-13 20:09:39 +01:00
|
|
|
|
</div>
|
2023-11-15 17:27:04 +01:00
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label" for="retailPrice">UVP</label>
|
2023-11-20 23:26:47 +01:00
|
|
|
|
<input class="form-control" type="number" name="retailPrice" th:value="${#numbers.formatDecimal(form.retailPrice, 1, 2)}" th:errorclass="is-invalid" step="0.01" min="0" required/>
|
|
|
|
|
<div th:if="${#fields.hasErrors('retailPrice')}" class="invalid-feedback">Ungültiger Verkaufspreis.</div>
|
2023-11-13 20:09:39 +01:00
|
|
|
|
</div>
|
2023-11-15 17:27:04 +01:00
|
|
|
|
<div class="mb-3">
|
2023-11-13 20:09:39 +01:00
|
|
|
|
<!-- FIXME darf nur bei angeboten als teil von partyservice angezeigt werden -->
|
2023-11-15 17:27:04 +01:00
|
|
|
|
<label class="form-label" for="promotionPrice">Aktionspreis</label>
|
2023-11-20 23:26:47 +01:00
|
|
|
|
<input class="form-control" type="number" name="promotionPrice" th:value="${#numbers.formatDecimal(form.promotionPrice.orElse(null), 1, 2)}" th:errorclass="is-invalid" step="0.01" min="0"/>
|
|
|
|
|
<div th:if="${#fields.hasErrors('promotionPrice')}" class="invalid-feedback">Ungültiger Aktionspreis.</div>
|
2023-11-13 20:09:39 +01:00
|
|
|
|
</div>
|
2023-11-21 23:01:33 +01:00
|
|
|
|
<button class="btn btn-primary" type="submit" th:text="${actionIsAdd ? 'Hinzufügen' : 'Bearbeiten'}"></button>
|
2023-11-13 20:09:39 +01:00
|
|
|
|
<!-- KANN: Bild und Beschreibungstext -->
|
|
|
|
|
</form>
|
2023-11-15 17:27:04 +01:00
|
|
|
|
</div>
|
2023-11-05 16:11:36 +01:00
|
|
|
|
</body>
|
|
|
|
|
</html>
|