diff --git a/update/2_4_43.sql b/update/2_4_43.sql index 94479912f..06fe469b6 100644 --- a/update/2_4_43.sql +++ b/update/2_4_43.sql @@ -42,4 +42,22 @@ UPDATE `zz_prints` SET `options` = '{\"pricing\": false, \"last-page-footer\": t UPDATE `zz_prints` SET `options` = '{\"pricing\": true, \"last-page-footer\": true, \"images\": true}' WHERE `zz_prints`.`name` = "Ordine cliente"; UPDATE `zz_prints` SET `options` = '{\"pricing\": true, \"last-page-footer\": true, \"hide_codice\": true, \"images\": true}' WHERE `zz_prints`.`name` = "Ordine cliente (senza codici)"; UPDATE `zz_prints` SET `options` = '{\"pricing\":false, \"images\": false}' WHERE `zz_prints`.`name` = "Ordine fornitore (senza costi)"; -UPDATE `zz_prints` SET `options` = '{\"pricing\":true, \"images\": false}' WHERE `zz_prints`.`name` = "Ordine fornitore"; \ No newline at end of file +UPDATE `zz_prints` SET `options` = '{\"pricing\":true, \"images\": false}' WHERE `zz_prints`.`name` = "Ordine fornitore"; + +-- Fix query vista Segmenti +UPDATE `zz_modules` SET `options` = "SELECT + |select| +FROM + `zz_segments` + INNER JOIN `zz_modules` ON `zz_modules`.`id` = `zz_segments`.`id_module` + LEFT JOIN (SELECT GROUP_CONCAT(`zz_groups`.`nome` ORDER BY `zz_groups`.`nome` SEPARATOR ', ') AS `gruppi`, `zz_group_segment`.`id_segment` FROM `zz_group_segment` INNER JOIN `zz_groups` ON `zz_groups`.`id` = `zz_group_segment`.`id_gruppo` GROUP BY `zz_group_segment`.`id_segment`) AS `t` ON `t`.`id_segment` = `zz_segments`.`id` +WHERE + 1=1 +HAVING + 2=2 +ORDER BY `zz_segments`.`name`, + `zz_segments`.`id_module`" WHERE `name` = 'Segmenti'; + + +-- Aggiunta segmento Articoli disponibili +INSERT INTO `zz_segments` (`id`, `id_module`, `name`, `clause`, `position`, `pattern`, `note`, `dicitura_fissa`, `predefined`, `predefined_accredito`, `predefined_addebito`, `autofatture`, `is_sezionale`, `is_fiscale`) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = "Articoli"), 'Disponibili', 'qta-IFNULL(a.qta_impegnata,0)', 'WHR', '####', '', '', '0', '0', '0', '0', '0', '0'); \ No newline at end of file