#11579 Fix inventory

This commit is contained in:
miguel angel rasteu 2023-06-20 11:00:09 +02:00
parent 841d724276
commit 76346daf11
1 changed files with 15 additions and 6 deletions

View File

@ -742,7 +742,7 @@ function inventory_get_datatable(
}
if ($utimestamp > 0) {
array_push($where, 'tagente_datos_inventory.utimestamp = '.$utimestamp.' ');
array_push($where, 'tagente_datos_inventory.utimestamp <= '.$utimestamp.' ');
}
$sql = sprintf(
@ -762,12 +762,21 @@ function inventory_get_datatable(
WHERE %s
ORDER BY tmodule_inventory.id_module_inventory
LIMIT %d, %d',
implode(' AND ', $where),
$offset,
$config['block_size']
',
implode(' AND ', $where)
);
if ($inventory_module_name[0] !== '0'
&& $inventory_module_name !== ''
&& $inventory_module_name !== 'all'
) {
$sql .= sprintf(
'LIMIT %d, %d',
$offset,
$config['block_size']
);
}
$rows = db_get_all_rows_sql($sql);
if ($order_by_agent === false) {