From 011ecca0435798d8f9067ebdd07a2d282e859c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Mon, 25 Sep 2023 14:31:44 +0200 Subject: [PATCH] trabajando en preciopliego2 --- ci4/app/Models/Configuracion/MaquinaModel.php | 6 ++++-- ci4/app/Services/PresupuestoService.php | 11 ++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ci4/app/Models/Configuracion/MaquinaModel.php b/ci4/app/Models/Configuracion/MaquinaModel.php index 9b5d82e4..140774fc 100644 --- a/ci4/app/Models/Configuracion/MaquinaModel.php +++ b/ci4/app/Models/Configuracion/MaquinaModel.php @@ -336,7 +336,7 @@ class MaquinaModel extends \App\Models\GoBaseModel ->groupEnd(); } - public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $papel_impresion_id = -1) + public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $tirada, $papel_impresion_id = -1) { /* 1.-> tarifa_Tipo impresion @@ -362,7 +362,9 @@ class MaquinaModel extends \App\Models\GoBaseModel ->where("t2.is_deleted", 0) ->where("t2.tipo", $tarifa_tipo) ->where("t3.papel_impresion_id", $papel_impresion_id) - ->where("t3.active", 1); + ->where("t3.active", 1) + ->where("t1.min <=", $tirada) + ->where("t1.max >=", $tirada); return $builder->orderBy("t1.id", "asc")->get()->getResultObject(); } diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php index dbce4497..f35a5800 100644 --- a/ci4/app/Services/PresupuestoService.php +++ b/ci4/app/Services/PresupuestoService.php @@ -15,10 +15,10 @@ class PresupuestoService extends BaseService $uso = 'interior'; $tipo = 'negro'; $cantidad = (object)array( - 'paginas' => 100, - 'tirada' => 50, - 'merma' => 5, - 'merma_portada' => 1, + 'paginas' => 200, + 'tirada' => 500, + 'merma' => 10, + 'merma_portada' => 10, ); @@ -45,7 +45,8 @@ class PresupuestoService extends BaseService $maquinas = $maquina_model->getMaquinaImpresionForPresupuesto( is_rotativa: $papel->rotativa, tarifa_tipo: 'negro', - papel_impresion_id: $papel->id + papel_impresion_id: $papel->id, + tirada: $cantidad->tirada+$cantidad->merma ); echo '
';
             echo '

Para papel impresion: ' . $papel->nombre . '

';