trabajando en lineas presupuesto eventos

This commit is contained in:
2024-12-31 12:37:16 +01:00
parent 1ccade47a3
commit 2231e943c7
11 changed files with 1130 additions and 276 deletions

View File

@ -330,7 +330,7 @@ class MaquinaModel extends \App\Models\BaseModel
->table($this->table . " t1")
->distinct('t1.id')
->select(
"t1.id AS maquina_id, t1.nombre AS maquina, t1.ancho_impresion AS ancho_impresion,
"t1.id AS id, t1.id AS maquina_id, t1.nombre AS maquina, t1.nombre AS nombre, t1.ancho_impresion AS ancho_impresion,
t1.alto_impresion AS alto_impresion, t1.ancho AS ancho, t1.alto AS alto,
t1.is_rotativa AS is_rotativa, t1.is_inkjet AS is_inkjet, t1.alto_click AS alto_click, t1.velocidad AS velocidad,
t1.precio_tinta_negro AS precio_tinta_negro, t1.precio_tinta_color AS precio_tinta_color, t1.precio_tinta_cg AS precio_tinta_cg,
@ -361,7 +361,7 @@ class MaquinaModel extends \App\Models\BaseModel
$builder->where("t2.uso", $uso_tarifa);
}
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
return $builder;
}

View File

@ -279,8 +279,15 @@ class PapelImpresionModel extends \App\Models\BaseModel
//tipo: negro, negrohq, color, colorhq
//uso: interior, rotativa, cubierta, sobrecubierta
public function getPapelesImpresionForMenu($papel_generico = null, $gramaje = null, $tipo = null, $uso = "")
{
public function getPapelesImpresionForMenu(
$papel_generico = null,
$gramaje = null,
$tipo = null,
$uso = "",
$tapaDura = false,
$forInkjet = false
) {
$builder = $this->db
->table($this->table . " t1")
->distinct("t1.id")
@ -289,7 +296,7 @@ class PapelImpresionModel extends \App\Models\BaseModel
->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"
"t1.id AS id, t1.nombre AS nombre"
);
$builder->where("t1.is_deleted", 0);
@ -304,24 +311,31 @@ class PapelImpresionModel extends \App\Models\BaseModel
$builder->where("t2.id", $papel_generico);
$builder->where("t1.gramaje", $gramaje);
if ($uso == 'cubierta')
if ($uso == 'cubierta') {
if ($tapaDura)
$builder->where("t1.use_for_tapa_dura", 1);
$builder->where("t1.cubierta", 1);
else if ($uso == 'sobrecubierta')
} else if ($uso == 'sobrecubierta')
$builder->where("t1.sobrecubierta", 1);
else if ($uso == 'guardas')
$builder->where("t1.guardas", 1);
else {
$builder->where("t1.interior", 1);
if ($tipo == 'negro' || $tipo == 'negrohq')
$builder->where("t1.bn", 1);
else if ($tipo == 'color' || $tipo == 'colorhq')
$builder->where("t1.color", 1);
}
if ($uso == 'rotativa')
if ($uso == 'rotativa') {
$builder->where("t1.rotativa", 1);
else
$builder->where("t4.is_rotativa", 1);
} else
$builder->where("t1.rotativa", 0);
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
if ($forInkjet)
$builder->where("t1.inkjet", 1);
return $builder;
}
public function getNombre($id)
@ -355,5 +369,5 @@ class PapelImpresionModel extends \App\Models\BaseModel
return "";
}
}