terminada faja

This commit is contained in:
2025-02-02 21:10:29 +01:00
parent 27c1e511b3
commit b4fa79cc5c
19 changed files with 384 additions and 72 deletions

View File

@ -112,8 +112,9 @@ class TarifaManipuladoModel extends \App\Models\BaseModel
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
}
public function getTarifaPresupuestoManipulado($tarifa_id, $tirada){
public function getTarifaPresupuestoManipulado($tarifa_id, $tirada)
{
$builder = $this->db
->table($this->table . " t1")
->select(
@ -125,15 +126,22 @@ class TarifaManipuladoModel extends \App\Models\BaseModel
->where("t1.is_deleted", 0)
//->where("t1.mostrar_en_presupuesto", 1)
->where("t2.is_deleted", 0);
$builder->where('t1.id =', $tarifa_id);
// check if tarifa_id is an array
if (is_array($tarifa_id)) {
// check if tarifa_id['id'] exists
$builder->where('t1.id', array_key_exists('id', $tarifa_id)? $tarifa_id['id']:$tarifa_id['tarifa_id']);
} else {
$builder->where('t1.id', $tarifa_id);
}
$builder->where('t2.tirada_min <=', $tirada);
$builder->where('t2.tirada_max >=', $tirada);
return $builder->get()->getResultObject();
}
public function getNombreTarifaManipulado($id=-1)
public function getNombreTarifaManipulado($id = -1)
{
/*
Todos los servicios de encuadernacion activas que se pueden usar en presupuestos
@ -142,9 +150,13 @@ class TarifaManipuladoModel extends \App\Models\BaseModel
->table($this->table . " t1")
->select(
"t1.nombre AS nombre"
)
->where("t1.id", $id)
->where("t1.is_deleted", 0);
);
$builder->where("t1.is_deleted", 0);
if (is_array($id)) {
$builder->where("t1.id", $id['id']);
} else
$builder->where("t1.id", $id);
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
}