mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 00:48:49 +00:00
trabajando en la vista del pedido
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
databaseChangeLog:
|
||||
- changeSet:
|
||||
id: add-fecha-entrega-to-pedidos-lineas
|
||||
author: jjo
|
||||
changes:
|
||||
- addColumn:
|
||||
tableName: pedidos_lineas
|
||||
columns:
|
||||
- column:
|
||||
name: fecha_entrega
|
||||
type: datetime
|
||||
constraints:
|
||||
nullable: true
|
||||
afterColumn: estado_manual
|
||||
|
||||
rollback:
|
||||
- dropColumn:
|
||||
tableName: pedidos_lineas
|
||||
columnName: fecha_entrega
|
||||
@ -30,4 +30,6 @@ databaseChangeLog:
|
||||
- include:
|
||||
file: db/changelog/changesets/0015-alter-pedidos-lineas-and-presupuesto-estados.yml
|
||||
- include:
|
||||
file: db/changelog/changesets/0016-fix-enum-estado-pedidos-lineas.yml
|
||||
file: db/changelog/changesets/0016-fix-enum-estado-pedidos-lineas.yml
|
||||
- include:
|
||||
file: db/changelog/changesets/0017-add-fecha-entrega-to-pedidos-lineas.yml
|
||||
@ -25,10 +25,15 @@ pedido.estado.terminado=Terminado
|
||||
pedido.estado.cancelado=Cancelado
|
||||
|
||||
pedido.module-title=Pedidos
|
||||
pedido.pedido=Pedido
|
||||
pedido.fecha-entrega=Fecha de entrega
|
||||
|
||||
pedido.table.id=Num. Pedido
|
||||
pedido.table.cliente=Cliente
|
||||
pedido.table.fecha=Fecha
|
||||
pedido.table.importe=Importe
|
||||
pedido.table.estado=Estado
|
||||
pedido.table.acciones=Acciones
|
||||
pedido.table.acciones=Acciones
|
||||
|
||||
pedido.view.tirada=Tirada
|
||||
pedido.view.view-presupuesto=Ver presupuesto
|
||||
@ -1,4 +1,8 @@
|
||||
$(()=>{
|
||||
$(document,'.btn-view').on('click', function () {
|
||||
$(() => {
|
||||
$(document).on('click', '.btn-view', function () {
|
||||
let pedidoId = $(this).data('id');
|
||||
let url = `/pedidos/view/${pedidoId}`;
|
||||
window.location.href = url;
|
||||
});
|
||||
|
||||
})
|
||||
@ -1,30 +1,93 @@
|
||||
<div th:fragment="pedido-linea (linea)">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<strong th:text="${linea.libro.titulo}">Título del libro</strong>
|
||||
<span class="text-muted" th:text="' - ' + #{pedido.linea.cantidad} + ': ' + ${linea.cantidad}"> - Cantidad: 1</span>
|
||||
<div th:fragment="pedido-linea (item, isAdmin)">
|
||||
<div class="mb-3">
|
||||
<div class="card p-3 mb-0">
|
||||
<div class="row g-3 align-items-start">
|
||||
<!-- Col 1: imagen -->
|
||||
<div class="col-auto">
|
||||
<div class="avatar-lg bg-light rounded p-1">
|
||||
<img th:src="${item.imagen != null ? item.imagen : '/assets/images/products/placeholder.png'}"
|
||||
alt="portada" class="img-fluid d-block rounded">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<p>
|
||||
<strong th:text="#{pedido.linea.precio-unitario} + ': '"></strong>
|
||||
<span th:text="${#numbers.formatDecimal(linea.precioUnitario, 1, 'COMMA', 2, 'POINT')} + ' €'">10,00 €</span>
|
||||
</p>
|
||||
<p>
|
||||
<strong th:text="#{pedido.linea.precio-total} + ': '"></strong>
|
||||
<span th:text="${#numbers.formatDecimal(linea.precioTotal, 1, 'COMMA', 2, 'POINT')} + ' €'">10,00 €</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-4 text-end">
|
||||
<img th:if="${linea.libro.imagenPortadaUrl != null}" th:src="${linea.libro.imagenPortadaUrl}" alt="Portada del libro" class="img-fluid" style="max-height: 150px;" />
|
||||
<div th:if="${linea.libro.imagenPortadaUrl == null}" class="text-muted" style="height: 150px; display: flex; align-items: center; justify-content: center; border: 1px dashed #ccc;">
|
||||
<span th:text="#{pedido.linea.sin-imagen}">Sin imagen</span>
|
||||
</div>
|
||||
|
||||
<!-- Col 2: detalles -->
|
||||
<div class="col">
|
||||
<h5 class="fs-18 text-truncate mb-1">
|
||||
<span class="text-dark"
|
||||
th:text="${item.titulo != null ? item.titulo : 'Presupuesto #'}">Presupuesto</span>
|
||||
</h5>
|
||||
<h5 class="fs-14 text-truncate mb-1">
|
||||
<span th:text="#{cart.item.presupuesto-numero}">Presupuesto #</span>
|
||||
<span th:text="${item.presupuestoId != null ? item.presupuestoId : ''}">#</span>
|
||||
<a th:href="@{|/presupuesto/edit/${item.presupuestoId}|}"
|
||||
th:text="#{pedido.view.view-presupuesto}" class="badge bg-secondary">Ver presupuesto</a>
|
||||
</h5>
|
||||
|
||||
<ul class="list-unstyled text-muted mb-1 ps-0">
|
||||
<li th:each="linea : ${item.resumen.lineas}" class="mb-1">
|
||||
<span th:utext="${linea['descripcion']}"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="list-unstyled text-muted mb-1" th:if="${item.resumen.servicios != null}">
|
||||
<li>
|
||||
<span th:utext="#{pdf.servicios-adicionales}">Servicios adicionales:</span>
|
||||
<span class="spec-label" th:text="${item.resumen.servicios}"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="list-unstyled text-muted mb-1"
|
||||
th:if="${item.resumen != null and #maps.containsKey(item.resumen,'datosMaquetacion') and item.resumen['datosMaquetacion'] != null}">
|
||||
<li class="spec-row mb-1">
|
||||
<span th:text="#{pdf.datos-maquetacion}">Datos de maquetación:</span>
|
||||
<span th:utext="${item.resumen.datosMaquetacion}"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="list-unstyled text-muted mb-1"
|
||||
th:if="${item.resumen != null and #maps.containsKey(item.resumen,'datosMarcapaginas') and item.resumen['datosMarcapaginas'] != null}">
|
||||
<li class="spec-row mb-1">
|
||||
<span th:text="#{pdf.datos-marcapaginas}">Datos de marcapáginas:</span>
|
||||
<span th:utext="${item.resumen.datosMarcapaginas}"></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Col 3: precio -->
|
||||
<div class="col-auto ms-auto text-end">
|
||||
<p class="text-muted mb-1" th:text="#{cart.precio}">Precio</p>
|
||||
<h5 class="fs-14 mb-0">
|
||||
<span th:text="${item.baseTotal != null ? item.total : '-'}">0,00</span>
|
||||
</h5>
|
||||
<p class="text-muted mt-4 mb-1" th:text="#{pedido.table.estado}">Estado</p>
|
||||
<h5 class="fs-14 mb-0">
|
||||
<span th:text="${item.estado != null} ?
|
||||
#{__${'pedido.estado.' + item.estado}__} : '-'">
|
||||
</span>
|
||||
</h5>
|
||||
<th:block th:if="${item.fechaEntrega != null and item.fechaEntrega != ''}">
|
||||
<p class="text-muted mt-4 mb-1" th:text="#{pedido.fecha-entrega}">Fecha de entrega</p>
|
||||
<h5 class="fs-14 mb-0">
|
||||
<span th:text="${item.fechaEntrega}">-</span>
|
||||
</h5>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:if="${isAdmin}" class="card-footer bg-light p-3">
|
||||
<div class="row align-items-center gy-3">
|
||||
<div class="col-sm">
|
||||
<div class="d-flex flex-wrap my-n1">
|
||||
<!-- Botón eliminar -->
|
||||
<div>
|
||||
<a href="javascript:void(0);" class="d-block text-body p-1 px-2 delete-item"
|
||||
th:attr="data-cart-item-id=${item.presupuestoId}">
|
||||
<i class="ri-delete-bin-fill text-muted align-bottom me-1"></i> Eliminar
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -23,16 +23,19 @@
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/"><i class="ri-home-5-fill"></i></a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page" th:text="#{pedido.module-title}">
|
||||
<li class="breadcrumb-item" aria-current="page" th:text="#{pedido.module-title}"><a
|
||||
href="/pedidos"></a>
|
||||
Pedidos</li>
|
||||
<li class="breadcrumb-item active" aria-current="page">
|
||||
<span th:text="#{pedido.pedido} + ' '">Pedido </span><span th:text="${id}"></span>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<th:block th:each="linea: ${pedidoLinea}">
|
||||
<div th:insert="~{imprimelibros/pedidos/pedidos-linea :: pedido-linea (linea=${linea})}"></div>
|
||||
<th:block th:each="linea: ${lineas}">
|
||||
<div th:insert="~{imprimelibros/pedidos/pedidos-linea :: pedido-linea (item=${linea}, isAdmin=${isAdmin})}"></div>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user