linea de presupuesto bn funcionando a falta de borrar

This commit is contained in:
Jaime Jiménez Ortega
2023-11-06 09:11:05 +01:00
parent 876d763abd
commit 71706158ca
8 changed files with 425 additions and 437 deletions

View File

@ -255,6 +255,76 @@ class PapelImpresionModel extends \App\Models\GoBaseModel
$builder->where("t1.rotativa", $rotativa);
}
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
//tipo: negro, negrohq, color, colorhq
//uso: interior, rotativa, cubierta, sobrecubierta
public function getPapelesImpresionForMenu($papel_generico = null, $gramaje = null, $tipo = null, $uso=""){
$builder = $this->db
->table($this->table . " t1")
->distinct("t1.id")
->join("lg_papel_generico t2", "t1.papel_generico_id = t2.id", "left")
->join("lg_maquina_papel_impresion t3", "t1.id = t3.papel_impresion_id", "left")
->join("lg_maquinas t4", "t3.maquina_id = t4.id", "left")
->join("lg_maquinas_tarifas_impresion t5", "t4.id = t5.maquina_id", "left")
->select(
"t1.id AS id, t1.nombre AS text");
$builder->where("t1.is_deleted", 0);
$builder->where("t1.isActivo", 1);
$builder->where("t2.is_deleted", 0);
$builder->where("t3.active", 1);
$builder->where("t4.is_deleted", 0);
$builder->where("t4.tipo", 'impresion');
$builder->where("t5.is_deleted", 0);
$builder->where("t5.tipo", $tipo);
$builder->where("t2.id", $papel_generico);
$builder->where("t1.gramaje", $gramaje);
if($tipo == 'negro' || $tipo == 'negrohq')
$builder->where("t1.bn", 1);
else if ($tipo == 'color' || $tipo == 'colorhq')
$builder->where("t1.color", 1);
if ($uso == 'cubierta')
$builder->where("t1.cubierta", 1);
else if ($uso == 'sobrecubierta')
$builder->where("t1.sobrecubierta", 1);
if($uso=='rotativa')
$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();
}
}