falta el mensaje de dejar tipologías o por defecto

This commit is contained in:
2024-03-07 20:40:27 +01:00
parent 224b0f0449
commit 6428224921
11 changed files with 162 additions and 64 deletions

View File

@ -47,7 +47,7 @@ class PresupuestoDireccionesModel extends \App\Models\GoBaseModel
"entregaPieCalle",
];
protected $returnType = "App\Entities\Clientes\ClienteDireccionesEntity";
protected $returnType = "App\Entities\Presupuestos\PresupuestoDireccionesEntity";
public static $labelField = "id";

View File

@ -411,6 +411,19 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
return $builder;
}
public function duplicateLineasPresupuesto($presupuesto_id, $new_presupuesto_id)
{
$lineas = $this->getLineasPresupuesto($presupuesto_id);
$lineas = json_decode(json_encode($lineas), true);
foreach ($lineas as $linea) {
$linea['presupuesto_id'] = $new_presupuesto_id;
unset($linea['id']);
$this->db
->table($this->table . " t1")
->insert($linea);
}
}
}