lp en edit terminadas

This commit is contained in:
Jaime Jiménez Ortega
2023-11-14 08:21:34 +01:00
parent 2f38df4886
commit e12913c2a0
13 changed files with 394 additions and 140 deletions

View File

@ -380,5 +380,17 @@ class MaquinaModel extends \App\Models\GoBaseModel
}
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
public function getNombre($id){
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.nombre AS text");
$builder->where("t1.id", $id);
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
}

View File

@ -124,7 +124,7 @@ class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.precio AS precio"
"t1.id AS id, t1.precio AS precio"
);
//JJO
@ -135,7 +135,7 @@ class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
$tarifas = $builder->get()->getResultArray();
if (count($tarifas)>0){
return floatval($tarifas[0]['precio']);
return [$tarifas[0]['id'], floatval($tarifas[0]['precio'])];
}
return $tarifas;
}

View File

@ -300,4 +300,15 @@ class PapelImpresionModel extends \App\Models\GoBaseModel
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
public function getNombre($id){
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.nombre AS text");
$builder->where("t1.id", $id);
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
}

View File

@ -69,6 +69,8 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
"rotativa_tiempo_corte",
"rotativa_precio_hora_corte",
"rotativa_total_corte",
'check_impresion_total',
'check_papel_total',
"isActiva",
];
protected $returnType = "App\Entities\Presupuestos\PresupuestoLineaEntity";
@ -313,9 +315,6 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
public function getLineasPresupuesto($presupuesto_id = -1)
{
/*
Todos los servicios de manipulado activas que se pueden usar en presupuestos
*/
$builder = $this->db
->table($this->table . " t1")
->select(
@ -327,6 +326,19 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
public function updateLineasPresupuesto($presupuesto_id = -1, $datos=[])
{
foreach($datos as $linea){
$this->db
->table($this->table . " t1")
->where("t1.presupuesto_id", $presupuesto_id)
->where("t1.tipo", $linea["tipo"])
->update($linea);
}
}
}