From 1f74b38b8dda9fc7232d33d277a14b51be65d8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Thu, 19 Dec 2024 09:01:04 +0100 Subject: [PATCH 1/2] arreglado valor por defecto en consumo tintas papeles impresion --- .../vuexy/form/configuracion/papel/viewPapelImpresionForm.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php index 9c4c2abc..77ddfcd7 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php @@ -461,7 +461,8 @@ name: "cg", attr: { type: "number" - } + }, + def: 0, }, { name: "gota_negro", From bd928428773c41c00c84a11a730edba546360f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Tue, 24 Dec 2024 17:43:44 +0100 Subject: [PATCH 2/2] algunas mejoras para cuando no hay servicios defecto --- ci4/app/Controllers/Presupuestos/Presupuestocliente.php | 7 ++++++- .../Presupuestos/TipoPresupuestoServiciosDefectoModel.php | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ci4/app/Controllers/Presupuestos/Presupuestocliente.php b/ci4/app/Controllers/Presupuestos/Presupuestocliente.php index aca290a0..f0c688c7 100755 --- a/ci4/app/Controllers/Presupuestos/Presupuestocliente.php +++ b/ci4/app/Controllers/Presupuestos/Presupuestocliente.php @@ -2077,7 +2077,12 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController if ($extra_info) { $totalServicios -= $margenServicios; - $porcentajeMargenServicios = $margenServicios / ($margenServicios + $totalServicios) * 100; + if (($margenServicios + $totalServicios) > 0) { + $porcentajeMargenServicios = $margenServicios / ($margenServicios + $totalServicios) * 100; + } + else{ + $porcentajeMargenServicios = 0; + } $sumForFactorPonderado += $totalServicios; } diff --git a/ci4/app/Models/Presupuestos/TipoPresupuestoServiciosDefectoModel.php b/ci4/app/Models/Presupuestos/TipoPresupuestoServiciosDefectoModel.php index 8979b058..b5804be4 100755 --- a/ci4/app/Models/Presupuestos/TipoPresupuestoServiciosDefectoModel.php +++ b/ci4/app/Models/Presupuestos/TipoPresupuestoServiciosDefectoModel.php @@ -76,13 +76,16 @@ class TipoPresupuestoServiciosDefectoModel extends \App\Models\BaseModel return []; } - $where = "(t1.solapas IS NULL OR t1.solapas='" . $solapas . "')"; + $where = "(t1.solapas IS NULL OR t1.solapas=" . $solapas . ")"; $builder->where($where); $builder->where("t1.is_deleted", 0); $builder->where("t2.is_deleted", 0); $builder->select("t1.tarifa_id AS tarifa_id, t2.nombre AS tarifa_nombre"); - return $builder->get()->getResultArray(); + $data = $builder->get()->getResultArray(); + // DEBUG + $query = $this->db->getLastQuery(); + return $data; } }