From f5786f549d20e09904b92cebb14371b057e8abe1 Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Tue, 7 Dec 2021 13:05:41 +0100 Subject: [PATCH] Aggiunto codice distinta nello scadenzario --- CHANGELOG.md | 5 +++-- modules/scadenzario/actions.php | 1 + modules/scadenzario/bulk.php | 36 +++++++++++++++++++++++++++++++++ modules/scadenzario/edit.php | 14 +++++++++++++ update/2_4_28.sql | 7 ++++++- 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3443ec193..dfa2bc515 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Tutti i maggiori cambiamenti di questo progetto saranno documentati in questo fi Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://keepachangelog.com/), e il progetto segue il [Semantic Versioning](http://semver.org/) per definire le versioni delle release. -- [2.4.28 (2021-12-)](#2428-2021-12-) +- [2.4.28 (2021-12-07)](#2428-2021-12-07) - [2.4.27 (2021-10-25)](#2427-2021-10-26) - [2.4.26 (2021-09-24)](#2426-2021-09-24) - [2.4.25 (2021-08-25)](#2425-2021-08-25) @@ -39,7 +39,7 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k - [2.2 (2016-11-10)](#22-2016-11-10) - [2.1 (2015-04-02)](#21-2015-04-02) -## 2.4.28 (2021-12-) +## 2.4.28 (2021-12-07) ### Aggiunto (Added) - Aggiunta colonna documento di acquisto e prezzo nel plugin **seriali** @@ -64,6 +64,7 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k - Aggiunta gestione Abi e Cab in fase di creazione banca - Aggiunte note interne in template mail - Aggiunta duplicazione **DDT** + - Aggiunto codice distinta nello scadenzario ### Modificato (Changed) - Compilazione automatica tipo documento in fase di import FE solo se il campo non è impostato diff --git a/modules/scadenzario/actions.php b/modules/scadenzario/actions.php index 21cc32b18..51af767aa 100755 --- a/modules/scadenzario/actions.php +++ b/modules/scadenzario/actions.php @@ -84,6 +84,7 @@ switch (post('op')) { 'scadenza' => $scadenza, 'data_concordata' => $data_concordata, 'note' => post('note'), + 'distinta' => post('distinta') ?: null, ], ['id' => $id_scadenza]); if ($da_pagare == 0) { diff --git a/modules/scadenzario/bulk.php b/modules/scadenzario/bulk.php index a51974355..8c1d98536 100755 --- a/modules/scadenzario/bulk.php +++ b/modules/scadenzario/bulk.php @@ -19,6 +19,30 @@ include_once __DIR__.'/../../core.php'; +switch (post('op')) { + case 'change_distinta': + $distinta = post('distinta'); + + $n_scadenze = 0; + foreach ($id_records as $id) { + $database->update('co_scadenziario', [ + 'distinta' => $distinta, + ], ['id' => $id]); + + ++$n_scadenze; + } + + if ($n_scadenze > 0) { + flash()->info(tr('Distinta aggiornata a _NUM_ scadenze!', [ + '_NUM_' => $n_scadenze, + ])); + } else { + flash()->warning(tr('Nessuna scadenza modificata!')); + } + + break; +} + $operations['registrazione-contabile'] = [ 'text' => ' '.tr('Registrazione contabile').'', 'data' => [ @@ -29,4 +53,16 @@ $operations['registrazione-contabile'] = [ ], ]; +$operations['change_distinta'] = [ + 'text' => ' '.tr('Aggiorna distinta'), + 'data' => [ + 'title' => tr('Aggiornare la distinta per le scadenze selezionate?'), + 'msg' => tr('Per ciascuna scadenza selezionata verrà aggiornata la distinta').'.
+
{[ "type": "text", "label": "'.tr('Distinta').'", "name": "distinta", "required": 1 ]}', + 'button' => tr('Procedi'), + 'class' => 'btn btn-lg btn-warning', + 'blank' => false, + ], +]; + return $operations; diff --git a/modules/scadenzario/edit.php b/modules/scadenzario/edit.php index f6c430995..19f6c3d8e 100755 --- a/modules/scadenzario/edit.php +++ b/modules/scadenzario/edit.php @@ -85,6 +85,13 @@ if (!empty($documento)) { + + '.tr('Distinta').': + + {[ "type": "text", "name": "distinta", "value": "'.$record['distinta'].'" ]} + + + '.Modules::link($documento->module, $record['iddocumento'], ' '.tr('Apri documento'), null, 'class="btn btn-primary"'); @@ -98,6 +105,13 @@ if (!empty($documento)) { 'required' => 1, 'value' => $scadenza['descrizione'], ]); + + echo input([ + 'type' => 'text', + 'label' => tr('Distinta'), + 'name' => 'distinta', + 'value' => $scadenza['distinta'], + ]); } echo ' diff --git a/update/2_4_28.sql b/update/2_4_28.sql index d62596d42..8ac84fa86 100644 --- a/update/2_4_28.sql +++ b/update/2_4_28.sql @@ -104,4 +104,9 @@ INSERT INTO `zz_plugins` (`id`, `name`, `title`, `idmodule_from`, `idmodule_to`, ALTER TABLE `em_templates` ADD `note_aggiuntive` TEXT NOT NULL AFTER `predefined`; -- Eliminazione modulo gestione componenti -DELETE FROM `zz_modules` WHERE `zz_modules`.`name` = 'Gestione componenti'; \ No newline at end of file +DELETE FROM `zz_modules` WHERE `zz_modules`.`name` = 'Gestione componenti'; + +-- Aggiunta distinta scadenze +ALTER TABLE `co_scadenziario` ADD `distinta` VARCHAR(255) NULL AFTER `presentazioni_exported_at`; +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` = 'Scadenzario'), 'Distinta', 'co_scadenziario.distinta', 15, 1, 0, 0, '', '', 0, 0, 0);