diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js index e8386283..d0a609b9 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js @@ -587,6 +587,8 @@ class DatosLibro { this.actualizarLimitesPaginas(); } + + this.calcularSolapas(); } updateComparador() { diff --git a/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js b/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js index c9cfc5bf..f57552a8 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js @@ -135,10 +135,10 @@ class PresupuestoCliente { } - calcularSolapas() { + calcularSolapas(exclude_guardas = false) { /* Solapas Max */ - this.#getDatos(false, true); + this.#getDatos(false, true, exclude_guardas); if (Object.values(this.datos).every(this.#isValidDataForm)) { new Ajax('/presupuestocliente/calcularsolapas', this.datos, @@ -199,6 +199,7 @@ class PresupuestoCliente { if(!this.datosGenerales.validate(false)) { return; } + break; case 'interior-libro': @@ -372,6 +373,14 @@ class PresupuestoCliente { break; case 'interior-libro': + this.calcularSolapas(true); + this.btnPrev.removeClass('d-none'); + this.btnNext.removeClass('d-none'); + this.btnSave.removeClass('d-none'); + this.btnDuplicate.addClass('d-none'); + this.btnPrint.addClass('d-none'); + this.btnConfirm.addClass('d-none'); + break; case 'cubierta-libro': case 'direcciones-libro': this.btnPrev.removeClass('d-none'); @@ -623,9 +632,9 @@ class PresupuestoCliente { case 1: this.disenioInterior.validate(); + this.calcularSolapas(true); break; - case 2: this.disenioCubierta.validate(); break; @@ -695,7 +704,7 @@ class PresupuestoCliente { } - #getDatos(save = false, calcularSolapas = false) { + #getDatos(save = false, calcularSolapas = false, exclude_guardas = false) { this.datos = { @@ -725,7 +734,8 @@ class PresupuestoCliente { this.datos.selectedTirada = this.direcciones.getSelectedTirada(); } - this.datos.guardas = this.disenioCubierta.getGuardas(); + if(!exclude_guardas) + this.datos.guardas = this.disenioCubierta.getGuardas(); if (calcularSolapas) { return;