diff --git a/src/main/java/com/imprimelibros/erp/presupuesto/service/PresupuestoService.java b/src/main/java/com/imprimelibros/erp/presupuesto/service/PresupuestoService.java index fe2fbb3..a37deb2 100644 --- a/src/main/java/com/imprimelibros/erp/presupuesto/service/PresupuestoService.java +++ b/src/main/java/com/imprimelibros/erp/presupuesto/service/PresupuestoService.java @@ -361,7 +361,16 @@ public class PresupuestoService { body.put("paginasCuadernillo", SK_PAGINAS_CUADERNILLO); body.put("interior", interior); body.put("cubierta", cubierta); - body.put("guardas", null); + if(presupuesto.getTipoCubierta() != Presupuesto.TipoCubierta.tapaBlanda) { + Map guardas = new HashMap<>(); + guardas.put("papel", presupuesto.getPapelGuardasId()); + guardas.put("gramaje", presupuesto.getGramajeGuardas()); + guardas.put("caras", presupuesto.getGuardasImpresas()); + body.put("guardas", guardas); + } + else{ + body.put("guardas", null); + } // Para las reimpresiones if (presupuesto.getIsReimpresion() != null && presupuesto.getIsReimpresion()) { body.put("reimpresion", 1); diff --git a/src/main/resources/static/assets/js/pages/imprimelibros/presupuestador/wizard.js b/src/main/resources/static/assets/js/pages/imprimelibros/presupuestador/wizard.js index eb5b5b2..448b096 100644 --- a/src/main/resources/static/assets/js/pages/imprimelibros/presupuestador/wizard.js +++ b/src/main/resources/static/assets/js/pages/imprimelibros/presupuestador/wizard.js @@ -1143,37 +1143,7 @@ export default class PresupuestoWizard { ******************************/ #initCubierta() { - this.btn_plantilla_cubierta.on('click', () => { - let url = `/presupuesto/api/plantilla-cubierta.png - ?tipo=${this.formData.datosGenerales.tipoEncuadernacion} - &tapa=${this.formData.cubierta.tipoCubierta} - &ancho=${this.formData.datosGenerales.ancho} - &alto=${this.formData.datosGenerales.alto} - &lomo=${Math.round(this.formData.lomo) || 0} - &solapas=${this.formData.cubierta.solapasCubierta == 1 ? this.formData.cubierta.tamanioSolapasCubierta : 0}`; - url = url.trim().replace(/\s+/g, ''); - Swal.fire({ - position: 'top-end', - icon: 'info', - title: window.languageBundle.get('presupuesto.plantilla-cubierta'), - html: ` -
- -
-
- ${window.languageBundle.get('presupuesto.plantilla-cubierta-text')} -
- `, - confirmButtonClass: 'btn btn-primary w-xs mt-2', - showConfirmButton: false, - showCloseButton: true, - buttonsStyling: false, - customClass: { - confirmButton: 'btn btn-secondary me-2', // clases para el botón confirmar - cancelButton: 'btn btn-light' // clases para cancelar - }, - }); - }); + $('#btn-plantilla-cubierta').on('click', this.#obtener_plantilla_cubierta.bind(this)); this.btn_impresion_cubierta_help.on('click', () => { Swal.fire({ @@ -1928,6 +1898,7 @@ export default class PresupuestoWizard { #initResumen() { const $row = $('#presupuesto-row'); + $('#btn-plantilla-cubierta2').on('click', this.#obtener_plantilla_cubierta.bind(this)); // 1) Transición al cambiar de pestaña (click o programático) $(document).on('shown.bs.tab', '.custom-nav .nav-link', (e) => { const targetSelector = $(e.target).data('bs-target'); // ej: "#pills-resumen" @@ -2013,6 +1984,37 @@ export default class PresupuestoWizard { /****************************** * END RESUMEN ******************************/ + #obtener_plantilla_cubierta() { + let url = `/presupuesto/api/plantilla-cubierta.png + ?tipo=${this.formData.datosGenerales.tipoEncuadernacion} + &tapa=${this.formData.cubierta.tipoCubierta} + &ancho=${this.formData.datosGenerales.ancho} + &alto=${this.formData.datosGenerales.alto} + &lomo=${Math.round(this.formData.lomo) || 0} + &solapas=${this.formData.cubierta.solapasCubierta == 1 ? this.formData.cubierta.tamanioSolapasCubierta : 0}`; + url = url.trim().replace(/\s+/g, ''); + Swal.fire({ + position: 'top-end', + icon: 'info', + title: window.languageBundle.get('presupuesto.plantilla-cubierta'), + html: ` +
+ +
+
+ ${window.languageBundle.get('presupuesto.plantilla-cubierta-text')} +
+ `, + confirmButtonClass: 'btn btn-primary w-xs mt-2', + showConfirmButton: false, + showCloseButton: true, + buttonsStyling: false, + customClass: { + confirmButton: 'btn btn-secondary me-2', // clases para el botón confirmar + cancelButton: 'btn btn-light' // clases para cancelar + }, + }); + } } diff --git a/src/main/resources/templates/imprimelibros/presupuestos/presupuestador-items/_resumen_final.html b/src/main/resources/templates/imprimelibros/presupuestos/presupuestador-items/_resumen_final.html index 4bcd3c5..189bba2 100644 --- a/src/main/resources/templates/imprimelibros/presupuestos/presupuestador-items/_resumen_final.html +++ b/src/main/resources/templates/imprimelibros/presupuestos/presupuestador-items/_resumen_final.html @@ -21,7 +21,7 @@
-