se modifican los item de los listados para que se abran en una nueva pestaña. Se añade un badge al carrito item para editar el presupuesto

This commit is contained in:
2026-02-14 11:19:07 +01:00
parent 014079cf04
commit 97ee53cefd
4 changed files with 7 additions and 5 deletions

View File

@ -71,7 +71,7 @@ $(() => {
// -----------------------------
$table.on('click', '.btn-view-factura', function () {
const row = dt.row($(this).closest('tr')).data();
window.location.href = `/facturas/${row.id}`;
window.open('/facturas/' + row.id, '_blank', 'noopener,noreferrer');
});
// -----------------------------

View File

@ -1,8 +1,8 @@
$(() => {
$(document).on('click', '.btn-view', function () {
let pedidoId = $(this).data('id');
let url = `/pedidos/view/${pedidoId}`;
window.location.href = url;
if(!pedidoId) return;
window.open('/pedidos/view/' + pedidoId, '_blank', 'noopener,noreferrer');
});
$(document).on('click', '.btn-pay', async function () {

View File

@ -72,7 +72,7 @@ import { preguntarTipoPresupuesto, duplicar, reimprimir } from './presupuesto-ut
e.preventDefault();
const id = $(this).data('id');
if (id) {
window.location.href = '/presupuesto/view/' + id;
window.open('/presupuesto/view/' + id, '_blank', 'noopener,noreferrer');
}
});
@ -196,7 +196,7 @@ import { preguntarTipoPresupuesto, duplicar, reimprimir } from './presupuesto-ut
e.preventDefault();
const id = $(this).data('id');
if (id) {
window.location.href = '/presupuesto/edit/' + id;
window.open('/presupuesto/edit/' + id, '_blank', 'noopener,noreferrer');
}
});

View File

@ -56,6 +56,8 @@
<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">