fixed minor error

This commit is contained in:
Daniel Barbero Martin 2019-09-18 13:16:05 +02:00
parent 43af2269ee
commit 056bbb7348

View File

@ -10738,7 +10738,7 @@ function reporting_get_agentmodule_data_sum(
) { ) {
global $config; global $config;
// Initialize variables // Initialize variables.
if (empty($date)) { if (empty($date)) {
$date = get_system_time(); $date = get_system_time();
} }
@ -10760,7 +10760,7 @@ function reporting_get_agentmodule_data_sum(
$id_module_type $id_module_type
); );
$module_interval = modules_get_interval($id_agent_module); $module_interval = modules_get_interval($id_agent_module);
// Check if module must be compressed // Check if module must be compressed.
if (!$uncompressed_module) { if (!$uncompressed_module) {
$uncompressed_module = is_module_uncompressed($module_name); $uncompressed_module = is_module_uncompressed($module_name);
} }
@ -10770,11 +10770,11 @@ function reporting_get_agentmodule_data_sum(
return 0; return 0;
} }
// Incremental modules are treated differently // Incremental modules are treated differently.
$module_inc = is_module_inc($module_name); $module_inc = is_module_inc($module_name);
if (!$uncompressed_module) { if (!$uncompressed_module) {
// Get module data // Get module data.
$interval_data = db_get_all_rows_sql( $interval_data = db_get_all_rows_sql(
' '
SELECT * FROM tagente_datos SELECT * FROM tagente_datos
@ -10798,7 +10798,7 @@ function reporting_get_agentmodule_data_sum(
return false; return false;
} }
// Set initial conditions // Set initial conditions.
$total = 0; $total = 0;
$partial_total = 0; $partial_total = 0;
$count_sum = 0; $count_sum = 0;
@ -10807,17 +10807,6 @@ function reporting_get_agentmodule_data_sum(
$partial_total = 0; $partial_total = 0;
$count_sum = 0; $count_sum = 0;
switch ($config['dbtype']) {
case 'mysql':
case 'postgresql':
// Do none
break;
case 'oracle':
$data['datos'] = oracle_format_float_to_php($data['datos']);
break;
}
if (!$uncompressed_module) { if (!$uncompressed_module) {
$total += $data['datos']; $total += $data['datos'];
} else if (!$module_inc) { } else if (!$module_inc) {
@ -10832,7 +10821,7 @@ function reporting_get_agentmodule_data_sum(
continue; continue;
} }
$total += ($partial_total / $count_sum); $total += $partial_total;
} else { } else {
$last = end($data['data']); $last = end($data['data']);
$total += $last['datos']; $total += $last['datos'];