From 85318aa10ea6e4332691c3be2a9d0ffe22f1b7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Tue, 6 May 2025 16:18:32 +0200 Subject: [PATCH] terminado --- .../Controllers/Presupuestos/Presupuestocliente.php | 10 ++++++++++ ci4/app/Services/PresupuestoClienteService.php | 8 ++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ci4/app/Controllers/Presupuestos/Presupuestocliente.php b/ci4/app/Controllers/Presupuestos/Presupuestocliente.php index 9abe57a5..50813759 100755 --- a/ci4/app/Controllers/Presupuestos/Presupuestocliente.php +++ b/ci4/app/Controllers/Presupuestos/Presupuestocliente.php @@ -340,6 +340,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController if ($tirada[0] <= $POD && $cliente->forzar_rotativa_pod) { $forzarRotativa = true; } + else if ($tirada[0] <= $POD && !$cliente->forzar_rotativa_pod) { + $excluirRotativa = true; + } + $input_data = array( 'uso' => 'interior', @@ -768,6 +772,9 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController if ($tirada[0] <= $POD && $cliente->forzar_rotativa_pod) { $forzarRotativa = true; } + else if ($tirada[0] <= $POD && !$cliente->forzar_rotativa_pod) { + $excluirRotativa = true; + } $input_data = array( 'uso' => 'interior', @@ -2088,6 +2095,9 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController if ($tirada[$t] <= $POD && $cliente->forzar_rotativa_pod) { $forzarRotativa = true; } + else if ($tirada[0] <= $POD && !$cliente->forzar_rotativa_pod) { + $excluirRotativa = true; + } $input_data = array( 'uso' => 'interior', diff --git a/ci4/app/Services/PresupuestoClienteService.php b/ci4/app/Services/PresupuestoClienteService.php index 21dc68d1..bb702918 100755 --- a/ci4/app/Services/PresupuestoClienteService.php +++ b/ci4/app/Services/PresupuestoClienteService.php @@ -13,11 +13,15 @@ class PresupuestoClienteService extends BaseService { public static function obtenerInterior($data) { + $POD = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value; + $tirada = $data['datosPedido']->tirada; + + $isPoD = $POD >= $tirada; $rotativa = []; $plana = []; - // no se busca en plana cuando es estándar (no Premium) - if ($data['isHq']) + // no se busca en plana cuando es estándar (no Premium) excepto cuando es PoD + if ($data['isHq'] || $isPoD) $plana = PresupuestoClienteService::obtenerPresupuestoClienteInterior($data); if (!$data['excluirRotativa'] && !$data['isHq']) $rotativa = PresupuestoClienteService::obtenerPresupuestoClienteInteriorRotativa($data);