Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 4, 2019 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/2c2472651e979b347841715c2b6a54f8 to your computer and use it in GitHub Desktop.
Save parzibyte/2c2472651e979b347841715c2b6a54f8 to your computer and use it in GitHub Desktop.
<!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