From 2df3f5914e41c6a1d1493e74e819fa78250555bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Mon, 27 Jan 2025 18:45:38 +0100 Subject: [PATCH] resueltos errores con la rotativa. Quitado retractilado de cubierta cliente y Ninguno por defecto en acabados --- .../Controllers/Presupuestos/Presupuestoadmin.php | 2 +- ci4/app/Language/es/Presupuestos.php | 2 ++ ci4/app/Services/PresupuestoService.php | 9 ++++++--- .../presupuestos/cliente/items/_disenioCubierta.php | 12 ++---------- httpdocs/assets/js/safekat/components/preview.js | 4 ++-- .../presupuestoAdmin/sections/lineasPresupuesto.js | 2 +- .../pages/presupuestoCliente/disenioCubierta.js | 7 ------- 7 files changed, 14 insertions(+), 24 deletions(-) diff --git a/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php b/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php index 0bed7c99..5872c216 100644 --- a/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php +++ b/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php @@ -857,7 +857,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController 'ancho' => intval($reqData['ancho']) ?? 100000, 'alto' => intval($reqData['alto']) ?? 100000, 'a_favor_fibra' => $reqData['a_favor_fibra'] ?? 1, - 'isCosido' => (new TipoPresupuestoModel())->get_isCosido($tipo_impresion_id), // JJO esto es custom por cada tipo de presupuesto + 'isCosido' => intval((new TipoPresupuestoModel())->get_isCosido($tipo_impresion_id)), // JJO esto es custom por cada tipo de presupuesto ); $papel_generico = [ diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php index 2a55273b..1c59d509 100755 --- a/ci4/app/Language/es/Presupuestos.php +++ b/ci4/app/Language/es/Presupuestos.php @@ -130,6 +130,8 @@ return [ 'estucadoMate170gr' => 'Estucado mate 170 gr', 'estucadoMate200gr' => 'Estucado mate 200 gr', + 'acabadoNinguno' => 'Ninguno', + 'fajaColor' => 'Imprimir faja a color', 'compInteriorPlana' => 'Interior en plana', 'compInteriorRotativa' => 'Interior en rotativa', diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php index 42ba10b2..255b2cad 100755 --- a/ci4/app/Services/PresupuestoService.php +++ b/ci4/app/Services/PresupuestoService.php @@ -522,12 +522,15 @@ class PresupuestoService extends BaseService $data['alto_click'] = $maquina->alto_click; + $direccion_fibra = ($parametrosRotativa->a_favor_fibra === "false" || $parametrosRotativa->a_favor_fibra === 0 || + $parametrosRotativa->a_favor_fibra === "0" || $parametrosRotativa->a_favor_fibra === false)? 0 : 1; + $formas = PresupuestoService::getNumFormasRot( $maquina, $datosPedido->ancho, $datosPedido->alto, $datosPedido->isCosido, - $parametrosRotativa->a_favor_fibra + $direccion_fibra ); $data['num_formas'] = $formas; @@ -541,7 +544,7 @@ class PresupuestoService extends BaseService public static function calculoDimForma($datosPedido, $parametros) { // posicionamos paginas en función de a favor de fibra o no - if (!$parametros->a_favor_fibra) { + if ($parametros->a_favor_fibra === "false" || $parametros->a_favor_fibra === 0 || $parametros->a_favor_fibra === "0" || $parametros->a_favor_fibra === false) { $anchoLibro = $datosPedido->alto; $altoLibro = $datosPedido->ancho; } else { @@ -551,7 +554,7 @@ class PresupuestoService extends BaseService // si es cosido ancho x 2 if ($datosPedido->isCosido) { - if (!$parametros->a_favor_fibra) { + if ($parametros->a_favor_fibra === "false" || $parametros->a_favor_fibra === 0 || $parametros->a_favor_fibra === "0" || $parametros->a_favor_fibra === false) { $altoLibro = $altoLibro * 2; } else { $anchoLibro = $anchoLibro * 2; diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php index 705495f1..34e3a455 100644 --- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php +++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php @@ -173,19 +173,10 @@
- -
- " - alt="Retractilado"> - -
- @@ -238,6 +229,7 @@ diff --git a/httpdocs/assets/js/safekat/components/preview.js b/httpdocs/assets/js/safekat/components/preview.js index 8f3744dc..543f68ef 100644 --- a/httpdocs/assets/js/safekat/components/preview.js +++ b/httpdocs/assets/js/safekat/components/preview.js @@ -207,7 +207,7 @@ class previewFormas { case 'rot_bn': case 'rot_color': // Conditional assignements depending on rotation of the printing shape - if (this.pvObj.orientacionFormas == 'v') { + if (this.pvObj.orientacionFormas != 'h') { let auxReg = this.pvObj.altoForma; this.pvObj.altoForma = this.pvObj.anchoForma; this.pvObj.anchoForma = auxReg; @@ -223,7 +223,7 @@ class previewFormas { case 'color': case 'colorhq': // Conditional assignements depending on rotation of the printing shape - if (this.pvObj.orientacionFormas == 'v') { + if (this.pvObj.orientacionFormas != 'h') { let auxReg = this.pvObj.altoForma; this.pvObj.altoForma = this.pvObj.anchoForma; this.pvObj.anchoForma = auxReg; diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js index 3418bfea..3888600a 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js @@ -1503,7 +1503,7 @@ class LineasPresupuesto { // Si es inkjet, existe este check if ($('#' + linea + '_aFavorFibra').length) { - datos.a_favor_fibra = $('#' + linea + '_aFavorFibra').prop('checked') + datos.a_favor_fibra = $('#' + linea + '_aFavorFibra').prop('checked') ? 1: 0; } if (updatedTipologias && $('#' + linea + '_gotaNegro').length) { diff --git a/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioCubierta.js b/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioCubierta.js index f06dee7a..67e673bd 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioCubierta.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioCubierta.js @@ -63,7 +63,6 @@ class DisenioCubierta { this.divGramajeCubierta = this.domItem.find("#divGramajeCubierta"); this.acabadoCubierta = this.domItem.find("#acabadoCubierta"); - this.cubiertaRetractilado = this.domItem.find("#retractilado"); this.configuracionSobrecubierta = this.domItem.find(".config-sobrecubierta"); this.sobrecubierta = this.domItem.find("#addSobrecubierta"); @@ -222,12 +221,6 @@ class DisenioCubierta { this.acabadoCubierta.setOption(datosCubierta.acabado.id, datosCubierta.acabado.text); - if (datosCubierta.retractilado) { - setTimeout(() => { - this.cubiertaRetractilado.trigger('click'); - }, 0); - } - if (datosSobrecubierta && datosSobrecubierta.papel) { this.sobrecubierta.trigger('click'); this.papelSobrecubierta.val(datosSobrecubierta.papel.code + "_" + datosSobrecubierta.gramaje).trigger('change');