From 472f14b552549556eef274b84ebd941cc6a5daff Mon Sep 17 00:00:00 2001 From: Andrea Bruno <21980406+Andrea-Bruno@users.noreply.github.com> Date: Mon, 12 Oct 2026 00:31:30 +0200 Subject: [PATCH] Add the goods column to the activities list Registers a new Merce view for the Interventi module that lists, for each activity, the goods linked to it with quantity and description. Added as a correlated subquery so the main list query is untouched, and shipped in the 2.12.0 migration with Italian and English titles. --- update/2_12.sql | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/update/2_12.sql b/update/2_12.sql index f3dfbd22e..ff18c55e5 100644 --- a/update/2_12.sql +++ b/update/2_12.sql @@ -121,4 +121,12 @@ INSERT INTO `zz_views_lang` (`id_lang`, `id_record`, `title`) VALUES -- Aggiunta campo id_sede alle righe dei documenti che movimentano il magazzino ALTER TABLE `co_righe_documenti` ADD `id_sede` INT NOT NULL; ALTER TABLE `dt_righe_ddt` ADD `id_sede` INT NOT NULL; -ALTER TABLE `in_righe_interventi` ADD `id_sede` INT NOT NULL; \ No newline at end of file +ALTER TABLE `in_righe_interventi` ADD `id_sede` INT NOT NULL; + +-- Add the "Merce" column to the activities list, showing the goods linked to each activity +INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `html_format`, `search_inside`, `order_by`, `visible`, `summable`, `avg`, `default`) VALUES +((SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'), 'Merce', '(SELECT GROUP_CONCAT(DISTINCT CONCAT(`in_righe_interventi`.`qta`, ''x '', `in_righe_interventi`.`descrizione`) SEPARATOR ''
'') FROM `in_righe_interventi` WHERE `in_righe_interventi`.`id_intervento` = `in_interventi`.`id`)', 90, 1, 1, 0, 1, '', '', 1, 0, 0, 0); + +INSERT INTO `zz_views_lang` (`id_lang`, `id_record`, `title`) VALUES +(1, (SELECT `id` FROM `zz_views` WHERE `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi') AND `name` = 'Merce'), 'Merce'), +(2, (SELECT `id` FROM `zz_views` WHERE `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi') AND `name` = 'Merce'), 'Goods'); \ No newline at end of file