From 6eb4446affe3edad2cb0a7f5844511ec267c169f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Mon, 2 Dec 2024 18:22:26 +0100 Subject: [PATCH] solucionado problema --- .../Services/PresupuestoClienteService.php | 5 ++++ ci4/app/Services/PresupuestoService.php | 30 +++++++++---------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/ci4/app/Services/PresupuestoClienteService.php b/ci4/app/Services/PresupuestoClienteService.php index 000a27e3..d066937d 100644 --- a/ci4/app/Services/PresupuestoClienteService.php +++ b/ci4/app/Services/PresupuestoClienteService.php @@ -523,6 +523,11 @@ class PresupuestoClienteService extends BaseService $linea_rotativa = array_merge($linea_rotativa, $lineas); } } + + $linea_rotativa = array_filter($linea_rotativa, function($item) { + return count($item['fields']['num_formas']) > 1; + }); + if (count($linea_rotativa) > 0) { usort( diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php index 1aba14fd..a9495780 100755 --- a/ci4/app/Services/PresupuestoService.php +++ b/ci4/app/Services/PresupuestoService.php @@ -639,11 +639,11 @@ class PresupuestoService extends BaseService $calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h1_temp); // Si son mas de 2 formas if (count($calles) > 0) - $h1 = ($h1_temp * $anchoForCalculo + 2 * $calles[0]->externas + ($h1_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h1_temp : $h1_temp - 1; + $h1 = ($h1_temp * $anchoForCalculo + 2 * $calles[0]->externas + ($h1_temp - 1) * $calles[0]->internas < (floatval($maquina->ancho))) ? $h1_temp : $h1_temp - 1; else $h1 = $h1_temp; - $v1 = floor($maquina->alto_click / $altoForCalculo); + $v1 = floor(floatval($maquina->alto_click) / $altoForCalculo); $formas_h = $h1 * $v1; //p1 } // verticales @@ -651,10 +651,10 @@ class PresupuestoService extends BaseService $calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h2_temp); if (count($calles) > 0) - $h2 = ($h2_temp * $altoForCalculo + 2 * $calles[0]->externas + ($h2_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h2_temp : $h2_temp - 1; + $h2 = ($h2_temp * $altoForCalculo + 2 * $calles[0]->externas + ($h2_temp - 1) * $calles[0]->internas < (floatval($maquina->ancho))) ? $h2_temp : $h2_temp - 1; else $h2 = $h2_temp; - $v2 = floor($maquina->alto_click / $anchoForCalculo); + $v2 = floor(floatval($maquina->alto_click) / $anchoForCalculo); $formas_v = $h2 * $v2; //p2 } @@ -1061,16 +1061,16 @@ class PresupuestoService extends BaseService ), 'cliente_id' => ($input_data['presupuesto'])->cliente_id, 'datosTipolog' => [ - (object) array( - 'negro' => $linea->rotativa_negro, - 'cyan' => $linea->rotativa_cyan, - 'magenta' => $linea->rotativa_magenta, - 'amarillo' => $linea->rotativa_amarillo, - 'cg' => $linea->rotativa_cg, - 'gota_negro' => $linea->rotativa_gota_negro, - 'gota_color' => $linea->rotativa_gota_color, - ) - ] + (object) array( + 'negro' => $linea->rotativa_negro, + 'cyan' => $linea->rotativa_cyan, + 'magenta' => $linea->rotativa_magenta, + 'amarillo' => $linea->rotativa_amarillo, + 'cg' => $linea->rotativa_cg, + 'gota_negro' => $linea->rotativa_gota_negro, + 'gota_color' => $linea->rotativa_gota_color, + ) + ] ]; $comp_data = PresupuestoService::obtenerComparadorRotativa($datos); @@ -1816,7 +1816,7 @@ class PresupuestoService extends BaseService } if ($uso == 'cubierta' || $uso == 'sobrecubierta') { - + $linea['fields']['dimension_desarrollo']['ancho'] = $datosPedido->anchoExteriores; $linea['fields']['dimension_desarrollo']['alto'] = $datosPedido->altoExteriores; }