fix: rimozione impostazione deprecata e allineamento codice

This commit is contained in:
valentina 2024-10-21 09:30:38 +02:00
parent 085b37af83
commit 3424bc8864
2 changed files with 29 additions and 1 deletions

View File

@ -19,9 +19,10 @@
include_once __DIR__.'/../../core.php';
use Models\Module;
use Modules\Segmenti\Segmento;
$id_module_fatture_vendita = Module::where('name', 'Fatture di vendita')->first()->id;
$id_segment = setting('Sezionale per autofatture di vendita');
$id_segment = Segmento::where('name', 'Autofatture')->where('id_module', $id_module_fatture_vendita)->first()->id;
echo '
<form action="" method="post" id="crea-autofattura">

27
update/2_5_6.sql Normal file
View File

@ -0,0 +1,27 @@
-- Aggiunta Marchio articolo
ALTER TABLE `mg_articoli` ADD `id_marchio` INT NULL DEFAULT NULL;
CREATE TABLE `mg_marchi` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`link` varchar(255) NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)) ENGINE = InnoDB;
INSERT INTO `zz_modules` (`name`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`, `use_notes`, `use_checklists`) VALUES ('Marchi', 'marchi', 'SELECT |select| FROM `mg_marchi` WHERE 1=1 HAVING 2=2 ORDER BY `mg_marchi`.`name`', '', 'fa fa-angle-right', '2.5.6', '2.5.6', '7', (SELECT `id` FROM `zz_modules` AS `t` WHERE `name` = 'Tabelle'), '1', '1', '1', '1');
INSERT INTO `zz_modules_lang` (`id_lang`, `id_record`, `title`) VALUES ('1', (SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi'), 'Marchi');
INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `html_format`, `search_inside`, `order_by`, `visible`, `summable`, `default`) VALUES
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi'), 'id', 'mg_marchi.id', '0', '0', '0', '0', '0', '', '', '0', '0', '0'),
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi'), 'Nome', 'mg_marchi.name', '1', '0', '0', '0', '0', '', '', '1', '0', '0'),
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi'), 'Link', 'mg_marchi.link', '2', '0', '0', '0', '0', '', '', '1', '0', '0');
INSERT INTO `zz_views_lang` (`id_lang`, `id_record`, `title`) VALUES
(1, (SELECT `id` FROM `zz_views` WHERE `name` = 'id' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi')), 'id'),
(1, (SELECT `id` FROM `zz_views` WHERE `name` = 'Nome' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi')), 'Nome'),
(1, (SELECT `id` FROM `zz_views` WHERE `name` = 'Link' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Marchi')), 'Link');
-- Rimozione impostazioni deprecate per sezionale predefinito autofatture
DELETE FROM `zz_settings` WHERE `zz_settings`.`nome` = 'Sezionale per autofatture di vendita';
DELETE FROM `zz_settings` WHERE `zz_settings`.`nome` = 'Sezionale per autofatture di acquisto';