Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!DOCTYPE html>
<html lang="es" xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="master">
<body>
<main layout:fragment="contenido">
<div class="col-12">
<h2>Ventas</h2>
<div th:classappend="'alert-' + (${clase != null} ? ${clase} : info)" th:if="${mensaje != null}"
th:text="${mensaje}"
class="alert">
</div>
<a class="btn btn-success mb-2" th:href="@{/vender/}">Agregar</a>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Fecha</th>
<th>Total</th>
<th>Productos</th>
</tr>
</thead>
<tbody>
<tr th:each="venta : ${ventas}">
<td th:text="${venta.fechaYHora}"></td>
<td th:text="${venta.total}"></td>
<td>
<table class="table table-bordered">
<thead>
<tr>
<th>Nombre</th>
<th>Código de barras</th>
<th>Cantidad vendida</th>
<th>Precio</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<tr th:each="producto : ${venta.productos}">
<td th:text="${producto.nombre}"></td>
<td th:text="${producto.codigo}"></td>
<td th:text="${producto.cantidad}"></td>
<td th:text="${producto.precio}"></td>
<td th:text="${producto.total}"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</main>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment