#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) { if ($utimestamp > 0) {
array_push($where, 'tagente_datos_inventory.utimestamp = '.$utimestamp.' '); array_push($where, 'tagente_datos_inventory.utimestamp <= '.$utimestamp.' ');
} }
$sql = sprintf( $sql = sprintf(
@ -761,13 +761,22 @@ function inventory_get_datatable(
ON tagente.id_agente = tagent_module_inventory.id_agente ON tagente.id_agente = tagent_module_inventory.id_agente
WHERE %s WHERE %s
ORDER BY tmodule_inventory.id_module_inventory ORDER BY tmodule_inventory.id_module_inventory
LIMIT %d, %d', ',
implode(' AND ', $where), implode(' AND ', $where)
$offset,
$config['block_size']
); );
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); $rows = db_get_all_rows_sql($sql);
if ($order_by_agent === false) { if ($order_by_agent === false) {