This commit is contained in:
MatteoPistorello 2022-01-27 15:15:03 +01:00
commit bb5c89bb53
2 changed files with 14 additions and 2 deletions

View File

@ -67,7 +67,7 @@
"inquirer": "^4.0.1", "inquirer": "^4.0.1",
"main-bower-files": "^2.13.1", "main-bower-files": "^2.13.1",
"md5-file": "^5.0.0", "md5-file": "^5.0.0",
"shelljs": "^0.7.7" "shelljs": ">=0.8.5"
}, },
"scripts": { "scripts": {
"gulp": "gulp", "gulp": "gulp",

View File

@ -43,3 +43,15 @@ UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM an_mansioni WHERE 1=1
-- Nuova stampa Ordine cliente (senza codici) -- Nuova stampa Ordine cliente (senza codici)
INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name`='Ordini cliente'), '1', 'Ordine cliente (senza codici)', 'Ordine cliente (senza codici)', 'Ordine cliente num. {numero} del {data}', 'ordini', 'idordine', '{\"pricing\": true, \"last-page-footer\": true, \"hide_codice\": true}', 'fa fa-print', '', '', '0', '0', '1', '1'); INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name`='Ordini cliente'), '1', 'Ordine cliente (senza codici)', 'Ordine cliente (senza codici)', 'Ordine cliente num. {numero} del {data}', 'ordini', 'idordine', '{\"pricing\": true, \"last-page-footer\": true, \"hide_codice\": true}', 'fa fa-print', '', '', '0', '0', '1', '1');
-- Aggiunta vista Email inviata in moduli ordini
UPDATE `zz_modules` SET `options` = 'SELECT |select|\r\nFROM `or_ordini`\r\n LEFT JOIN `an_anagrafiche` ON `or_ordini`.`idanagrafica` = `an_anagrafiche`.`idanagrafica`\r\n LEFT JOIN `or_tipiordine` ON `or_ordini`.`idtipoordine` = `or_tipiordine`.`id`\r\n LEFT JOIN (\r\n SELECT `idordine`,\r\n SUM(`qta` - `qta_evasa`) AS `qta_da_evadere`,\r\n SUM(`subtotale` - `sconto`) AS `totale_imponibile`,\r\n SUM(`subtotale` - `sconto` + `iva`) AS `totale`\r\n FROM `or_righe_ordini`\r\n GROUP BY `idordine`\r\n ) AS righe ON `or_ordini`.`id` = `righe`.`idordine`\r\n LEFT JOIN (\r\n SELECT `idordine`,\r\n MIN(`data_evasione`) AS `data_evasione`\r\n FROM `or_righe_ordini`\r\n WHERE (`qta` - `qta_evasa`)>0\r\n GROUP BY `idordine`\r\n ) AS `righe_da_evadere` ON `righe`.`idordine`=`righe_da_evadere`.`idordine`\r\n LEFT JOIN (\r\n SELECT GROUP_CONCAT(DISTINCT co_documenti.numero_esterno SEPARATOR \", \") AS info, co_righe_documenti.idordine FROM co_documenti INNER JOIN co_righe_documenti ON co_documenti.id = co_righe_documenti.iddocumento GROUP BY idordine\r\n) AS fattura ON fattura.idordine = or_ordini.id\r\nLEFT JOIN (\r\n SELECT `zz_operations`.`id_email`, `zz_operations`.`id_record`\r\n FROM `zz_operations`\r\n INNER JOIN `em_emails` ON `zz_operations`.`id_email` = `em_emails`.`id`\r\n INNER JOIN `em_templates` ON `em_emails`.`id_template` = `em_templates`.`id`\r\n INNER JOIN `zz_modules` ON `zz_operations`.`id_module` = `zz_modules`.`id`\r\n WHERE `zz_modules`.`name` = \'Ordini fornitore\' AND `zz_operations`.`op` = \'send-email\'\r\n GROUP BY `zz_operations`.`id_record`\r\n ) AS `email` ON `email`.`id_record` = `or_ordini`.`id`\r\nWHERE 1=1 AND `dir` = \'uscita\' |date_period(`data`)|\r\nHAVING 2=2\r\nORDER BY `data` DESC, CAST(`numero_esterno` AS UNSIGNED) DESC' WHERE `zz_modules`.`name` = 'Ordini fornitore';
UPDATE `zz_modules` SET `options` = 'SELECT |select|\r\nFROM `or_ordini`\r\n LEFT JOIN `an_anagrafiche` ON `or_ordini`.`idanagrafica` = `an_anagrafiche`.`idanagrafica`\r\n LEFT JOIN `or_tipiordine` ON `or_ordini`.`idtipoordine` = `or_tipiordine`.`id`\r\n LEFT JOIN (\r\n SELECT `idordine`,\r\n SUM(`qta` - `qta_evasa`) AS `qta_da_evadere`,\r\n SUM(`subtotale` - `sconto`) AS `totale_imponibile`,\r\n SUM(`subtotale` - `sconto` + `iva`) AS `totale`\r\n FROM `or_righe_ordini`\r\n GROUP BY `idordine`\r\n ) AS righe ON `or_ordini`.`id` = `righe`.`idordine`\r\n LEFT JOIN (\r\n SELECT `idordine`,\r\n MIN(`data_evasione`) AS `data_evasione`\r\n FROM `or_righe_ordini`\r\n WHERE (`qta` - `qta_evasa`)>0\r\n GROUP BY `idordine`\r\n ) AS `righe_da_evadere` ON `righe`.`idordine`=`righe_da_evadere`.`idordine`\r\n LEFT JOIN (\r\n SELECT GROUP_CONCAT(DISTINCT co_documenti.numero_esterno SEPARATOR \", \") AS info, co_righe_documenti.idordine FROM co_documenti INNER JOIN co_righe_documenti ON co_documenti.id = co_righe_documenti.iddocumento GROUP BY idordine\r\n) AS fattura ON fattura.idordine = or_ordini.id\r\nLEFT JOIN (\r\n SELECT `zz_operations`.`id_email`, `zz_operations`.`id_record`\r\n FROM `zz_operations`\r\n INNER JOIN `em_emails` ON `zz_operations`.`id_email` = `em_emails`.`id`\r\n INNER JOIN `em_templates` ON `em_emails`.`id_template` = `em_templates`.`id`\r\n INNER JOIN `zz_modules` ON `zz_operations`.`id_module` = `zz_modules`.`id`\r\n WHERE `zz_modules`.`name` = \'Ordini cliente\' AND `zz_operations`.`op` = \'send-email\'\r\n GROUP BY `zz_operations`.`id_record`\r\n ) AS `email` ON `email`.`id_record` = `or_ordini`.`id`\r\nWHERE 1=1 AND `dir` = \'entrata\' |date_period(`data`)|\r\nHAVING 2=2\r\nORDER BY `data` DESC, CAST(`numero_esterno` AS UNSIGNED) DESC' WHERE `zz_modules`.`name` = 'Ordini cliente';
INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `search_inside`, `order_by`, `visible`, `summable`, `default`) VALUES
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Ordini cliente'), 'icon_Inviata', 'IF(`email`.`id_email` IS NOT NULL, \'fa fa-envelope text-success\', \'\')', 12, 1, 0, 0, '', '', 1, 0, 0),
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Ordini fornitore'), 'icon_Inviata', 'IF(`email`.`id_email` IS NOT NULL, \'fa fa-envelope text-success\', \'\')', 12, 1, 0, 0, '', '', 0, 0, 0);
-- Fix massimale dichiarazione d'intento
ALTER TABLE `co_dichiarazioni_intento` CHANGE `massimale` `massimale` DECIMAL(15,6) NOT NULL;