From fe65a7ad1cd669e88bf83ce031ea19fe7e449961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Thu, 22 Feb 2024 14:52:39 +0100 Subject: [PATCH 1/2] =?UTF-8?q?a=C3=B1adidos=207mm=20en=20el=20lomo=20para?= =?UTF-8?q?=20tapadura?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presupuestos/Cosidotapablanda.php | 2 ++ ci4/app/Services/PresupuestoService.php | 16 ++++++++++++++-- .../presupuestos/cosidotapablanda/previews.js | 5 +++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php index 0fc99f1a..98550eed 100755 --- a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php +++ b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php @@ -792,6 +792,8 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController $tarifamodel = new MaquinasTarifasImpresionModel(); [$tarifaId, $tarifa] = $tarifamodel->getTarifa($maquina->maquina_id, ($uso=='guardas')?'interior':$uso, $tipo); + // Generates a message like: User 123 logged into the system from 127.0.0.1 + if(!is_float($tarifa)){ continue; } diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php index 83c7f2c6..b8ef70be 100755 --- a/ci4/app/Services/PresupuestoService.php +++ b/ci4/app/Services/PresupuestoService.php @@ -390,6 +390,17 @@ class PresupuestoService extends BaseService } $altoForCalculo = $alto; + /* + Log ancho y alto de impresion y libro + $info = [ + 'ancho' => $anchoForCalculo, + 'alto' => $altoForCalculo, + 'maquina_ancho' => $maquina->ancho_impresion, + 'maquina_alto' => $maquina->alto_impresion, + ]; + + if($uso == 'cubierta' ) + log_message('error', 'ancho:{ancho} --- alto:{alto} --- ancho2:{maquina_ancho} --- alto2:{maquina_alto} ---', $info);*/ if($uso == 'cubierta' || $uso == 'sobrecubierta') { if(property_exists($maquina, 'forzar_num_formas_horizontales_cubierta') && @@ -565,12 +576,13 @@ class PresupuestoService extends BaseService $ancho_total = floatval($datosPedido->ancho)*2 + floatval($datosPedido->lomo); // si es cubierta // Se añaden 20mm de sangre por cada lado + 2 * 6mm de vuelo portada y contraportada -> total 52 + // por último se añaden 7mm para tener en cuenta el ancho del carton if($uso=="cubierta") - $ancho_total += (12+2*self::SANGRE_FORMAS_CUBIERTA); + $ancho_total += (12 + 2*self::SANGRE_FORMAS_CUBIERTA + 7); // si es sobrecubierta // Se añaden 5mm de sangre por cada lado + 2 * 6mm de vuelo portada y contraportada -> total 52 else - $ancho_total += (12+2*self::SANGRE_FORMAS); + $ancho_total += (12+2*self::SANGRE_FORMAS) + 7; } else{ // En cualquier otro caso se le suma 5mm de sangre por cada lado 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 beb26eda..fb763f10 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 @@ -200,6 +200,7 @@ function portadaTapaDura(lpTagName, isCosido, isTapaDura) { let sangradoValor = parseFloat(20); // mm let anchoPliegue = parseFloat(6); // mm let altoPliegue = parseFloat(7); // mm + let anchoCarton = parseFloat(7); // mm // Get the preview Object parameters getObjetoLP(lpTagName, isCosido, isTapaDura); @@ -306,12 +307,12 @@ function portadaTapaDura(lpTagName, isCosido, isTapaDura) { previewEC.makeText(sangradoTexto, origenEC.x + (lomoLibro / 2 + anchoLibro + 13), origenEC.y, styleSangrado).rotation = -Math.PI / 2; previewEC.makeText(sangradoTexto, origenEC.x - (lomoLibro / 2 + anchoLibro + 13), origenEC.y, styleSangrado).rotation = -Math.PI / 2; // Cotas - previewEC.makeText(pvObj.lomoLibro + " mm", origenEC.x, origenEC.y + (altoLibro / 3) + 15, styleCotas); + previewEC.makeText(pvObj.lomoLibro + anchoCarton + " mm", origenEC.x, origenEC.y + (altoLibro / 3) + 15, styleCotas); previewEC.makeText(pvObj.anchoLibro + anchoPliegue + " mm", origenEC.x - (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas); previewEC.makeText(pvObj.anchoLibro + anchoPliegue + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas); previewEC.makeText(pvObj.altoLibro + altoPliegue + " mm", origenEC.x + (lomoLibro / 2) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2; previewEC.makeText(pvObj.altoLibro + (2 * sangradoValor) + altoPliegue + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2; - previewEC.makeText((2 * pvObj.anchoLibro) + pvObj.lomoLibro + (2 * sangradoValor) + +(2 * anchoPliegue) + " mm", + previewEC.makeText((2 * pvObj.anchoLibro) + pvObj.lomoLibro + (2 * sangradoValor) + +(2 * anchoPliegue) + anchoCarton + " mm", origenEC.x, origenEC.y + (altoLibro / 2) + 50, styleCotas); From 2d6d5e3d9fdc0ec45fc5f2b2ddb588c30a79f4bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= <“jaimejimenezortega@gmail.com”> Date: Thu, 22 Feb 2024 18:16:18 +0100 Subject: [PATCH 2/2] quitado el error del alto en el calculo de formas de cubierta y sobrecubierta --- ci4/app/Services/PresupuestoService.php | 62 ++++++++++++------------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php index b8ef70be..fd4ade80 100755 --- a/ci4/app/Services/PresupuestoService.php +++ b/ci4/app/Services/PresupuestoService.php @@ -458,51 +458,47 @@ class PresupuestoService extends BaseService $num_formas = $isCosido ? $num_formas * 2 : $num_formas; } else if ($forzar_a_favor_fibra){ + $num_formas = $formas_h; $num_formas = $isCosido ? $num_formas * 2 : $num_formas; } - else{ - $num_formas = $h1*$h2; + else{ + + $num_formas = $h1*$v1; } - /* - if($uso=='interior'){ - $info = [ - 'h1' => $h2_temp, - 'v1' => $alto, - 'h2' => $h2, - 'v2' => $v2, - 'num_formas' => $num_formas - ]; - - log_message('error', 'h1:{h1}, v1:{v1}, h2:{h2}, v2:{v2}, numFormas:{num_formas}', $info); - }*/ - // si no hay formas se devuelve n/a if ($num_formas == 0) { $response['num_formas']['posicion_formas'] = 'n/a'; // not available - } else if ($formas_h > $formas_v || $forzar_a_favor_fibra) { - $response['num_formas']['posicion_formas'] = 'h'; - $response['num_formas']['num_formas_horizontales'] = $h1; - $response['num_formas']['num_formas_verticales'] = $v1; - $response['num_formas']['value'] = $num_formas; - } else { - $response['num_formas']['posicion_formas'] = 'v'; - $response['num_formas']['num_formas_horizontales'] = $h2; - $response['num_formas']['num_formas_verticales'] = $v2; - $response['num_formas']['value'] = $num_formas; + } + else{ + if ($formas_h > $formas_v || $forzar_a_favor_fibra && $formas_h != 0) { + $response['num_formas']['posicion_formas'] = 'h'; + $response['num_formas']['num_formas_horizontales'] = $h1; + $response['num_formas']['num_formas_verticales'] = $v1; + $response['num_formas']['value'] = $num_formas; + } + else { + if($formas_v != 0){ + $response['num_formas']['posicion_formas'] = 'v'; + $response['num_formas']['num_formas_horizontales'] = $h2; + $response['num_formas']['num_formas_verticales'] = $v2; + $response['num_formas']['value'] = $num_formas; + } + } + + if(($uso == 'cubierta' || $uso == 'sobrecubierta') && $num_formas>0) { + if(property_exists($maquina, 'forzar_num_formas_horizontales_cubierta') && + property_exists($maquina, 'forzar_num_formas_horizontales_cubierta')){ + $response['num_formas']['num_formas_verticales'] = $h2_temp; + } + } + + } - if($uso == 'cubierta' || $uso == 'sobrecubierta') { - if(property_exists($maquina, 'forzar_num_formas_horizontales_cubierta') && - property_exists($maquina, 'forzar_num_formas_horizontales_cubierta')){ - - $response['num_formas']['num_formas_verticales'] = $h2; - } - } - return $response; }