Merge branch 'fix/rotativa_cosido_cliente' into 'main'

solucionado problema

See merge request jjimenez/safekat!416
This commit is contained in:
2024-12-02 17:22:53 +00:00
2 changed files with 20 additions and 15 deletions

View File

@ -523,6 +523,11 @@ class PresupuestoClienteService extends BaseService
$linea_rotativa = array_merge($linea_rotativa, $lineas); $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) { if (count($linea_rotativa) > 0) {
usort( usort(

View File

@ -639,11 +639,11 @@ class PresupuestoService extends BaseService
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h1_temp); $calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h1_temp);
// Si son mas de 2 formas // Si son mas de 2 formas
if (count($calles) > 0) 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 else
$h1 = $h1_temp; $h1 = $h1_temp;
$v1 = floor($maquina->alto_click / $altoForCalculo); $v1 = floor(floatval($maquina->alto_click) / $altoForCalculo);
$formas_h = $h1 * $v1; //p1 $formas_h = $h1 * $v1; //p1
} }
// verticales // verticales
@ -651,10 +651,10 @@ class PresupuestoService extends BaseService
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h2_temp); $calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h2_temp);
if (count($calles) > 0) 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 else
$h2 = $h2_temp; $h2 = $h2_temp;
$v2 = floor($maquina->alto_click / $anchoForCalculo); $v2 = floor(floatval($maquina->alto_click) / $anchoForCalculo);
$formas_v = $h2 * $v2; //p2 $formas_v = $h2 * $v2; //p2
} }