mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado lineas de presupuesto
This commit is contained in:
@ -336,7 +336,7 @@ class MaquinaModel extends \App\Models\GoBaseModel
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $tirada, $papel_impresion_id = -1)
|
||||
public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $uso_tarifa = 'interior', $tirada, $papel_impresion_id = -1)
|
||||
{
|
||||
/*
|
||||
1.-> tarifa_Tipo impresion
|
||||
@ -371,11 +371,12 @@ class MaquinaModel extends \App\Models\GoBaseModel
|
||||
|
||||
if(is_array($tarifa_tipo)){
|
||||
foreach($tarifa_tipo as $tarifa){
|
||||
$builder->where("EXISTS (SELECT * FROM lg_maquinas_tarifas_impresion t2 WHERE t1.id=t2.maquina_id AND t2.tipo='{$tarifa}' AND t2.is_deleted=0)");
|
||||
$builder->where("EXISTS (SELECT * FROM lg_maquinas_tarifas_impresion t2 WHERE t1.id=t2.maquina_id AND t2.tipo='{$tarifa}' AND t2.uso='{$uso_tarifa}' AND t2.is_deleted=0)");
|
||||
}
|
||||
}
|
||||
else{
|
||||
$builder->where("t2.tipo", $tarifa_tipo);
|
||||
$builder->where("t2.uso", $uso_tarifa);
|
||||
}
|
||||
|
||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||
|
||||
@ -93,7 +93,7 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
}
|
||||
|
||||
|
||||
public function getPapelForComparador($tipo, $is_cubierta = null, $is_sobrecubierta = null)
|
||||
public function getPapelForComparador($tipo, $is_cubierta = null, $is_sobrecubierta = null, $rotativa = null)
|
||||
{
|
||||
/*
|
||||
1.-> Tipo impresion
|
||||
@ -124,12 +124,19 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
$builder->where("t2.cubierta", 1);
|
||||
}
|
||||
}
|
||||
|
||||
if(!is_null($is_sobrecubierta)){
|
||||
if($is_sobrecubierta==true){
|
||||
$builder->where("t2.sobrecubierta", 1);
|
||||
}
|
||||
}
|
||||
|
||||
if(!is_null($rotativa)){
|
||||
if($rotativa==true){
|
||||
$builder->where("t2.rotativa", 1);
|
||||
}
|
||||
}
|
||||
|
||||
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
@ -162,15 +169,23 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
->where("t4.tipo", "impresion")
|
||||
->where("t5.tipo", $tipo)
|
||||
->where("t1.nombre", $papel_generico_nombre);
|
||||
|
||||
$uso_tarifa = 'interior';
|
||||
|
||||
if($uso == 'bn' || $uso == 'bnhq')
|
||||
$builder->where("t2.bn", 1);
|
||||
else if ($uso == 'color' || $uso == 'colorhq')
|
||||
$builder->where("t2.color", 1);
|
||||
else if ($uso == 'cubierta')
|
||||
else if ($uso == 'cubierta'){
|
||||
$uso_tarifa = 'cubierta';
|
||||
$builder->where("t2.cubierta", 1);
|
||||
else if ($uso == 'sobrecubierta')
|
||||
}
|
||||
else if ($uso == 'sobrecubierta'){
|
||||
$uso_tarifa = 'sobrecubierta';
|
||||
$builder->where("t2.sobrecubierta", 1);
|
||||
}
|
||||
|
||||
$builder->where("t5.uso", $uso_tarifa);
|
||||
|
||||
$values = $builder->orderBy("t2.gramaje", "asc")->get()->getResultObject();
|
||||
$id = 1;
|
||||
@ -209,18 +224,26 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
->where("t5.tipo", $tipo)
|
||||
->where("t1.id", $papel_generico_id);
|
||||
|
||||
$uso_tarifa = 'interior';
|
||||
|
||||
if($tipo == 'negro' || $tipo == 'negrohq')
|
||||
$builder->where("t2.bn", 1);
|
||||
else if ($tipo == 'color' || $tipo == 'colorhq')
|
||||
$builder->where("t2.color", 1);
|
||||
if ($uso == 'cubierta')
|
||||
if ($uso == 'cubierta'){
|
||||
$uso_tarifa = 'cubierta';
|
||||
$builder->where("t2.cubierta", 1);
|
||||
else if ($uso == 'sobrecubierta')
|
||||
}
|
||||
else if ($uso == 'sobrecubierta'){
|
||||
$uso_tarifa = 'sobrecubierta';
|
||||
$builder->where("t2.sobrecubierta", 1);
|
||||
}
|
||||
if($uso=='rotativa')
|
||||
$builder->where("t2.rotativa", 1);
|
||||
else
|
||||
$builder->where("t2.rotativa", 0);
|
||||
|
||||
$builder->where("t5.uso", $uso_tarifa);
|
||||
|
||||
|
||||
$values = $builder->orderBy("t2.gramaje", "asc")->get()->getResultObject();
|
||||
|
||||
@ -295,35 +295,7 @@ class PapelImpresionModel extends \App\Models\GoBaseModel
|
||||
$builder->where("t1.rotativa", 1);
|
||||
else
|
||||
$builder->where("t1.rotativa", 0);
|
||||
/*
|
||||
if($tipo=='negro' || $tipo=='negrohq'){
|
||||
$builder->where("t1.bn", 1);
|
||||
$builder->where("t1.rotativa", 0);
|
||||
}
|
||||
elseif($tipo=='color' || $tipo=='colorhq'){
|
||||
$builder->where("t1.color", 1);
|
||||
$builder->where("t1.rotativa", 0);
|
||||
}
|
||||
elseif($tipo=='cubierta'){
|
||||
$builder->where("t1.cubierta", 1);
|
||||
$builder->where("t1.color", 1);
|
||||
$builder->where("t1.rotativa", 0);
|
||||
}
|
||||
elseif($tipo=='sobrecubierta'){
|
||||
$builder->where("t1.sobrecubierta", 1);
|
||||
$builder->where("t1.color", 1);
|
||||
$builder->where("t1.rotativa", 0);
|
||||
}
|
||||
elseif($tipo=='rot_bn'){
|
||||
$builder->where("t1.bn", 1);
|
||||
$builder->where("t1.rotativa", 1);
|
||||
}
|
||||
elseif($tipo=='rot_color'){
|
||||
$builder->where("t1.color", 1);
|
||||
$builder->where("t1.rotativa", 1);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user