From 130457f0effee5dae85aa2b9e8d88d5651907c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Thu, 9 Jan 2025 18:35:24 +0100 Subject: [PATCH] modificaciones --- .../Presupuestos/Presupuestocliente.php | 2 +- .../presupuestos/admin/_datosLibroItems.php | 12 +++--- .../presupuestoAdmin/sections/comparador.js | 1 + .../presupuestoAdmin/sections/datosLibro.js | 40 +++++++++++++++---- .../sections/lineasPresupuesto.js | 37 ++++++++++++----- 5 files changed, 67 insertions(+), 25 deletions(-) diff --git a/ci4/app/Controllers/Presupuestos/Presupuestocliente.php b/ci4/app/Controllers/Presupuestos/Presupuestocliente.php index 51618a82..b398a9fe 100755 --- a/ci4/app/Controllers/Presupuestos/Presupuestocliente.php +++ b/ci4/app/Controllers/Presupuestos/Presupuestocliente.php @@ -1561,7 +1561,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController return $data; } - protected function calcular_presupuesto($datos_entrada, $selected_tirada, $extra_info = false) + protected function calcular_presupuesto($datos_entrada, $selected_tirada, $extra_info = false) { try { $return_data = []; diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/admin/_datosLibroItems.php b/ci4/app/Views/themes/vuexy/form/presupuestos/admin/_datosLibroItems.php index de44d064..5da22f96 100644 --- a/ci4/app/Views/themes/vuexy/form/presupuestos/admin/_datosLibroItems.php +++ b/ci4/app/Views/themes/vuexy/form/presupuestos/admin/_datosLibroItems.php @@ -90,7 +90,7 @@
-
+
@@ -102,10 +102,10 @@
-
+
- +
@@ -128,7 +128,7 @@
-
+
@@ -137,11 +137,11 @@
-
+
- +
diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js index 55594748..bd357b73 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js @@ -243,6 +243,7 @@ class Comparador { this.papelSobrecubierta.onChange(() => this.gramajeSobrecubierta.setVal(0)) this.sobrecubierta.on('change', () => { if (this.sobrecubierta.val() == 1) { + $('#solapas_sobrecubierta').prop('checked', true); $('#compPapelSobrecubierta').prop('disabled', false); $('#compGramajeSobrecubierta').prop('disabled', false); } diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js index 0163ae69..44abc868 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js @@ -85,6 +85,17 @@ class DatosLibro { this.paginas.on('change', this.changePaginas.bind(this)); this.tirada.on('change', this.changeTirada.bind(this)); + + $('.formato-libro').on('change', function () { + $(document).trigger('update-lineas-presupuesto'); + /* TO-DO + updatePresupuesto({ + update_servicios: true, + update_envios: true, + update_resumen: true, + update_tiradas_alternativas: true + })*/ + }); } } @@ -161,9 +172,12 @@ class DatosLibro { this.checkPaginasPresupuesto(); + $('.tamanio-personalizado').addClass('d-none'); + + $(document).trigger('update-lineas-presupuesto'); + // TO-DO /*updatePresupuesto({ - update_lineas: true, update_servicios: true, update_envios: true, update_resumen: true, @@ -190,6 +204,7 @@ class DatosLibro { $("#label_papelFormatoId").text( window.language.Presupuestos.papelFormatoId + '*'); } + $(document).trigger('update-lineas-presupuesto'); } @@ -367,20 +382,31 @@ class DatosLibro { if ($('#tipo_impresion_id').val() == 1 || $('#tipo_impresion_id').val() == 3 || $('#tipo_impresion_id').val() == 5 || $('#tipo_impresion_id').val() == 7) { - $(".impresion-con-solapas").addClass('d-none'); + $(".solapas-cubierta-div").addClass('d-none'); } - else { + else{ if (datos.solapasCubierta) { this.solapasCubierta.prop('checked', true); this.anchoSolapasCubierta.val(datos.solapasCubiertaAncho); $('#div_solapas_ancho').removeClass('d-none'); } - if (datos.solapasSobrecubierta) { - this.solapasSobrecubierta.prop('checked', true); - this.anchoSolapasSobrecubierta.val(datos.solapasSobrecubiertaAncho); - $('#div_solapas_ancho_sobrecubierta').removeClass('d-none'); + else{ + this.solapasCubierta.prop('checked', false); + this.anchoSolapasCubierta.val(0); + $('#div_solapas_ancho').addClass('d-none'); } } + if (datos.solapasSobrecubierta) { + this.solapasSobrecubierta.prop('checked', true); + this.anchoSolapasSobrecubierta.val(datos.solapasSobrecubiertaAncho); + $('#div_solapas_ancho_sobrecubierta').removeClass('d-none'); + } + else{ + this.solapasSobrecubierta.prop('checked', false); + this.anchoSolapasSobrecubierta.val(0); + $('#div_solapas_ancho_sobrecubierta').addClass('d-none'); + } + this.acabadoCubierta.setOption(datos.acabadoCubierta.id, datos.acabadoCubierta.text); diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js index aa9ac944..8e68b1d6 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js @@ -37,7 +37,6 @@ class LineasPresupuesto { // TO-DO /*updatePresupuesto({ - update_lineas: false, update_servicios: true, update_envios: true, update_resumen: true, @@ -1464,6 +1463,10 @@ class LineasPresupuesto { cliente_id: $('#clienteId').find(":selected").val(), }; + if(datos.ancho==0 || datos.alto==0){ + return; + } + if (linea.includes('rot')) { if (fromComparador) { datos.paginas_negro = parseInt($('#compPaginasNegro').val()) @@ -1514,27 +1517,39 @@ class LineasPresupuesto { (response) => { if (response.lineas.length > 0) { - $.each(response.lineas, function (key, value) { + let borrar_linea = true; + // Si viene del comparador + if (Object.keys(input_data).length == 0) { + borrar_linea = false; + } + + for(let $i=0; $i