corregido el tamaño maximo de solapas cuando se añade un presu

This commit is contained in:
2025-07-02 11:43:59 +02:00
parent 61d8dca583
commit d5c51f2063
2 changed files with 17 additions and 5 deletions

View File

@ -587,6 +587,8 @@ class DatosLibro {
this.actualizarLimitesPaginas();
}
this.calcularSolapas();
}
updateComparador() {

View File

@ -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;