From beefc2f416f8c7b8907bf30e68dc2aecfeeffe4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Wed, 18 Jun 2025 09:29:16 +0200 Subject: [PATCH] arreglado resumen de cliente y mensaje de cubierta sin plastificado --- .../form/presupuestos/cliente/items/_resumen.php | 2 +- .../pages/presupuestoCliente/presupuestoCliente.js | 4 +++- .../js/safekat/pages/presupuestoCliente/resumen.js | 11 ++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_resumen.php b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_resumen.php index fa41104b..576cc2e1 100755 --- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_resumen.php +++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_resumen.php @@ -5,7 +5,7 @@
Precio unidad:
-

Total base:

+

Total base:

Envío:

Total antes de I.V.A:

Iva (%):

diff --git a/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js b/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js index 816baa6e..23ad3216 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js @@ -548,7 +548,9 @@ class PresupuestoCliente { const skAlert = document.getElementById('sk-alert'); skAlert.innerHTML = ''; - if (this.datos.cubierta && this.datos.cubierta.acabado && this.datos.cubierta.acabado > 0) { + const acabadoCubierta = this.disenioCubierta.getAcabados(); + + if (acabadoCubierta && acabadoCubierta != null && acabadoCubierta > 0) { $('#alert-cubierta-sin-acabado').addClass('d-none'); } diff --git a/httpdocs/assets/js/safekat/pages/presupuestoCliente/resumen.js b/httpdocs/assets/js/safekat/pages/presupuestoCliente/resumen.js index 031b08fb..aab86616 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoCliente/resumen.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoCliente/resumen.js @@ -352,26 +352,27 @@ class Resumen { let envios = tarjetaPrecio.find('.tarjeta-tiradas-precios-envio').val(); - this.total_envios.text(this.#changeDecimalFormat(parseFloat(envios).toFixed(2))); + this.total_envios.text(this.#changeDecimalFormat(parseFloat(envios || 0).toFixed(2))); let precio_u_text = tarjetaPrecio.find('.tarjeta-tiradas-precios-precio-unidad').text(); precio_u_text = precio_u_text.replace('€/ud', ''); const base = tarjetaPrecio.find('.tarjeta-tiradas-precios-precio').attr('data'); - let base_text = this.#changeDecimalFormat(parseFloat(base).toFixed(2)); + let base_text = this.#changeDecimalFormat(parseFloat(base || 0).toFixed(2)); - const total_antes_iva_text = this.#changeDecimalFormat((parseFloat(base) + parseFloat(envios)).toFixed(2)); + const total_antes_iva_text = this.#changeDecimalFormat((parseFloat(base || 0) + parseFloat(envios || 0)).toFixed(2)); const iva_porcentaje = parseInt(this.datosGenerales.ivaReducido.find('option:selected').val()) == 1 ? 0.04 : 0.21; - const iva = ((parseFloat(base) + parseFloat(envios)) * iva_porcentaje).toFixed(2); + const iva = ((parseFloat(base || 0) + parseFloat(envios || 0)) * iva_porcentaje).toFixed(2); let iva_text = this.#changeDecimalFormat(iva); - const total = (parseFloat(base) + parseFloat(envios) + parseFloat(iva)).toFixed(2); + const total = (parseFloat(base || 0) + parseFloat(envios || 0) + parseFloat(iva || 0)).toFixed(2); let total_text = this.#changeDecimalFormat(total); this.precio_unidad.text(precio_u_text); this.total_base.text(base_text); + this.total_antes_iva.text(total_antes_iva_text); this.iva_porcentaje.text(this.datosGenerales.ivaReducido.find('option:selected').val() == 1 ? '4' : '21'); this.iva.text(iva_text); this.total.text(total_text);