trabajando en preciopliego2

This commit is contained in:
Jaime Jiménez
2023-09-25 14:31:44 +02:00
parent 089df469e7
commit 011ecca043
2 changed files with 10 additions and 7 deletions

View File

@ -336,7 +336,7 @@ class MaquinaModel extends \App\Models\GoBaseModel
->groupEnd(); ->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 1.-> tarifa_Tipo impresion
@ -362,7 +362,9 @@ class MaquinaModel extends \App\Models\GoBaseModel
->where("t2.is_deleted", 0) ->where("t2.is_deleted", 0)
->where("t2.tipo", $tarifa_tipo) ->where("t2.tipo", $tarifa_tipo)
->where("t3.papel_impresion_id", $papel_impresion_id) ->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(); return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
} }

View File

@ -15,10 +15,10 @@ class PresupuestoService extends BaseService
$uso = 'interior'; $uso = 'interior';
$tipo = 'negro'; $tipo = 'negro';
$cantidad = (object)array( $cantidad = (object)array(
'paginas' => 100, 'paginas' => 200,
'tirada' => 50, 'tirada' => 500,
'merma' => 5, 'merma' => 10,
'merma_portada' => 1, 'merma_portada' => 10,
); );
@ -45,7 +45,8 @@ class PresupuestoService extends BaseService
$maquinas = $maquina_model->getMaquinaImpresionForPresupuesto( $maquinas = $maquina_model->getMaquinaImpresionForPresupuesto(
is_rotativa: $papel->rotativa, is_rotativa: $papel->rotativa,
tarifa_tipo: 'negro', tarifa_tipo: 'negro',
papel_impresion_id: $papel->id papel_impresion_id: $papel->id,
tirada: $cantidad->tirada+$cantidad->merma
); );
echo '<pre>'; echo '<pre>';
echo '<p>Para papel impresion: ' . $papel->nombre . '</p>'; echo '<p>Para papel impresion: ' . $papel->nombre . '</p>';