From d2271df05359ff89372e40aead800f26180c4674 Mon Sep 17 00:00:00 2001 From: valentina Date: Wed, 30 Oct 2024 11:44:49 +0100 Subject: [PATCH 1/2] feat: query di installazione --- update/2_6.sql | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/update/2_6.sql b/update/2_6.sql index 08532dd30..1a4bbd89b 100644 --- a/update/2_6.sql +++ b/update/2_6.sql @@ -64,21 +64,22 @@ INSERT INTO `zz_views_lang` (`id_lang`, `id_record`, `title`) VALUES ('1', (SELECT `id` FROM `zz_views` WHERE `name` = 'color_Colore' AND `id_module` = @id_module), 'color_Colore'), ('2', (SELECT `id` FROM `zz_views` WHERE `name` = 'color_Colore' AND `id_module` = @id_module), 'color_Color'); --- Mandati SEPA CREATE TABLE IF NOT EXISTS `co_mandati_sepa` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_banca` int(11) NOT NULL, `id_mandato` varchar(255) NOT NULL, `data_firma_mandato` DATE NOT NULL, + `singola_disposizione` TINYINT(1) NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`id_banca`) REFERENCES `co_banche`(`id`) ON DELETE CASCADE ) ENGINE=InnoDB; -ALTER TABLE `co_mandati_sepa` ADD `singola_disposizione` TINYINT(1) NOT NULL AFTER `data_firma_mandato`; - -- Aggiunta del plugin -INSERT INTO `zz_plugins` (`id`, `name`, `idmodule_from`, `idmodule_to`, `position`, `script`, `enabled`, `default`, `order`, `compatibility`, `version`, `options2`, `options`, `directory`, `help`) VALUES -(NULL, 'Mandati SEPA', (SELECT `id` FROM `zz_modules` WHERE `name`='Banche'), (SELECT `id` FROM `zz_modules` WHERE `name`='Banche'), 'tab', '', 1, 1, 0, '2.*', '', NULL, 'custom', 'mandati_sepa', ''); +SELECT @id_module := `id` FROM `zz_modules` WHERE `name` = 'Banche'; +INSERT INTO `zz_plugins` (`name`, `idmodule_from`, `idmodule_to`, `position`, `script`, `enabled`, `default`, `order`, `compatibility`, `version`, `options2`, `options`, `directory`, `help`) VALUES +('Mandati SEPA', @id_module, @id_module, 'tab', '', 1, 1, 0, '2.6.*', '', NULL, 'custom', 'mandati_sepa', ''); -INSERT INTO `zz_plugins_lang` (`id`, `id_lang`, `id_record`, `title`) VALUES -(NULL, 1, (SELECT `id` FROM `zz_plugins` WHERE `name`='Mandati SEPA'), 'Mandati SEPA'); \ No newline at end of file +INSERT INTO `zz_plugins_lang` (`id_lang`, `id_record`, `title`) +VALUES + (1, LAST_INSERT_ID(), 'Mandati SEPA'), + (2, LAST_INSERT_ID(), 'Mandati SEPA'); From 6135e1396dd974d35fbb951d116cb1f9b5ff2063 Mon Sep 17 00:00:00 2001 From: valentina Date: Wed, 30 Oct 2024 11:49:19 +0100 Subject: [PATCH 2/2] fix: modifica riga in fattura --- modules/fatture/actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/fatture/actions.php b/modules/fatture/actions.php index 9662ba760..ec4fe2b1d 100755 --- a/modules/fatture/actions.php +++ b/modules/fatture/actions.php @@ -532,7 +532,7 @@ switch ($op) { } $articolo->save(); - $database->query('UPDATE `co_righe_documenti` SET `descrizione` = \''.post('descrizione').'\' WHERE `iddocumento` = '.$fattura->id.' AND `idarticolo` = '.$articolo->idarticolo.';'); + $database->query('UPDATE `co_righe_documenti` SET `descrizione` = '.prepare(post('descrizione')).' WHERE `iddocumento` = '.$fattura->id.' AND `idarticolo` = '.$articolo->idarticolo.';'); if (post('idriga') != null) { flash()->info(tr('Articolo modificato!'));