mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'fix/guardar_solapas_pre_cliente' into 'main'
algunas mejoras para cuando no hay servicios defecto See merge request jjimenez/safekat!444
This commit is contained in:
@ -2077,7 +2077,12 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
if ($extra_info) {
|
if ($extra_info) {
|
||||||
$totalServicios -= $margenServicios;
|
$totalServicios -= $margenServicios;
|
||||||
$porcentajeMargenServicios = $margenServicios / ($margenServicios + $totalServicios) * 100;
|
if (($margenServicios + $totalServicios) > 0) {
|
||||||
|
$porcentajeMargenServicios = $margenServicios / ($margenServicios + $totalServicios) * 100;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$porcentajeMargenServicios = 0;
|
||||||
|
}
|
||||||
$sumForFactorPonderado += $totalServicios;
|
$sumForFactorPonderado += $totalServicios;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -76,13 +76,16 @@ class TipoPresupuestoServiciosDefectoModel extends \App\Models\BaseModel
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$where = "(t1.solapas IS NULL OR t1.solapas='" . $solapas . "')";
|
$where = "(t1.solapas IS NULL OR t1.solapas=" . $solapas . ")";
|
||||||
$builder->where($where);
|
$builder->where($where);
|
||||||
|
|
||||||
$builder->where("t1.is_deleted", 0);
|
$builder->where("t1.is_deleted", 0);
|
||||||
$builder->where("t2.is_deleted", 0);
|
$builder->where("t2.is_deleted", 0);
|
||||||
$builder->select("t1.tarifa_id AS tarifa_id, t2.nombre AS tarifa_nombre");
|
$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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user