From 71a8f9e135feb957cdcb6c1953805b24fc427ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Tue, 9 Apr 2024 12:59:04 +0200 Subject: [PATCH 1/2] terminado a falta de arreglar el view --- .gitignore | 1 + .../Presupuestos/Cosidotapablanda.php | 2 +- ci4/app/Services/PresupuestoService.php | 2 +- .../cosidotapablanda/_datosLibroItems.js | 6 ++++ .../cosidotapablanda/_datosLibroItems.php | 29 ++++--------------- .../_datosPresupuestoClienteItems.php | 4 +-- 6 files changed, 16 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 08e5f6c6..2740fefd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ ci4/.env .vscode/ +xdebug.log \ No newline at end of file diff --git a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php index 6bdfefa3..c39c0f90 100755 --- a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php +++ b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php @@ -236,7 +236,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController $sanitizedData['solapas'] = 0; } if ($this->request->getPost('solapas_sobrecubierta') == null) { - $sanitizedData['solapas'] = 0; + $sanitizedData['solapas_sobrecubierta'] = 0; } $noException = true; diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php index c9afc8b1..8e2b199f 100755 --- a/ci4/app/Services/PresupuestoService.php +++ b/ci4/app/Services/PresupuestoService.php @@ -1749,7 +1749,7 @@ class PresupuestoService extends BaseService $linea = PresupuestoService::getLineaPresupuestoPlana($data); if ($tipo_impresion_id == 5 || $tipo_impresion_id == 6 || - $tipo_impresion_id == 7 || $tipo_impresion_id == 8) { + $tipo_impresion_id == 7 || $tipo_impresion_id == 8 || $tipo_impresion_id == 21) { if ($uso == 'cubierta'){ $linea['fields']['num_formas']['num_formas_horizontales'] *= 2; diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.js b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.js index 9ec619f3..edc64da4 100644 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.js +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.js @@ -2,6 +2,12 @@ $('#paginas').on("change", function () { const url2 = window.location.href; const url_parts2 = url2.split('/'); + + if($('#tipo_impresion_id').val() == 21){ + if(parseInt($('#paginas').val()) > 80){ + $('#paginas').val(80) + } + } if(url_parts2[url_parts2.length-2] == 'edit'){ diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.php index ad39064a..0111e9fb 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.php @@ -19,7 +19,7 @@ - + > @@ -110,7 +110,7 @@
- +
@@ -153,7 +153,7 @@
- + solapas_sobrecubierta == true): ?>
@@ -199,7 +199,7 @@
- +
-
- -
-
- - -
-
- -
+
diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php index d6e3c614..c6970f76 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php @@ -215,7 +215,7 @@
- +

@@ -246,7 +246,7 @@
-
+
From 1086d5f9c1c6e662acad01899b0f7d254e7d72f5 Mon Sep 17 00:00:00 2001 From: imnavajas Date: Tue, 9 Apr 2024 14:00:42 +0200 Subject: [PATCH 2/2] Arreglado preview grapado --- ci4/app/Services/PresupuestoService.php | 4 ++-- .../form/presupuestos/cosidotapablanda/previews.js | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php index 8e2b199f..4ba10898 100755 --- a/ci4/app/Services/PresupuestoService.php +++ b/ci4/app/Services/PresupuestoService.php @@ -1749,8 +1749,8 @@ class PresupuestoService extends BaseService $linea = PresupuestoService::getLineaPresupuestoPlana($data); if ($tipo_impresion_id == 5 || $tipo_impresion_id == 6 || - $tipo_impresion_id == 7 || $tipo_impresion_id == 8 || $tipo_impresion_id == 21) { - + $tipo_impresion_id == 7 || $tipo_impresion_id == 8) { + if ($uso == 'cubierta'){ $linea['fields']['num_formas']['num_formas_horizontales'] *= 2; $linea['fields']['num_formas']['value'] *= 2; diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js index f093d563..949079d0 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js @@ -1,5 +1,4 @@ // Global parameters -//var _isCosido = true; var pvObj; function previewInteriorPlana(lpTagName, isCosido, isTapaDura) { @@ -987,6 +986,12 @@ function getObjetoLP(lpName, _isCosido, _isTapaDura) { pvObj.anchoForma = ((2 * pvObj.anchoLibro) + (2 * (pvObj.anchoSolapa + offsetSolapaValor)) + (2 * sangre) + pvObj.lomoLibro); pvObj.altoForma += (2 * sangre); } + // Grapado + else if (pvObj.tipoImpresion === 21) { + let sangre = parseFloat(5); // mm + pvObj.anchoForma = ((2 * pvObj.anchoLibro) + (2 * (pvObj.anchoSolapa + offsetSolapaValor)) + (2 * sangre)); + pvObj.altoForma += (2 * sangre); + } // Espiral TD y TB, Wire-o TD y TB else if (pvObj.tipoImpresion === 5 || pvObj.tipoImpresion === 6 || pvObj.tipoImpresion === 7 || pvObj.tipoImpresion === 8) { @@ -1103,6 +1108,4 @@ function getVisibleTabs() { } } }); -} - - +} \ No newline at end of file