diff --git a/ajax_dataload.php b/ajax_dataload.php index 0cd3dc021..c8c9741bd 100644 --- a/ajax_dataload.php +++ b/ajax_dataload.php @@ -80,7 +80,7 @@ if (!empty($module_query) && $module_query != 'menu' && $module_query != 'custom unset($pieces[$cont - 1]); } - $module_query = implode('ORDER', $pieces).' ORDER BY `'.$total['order_by'][$order['column']].'` '.$order['dir']; + $module_query = implode('ORDER', $pieces).' ORDER BY '.$total['order_by'][$order['column']].' '.$order['dir']; } // Calcolo di eventuali somme diff --git a/update/2_3_1.sql b/update/2_3_1.sql index d7464a51e..2f5abd418 100644 --- a/update/2_3_1.sql +++ b/update/2_3_1.sql @@ -7,3 +7,10 @@ ALTER TABLE `zz_files` ADD `id_plugin` int(11) AFTER `id_module`; -- Aggiunto valore NULL a idarticolo in co_righe2_contratti -- ALTER TABLE `co_righe2_contratti` CHANGE `idarticolo` `idarticolo` int(11); -- UPDATE `co_righe2_contratti` SET `idarticolo` = NULL WHERE `idarticolo` = 0; + +-- Aggiornamento ORDER BY nei moduli Fatture, DDT, Ordini, Preventivi, Contratti e Interventi +UPDATE `zz_views` SET `order_by` = 'CAST(numero_esterno AS UNSIGNED)' WHERE `name` = 'Numero' AND `id_module` IN (SELECT `id` FROM `zz_modules` WHERE `name` IN ('Fatture di vendita', 'Fatture di acquisto', 'Ordini cliente', 'Ordini fornitore', 'Ddt di vendita', 'Ddt di acquisto')); + +UPDATE `zz_views` SET `order_by` = 'CAST(in_interventi.codice AS UNSIGNED)' WHERE `name` = 'Numero' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'); + +UPDATE `zz_views` SET `order_by` = 'CAST(numero AS UNSIGNED)' WHERE `name` = 'Numero' AND `id_module` IN (SELECT `id` FROM `zz_modules` WHERE `name` IN ('Ordini Preventivi', 'Contratti'));