From 3145c36cd92083f3e9a7c9ddf4b04307799a914a Mon Sep 17 00:00:00 2001 From: 75134972k <75134972k@csic.es> Date: Tue, 19 Mar 2024 14:46:24 +0100 Subject: [PATCH] trabajando en guardar linea --- .vscode/settings.json | 17 ++++++++++++++++- ci4/app/Controllers/Test.php | 5 +++-- .../Presupuestos/PresupuestoLineaModel.php | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7edac904..83b46116 100755 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,18 @@ { - "clockify.tracking.workspaceId": "6464949facab6237e1538c14" + "clockify.tracking.workspaceId": "6464949facab6237e1538c14", + "sqltools.connections": [ + { + "mysqlOptions": { + "authProtocol": "default", + "enableSsl": "Disabled" + }, + "previewLimit": 50, + "server": "localhost", + "port": 3306, + "driver": "MariaDB", + "name": "sk-local", + "database": "sk_imn", + "username": "sk_imn" + } + ] } \ No newline at end of file diff --git a/ci4/app/Controllers/Test.php b/ci4/app/Controllers/Test.php index 898d4c55..b5d853fe 100755 --- a/ci4/app/Controllers/Test.php +++ b/ci4/app/Controllers/Test.php @@ -17,8 +17,9 @@ class Test extends BaseController public function index() { - $status = PresupuestoService::checkMaquina(1995); - var_dump($status); + /*$status = PresupuestoService::checkMaquina(1995); + var_dump($status);*/ + echo xdebug_info(); } diff --git a/ci4/app/Models/Presupuestos/PresupuestoLineaModel.php b/ci4/app/Models/Presupuestos/PresupuestoLineaModel.php index a27d5d2a..69e583c1 100755 --- a/ci4/app/Models/Presupuestos/PresupuestoLineaModel.php +++ b/ci4/app/Models/Presupuestos/PresupuestoLineaModel.php @@ -337,6 +337,23 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel return $builder->orderBy("t1.id", "asc")->get()->getResultObject(); } + public function updatePreciosLineasPresupuesto($id_linea, $new_linea) + { + $data = [ + "pliegos_precio" => $new_linea['precios_pliegos'], + "libro" => $new_linea['precio_libro'], + "total_papel_pedido" => round($new_linea['precio_pedido'], 2), + "margen_papel_pedido" => round($new_linea['margen_papel_pedido'], 2), + "mano" => $new_linea['mano'],wsdasdasd + ]; + $builder = $this->db + ->table($this->table . " t1") + ->where('id', $id_linea) + ->update($new_linea); + + return $builder->orderBy("t1.id", "asc")->get()->getResultObject(); + } + public function deleteLineasPresupuesto($presupuesto_id) { $this->db