diff --git a/modules/articoli/plugins/articoli.lotti.php b/modules/articoli/plugins/articoli.lotti.php
index c6f9cbbdf..ade84f392 100644
--- a/modules/articoli/plugins/articoli.lotti.php
+++ b/modules/articoli/plugins/articoli.lotti.php
@@ -155,7 +155,7 @@ $rs = $dbo->fetchArray('SELECT COUNT(id) AS tot FROM mg_prodotti WHERE id_artico
$tot_prodotti = $rs[0]['tot'];
// Visualizzazione di tutti i prodotti
-$query = 'SELECT serial, created_at FROM mg_prodotti WHERE serial IS NOT NULL AND id_articolo='.prepare($id_record).(!empty($search_serial) ? ' AND serial LIKE '.prepare('%'.$search_serial.'%') : '').' GROUP BY serial ORDER BY created_at DESC, serial DESC, lotto DESC, altro DESC';
+$query = 'SELECT id, serial, created_at FROM mg_prodotti WHERE serial IS NOT NULL AND id_articolo='.prepare($id_record).(!empty($search_serial) ? ' AND serial LIKE '.prepare('%'.$search_serial.'%') : '').' GROUP BY serial ORDER BY created_at DESC, serial DESC, lotto DESC, altro DESC';
$rs2 = $dbo->fetchArray($query);
echo '
diff --git a/modules/ddt/plugins/ddt.anagrafiche.php b/modules/ddt/plugins/ddt.anagrafiche.php
index aafa4126d..71cfd5942 100644
--- a/modules/ddt/plugins/ddt.anagrafiche.php
+++ b/modules/ddt/plugins/ddt.anagrafiche.php
@@ -37,16 +37,16 @@ if (!empty($rsddt)) {
'.($key + 1).'
- '.Modules::link('Ddt di vendita', $rsddt[$i]['idddt'], $rsddt[$i]['numero_esterno']).'
+ '.Modules::link('Ddt di vendita', $r['idddt'], !empty($r['numero_esterno']) ? $r['numero_esterno'] : $r['numero']).'