UPDATE`zz_views`INNERJOIN`zz_modules`ON`zz_views`.`id_module`=`zz_modules`.`id`SET`zz_views`.`order_by`='CAST(numero_esterno AS UNSIGNED)'WHERE`zz_modules`.`name`IN('Fatture di vendita','Fatture di acquisto','Ordini cliente','Ordini fornitore','Ddt di vendita','Ddt di acquisto')AND`zz_views`.`name`='Numero';
UPDATE`zz_views`INNERJOIN`zz_modules`ON`zz_views`.`id_module`=`zz_modules`.`id`SET`zz_views`.`order_by`='CAST(in_interventi.codice AS UNSIGNED)'WHERE`zz_modules`.`name`='Interventi'AND`zz_views`.`name`='Numero';
UPDATE`zz_views`INNERJOIN`zz_modules`ON`zz_views`.`id_module`=`zz_modules`.`id`SET`zz_views`.`order_by`='CAST(numero AS UNSIGNED)'WHERE`zz_modules`.`name`IN('Ordini Preventivi','Contratti')AND`zz_views`.`name`='Numero';
UPDATE`zz_views`INNERJOIN`zz_modules`ON`zz_views`.`id_module`=`zz_modules`.`id`SET`zz_views`.`query`='GROUP_CONCAT(CASE WHEN totale > 0 THEN co_pianodeiconti3.descrizione ELSE NULL END)'WHERE`zz_modules`.`name`='Prima nota'AND`zz_views`.`name`='Conto avere';
UPDATE`zz_views`INNERJOIN`zz_modules`ON`zz_views`.`id_module`=`zz_modules`.`id`SET`zz_views`.`query`='GROUP_CONCAT(CASE WHEN totale < 0 THEN co_pianodeiconti3.descrizione ELSE NULL END)'WHERE`zz_modules`.`name`='Prima nota'AND`zz_views`.`name`='Conto dare';