terminadas LP

This commit is contained in:
Jaime Jiménez
2024-01-07 17:26:42 +01:00
parent 052a8a79e8
commit c11c541768
7 changed files with 304 additions and 281 deletions

View File

@ -35,6 +35,7 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
"precio",
"total_papel_pedido",
"margen_papel_pedido",
"margen_impresion",
"rotativa_impresion",
"rotativa_pag_color",
"rotativa_set_values",
@ -73,7 +74,13 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
"rotativa_total_corte",
'check_impresion_total',
'check_papel_total',
"isActiva",
"maquina",
"papel_impresion",
"maquina_tipo",
"horas_maquina",
"precio_hora",
"precio_impresion",
"total_linea",
];
protected $returnType = "App\Entities\Presupuestos\PresupuestoLineaEntity";
@ -322,22 +329,28 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
->select(
"*"
)
->where("t1.presupuesto_id", $presupuesto_id)
->where("t1.isActiva", 1);
->where("t1.presupuesto_id", $presupuesto_id);
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
public function updateLineasPresupuesto($presupuesto_id = -1, $datos=[])
public function deleteLineasPresupuesto($presupuesto_id){
$this->db
->table($this->table . " t1")
->where("presupuesto_id", $presupuesto_id)
->delete();
}
public function insertLineasPresupuesto($presupuesto_id = -1, $datos=[])
{
$this->deleteLineasPresupuesto($presupuesto_id);
foreach($datos as $linea){
$this->db
->table($this->table . " t1")
->where("t1.presupuesto_id", $presupuesto_id)
->where("t1.tipo", $linea["tipo"])
->update($linea);
->insert($linea);
}
}