diff --git a/modules/segmenti/actions.php b/modules/segmenti/actions.php index c82feef9b..ab180613a 100755 --- a/modules/segmenti/actions.php +++ b/modules/segmenti/actions.php @@ -56,6 +56,7 @@ switch (post('op')) { 'predefined_accredito' => $predefined_accredito, 'predefined_addebito' => $predefined_addebito, 'autofatture' => post('autofatture'), + 'for_fe' => post('for_fe'), ], ['id' => $id_record]); // Aggiornamento dei permessi relativi diff --git a/modules/segmenti/ajax/select.php b/modules/segmenti/ajax/select.php index 860b1fb24..39983416f 100644 --- a/modules/segmenti/ajax/select.php +++ b/modules/segmenti/ajax/select.php @@ -25,6 +25,7 @@ switch ($resource) { $id_module = $superselect['id_module']; $is_fiscale = $superselect['is_fiscale']; $is_sezionale = $superselect['is_sezionale']; + $for_fe = $superselect['for_fe']; $escludi_id = $superselect['escludi_id']; if (isset($id_module)) { @@ -40,6 +41,10 @@ switch ($resource) { if ($is_sezionale != null) { $where[] = 'zz_segments.is_sezionale = '.prepare($is_sezionale); } + + if ($for_fe != null) { + $where[] = 'zz_segments.for_fe = '.prepare($for_fe); + } if ($escludi_id != null) { $where[] = 'zz_segments.id != '.prepare($escludi_id); diff --git a/modules/segmenti/edit.php b/modules/segmenti/edit.php index cdfd61c56..2914948ad 100755 --- a/modules/segmenti/edit.php +++ b/modules/segmenti/edit.php @@ -131,16 +131,20 @@ if ($record['is_sezionale']) {
-
+
{[ "type": "checkbox", "label": "", "name": "predefined_accredito", "value": "$predefined_accredito$", "help": "", "placeholder": "", "extra": "" ]}
-
+
{[ "type": "checkbox", "label": "", "name": "predefined_addebito", "value": "$predefined_addebito$", "help": "", "placeholder": "", "extra": "" ]}
-
- {[ "type": "checkbox", "label": "", "name": "autofatture", "value": "$autofatture$", "extra": "" ]} +
+ {[ "type": "checkbox", "label": "", "name": "autofatture", "value": "$autofatture$", "help": "", "extra": "" ]} +
+ +
+ {[ "type": "checkbox", "label": "", "name": "for_fe", "value": "$for_fe$", "help": "", "extra": "" ]}
diff --git a/plugins/importFE/generate.php b/plugins/importFE/generate.php index 49c8f2f34..eef965931 100755 --- a/plugins/importFE/generate.php +++ b/plugins/importFE/generate.php @@ -242,7 +242,7 @@ $id_segment = $database->table('co_tipidocumento')->where('id', '=', $id_tipodoc echo '
- {[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_module, 'is_fiscale' => 1, 'is_sezionale' => 1]).', "value": "'.$id_segment.'" ]} + {[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_module, 'is_fiscale' => 1, 'is_sezionale' => 1, 'for_fe' => 1]).', "value": "'.$id_segment.'" ]}
'; // Data di registrazione diff --git a/update/2_4_55.sql b/update/2_4_55.sql index 78d7e95da..0e71d516a 100644 --- a/update/2_4_55.sql +++ b/update/2_4_55.sql @@ -582,4 +582,9 @@ ORDER BY -- Fix per errore creazione tabella an_sedi_tecnici v. 2.4.52 ALTER TABLE `an_sedi_tecnici` CHANGE `updated_at` `updated_at` TIMESTAMP NULL on update CURRENT_TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; -ALTER TABLE `an_sedi_tecnici` CHANGE `created_at` `created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; \ No newline at end of file +ALTER TABLE `an_sedi_tecnici` CHANGE `created_at` `created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; + + +-- Aggiunto flag "Fatture Elettroniche" in segmenti +ALTER TABLE `zz_segments` ADD `for_fe` BOOLEAN NOT NULL AFTER `autofatture`; +UPDATE `zz_segments` SET `for_fe` = '1' WHERE `zz_segments`.`id_module` = (SELECT `id` FROM `zz_modules` WHERE name = 'Fatture di vendita') OR `zz_segments`.`id_module` = (SELECT `id` FROM `zz_modules` WHERE name = 'Fatture di acquisto') AND `is_sezionale` = 1 AND `is_fiscale` = 1 AND `name` NOT LIKE '%non elettroniche%'; \ No newline at end of file