- {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$name$", "extra": "" ]}
+ {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$title$", "extra": "" ]}
diff --git a/modules/tipi_anagrafiche/actions.php b/modules/tipi_anagrafiche/actions.php
index 5be2ada16..b42514e7d 100755
--- a/modules/tipi_anagrafiche/actions.php
+++ b/modules/tipi_anagrafiche/actions.php
@@ -30,6 +30,9 @@ switch (post('op')) {
if (!in_array($descrizione, $block)) {
$tipo->setTranslation('title', $descrizione);
+ if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
+ $tipo->name = $descrizione;
+ }
$tipo->save();
flash()->info(tr('Informazioni salvate correttamente!'));
} else {
@@ -50,6 +53,9 @@ switch (post('op')) {
flash()->error(tr('Nome già esistente!'));
} else {
$tipo = Tipo::build($descrizione);
+ if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
+ $tipo->name = $descrizione;
+ }
$id_record = $dbo->lastInsertedID();
$tipo->setTranslation('title', $descrizione);
$tipo->save();
diff --git a/modules/tipi_anagrafiche/edit.php b/modules/tipi_anagrafiche/edit.php
index f530f804d..7a735f0f5 100755
--- a/modules/tipi_anagrafiche/edit.php
+++ b/modules/tipi_anagrafiche/edit.php
@@ -51,7 +51,7 @@ if (!empty($record['default'])) {
- {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$name$", "extra": "" ]}
+ {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$title$", "extra": "" ]}
diff --git a/modules/tipi_documento/actions.php b/modules/tipi_documento/actions.php
index ada4780c3..2927fd44d 100644
--- a/modules/tipi_documento/actions.php
+++ b/modules/tipi_documento/actions.php
@@ -35,6 +35,9 @@ switch (filter('op')) {
if (!empty($predefined)) {
$dbo->query('UPDATE `co_tipidocumento` SET `predefined` = 0 WHERE `dir` = '.prepare($dir));
}
+ if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
+ $tipo->name = $descrizione;
+ }
$tipo->dir = $dir;
$tipo->codice_tipo_documento_fe = $codice_tipo_documento_fe;
$tipo->help = filter('help');
@@ -61,6 +64,9 @@ switch (filter('op')) {
flash()->error(tr('Questa combinazione di nome, codice e direzione è già stata utilizzata per un altro tipo di documento.'));
} else {
$tipo = Tipo::build($dir, $codice_tipo_documento_fe);
+ if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
+ $tipo->name = $descrizione;
+ }
$id_record = $dbo->lastInsertedID();
$tipo->setTranslation('title', $descrizione);
$tipo->save();
diff --git a/modules/tipi_documento/edit.php b/modules/tipi_documento/edit.php
index af9bd5a12..965b82b68 100644
--- a/modules/tipi_documento/edit.php
+++ b/modules/tipi_documento/edit.php
@@ -27,7 +27,7 @@ use Models\Module;
- {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$name$" ]}
+ {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$title$" ]}
diff --git a/modules/tipi_intervento/actions.php b/modules/tipi_intervento/actions.php
index 5bcc96c63..7a986d5d6 100755
--- a/modules/tipi_intervento/actions.php
+++ b/modules/tipi_intervento/actions.php
@@ -23,6 +23,9 @@ include_once __DIR__.'/../../core.php';
switch (post('op')) {
case 'update':
+ if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
+ $tipo->name = $descrizione;
+ }
$tipo->calcola_km = post('calcola_km');
$tipo->tempo_standard = post('tempo_standard');
$tipo->costo_orario = post('costo_orario');
@@ -70,6 +73,9 @@ switch (post('op')) {
$costo_diritto_chiamata_tecnico = post('costo_diritto_chiamata_tecnico');
$tipo = Tipo::build($codice, $calcola_km, $tempo_standard, $costo_orario, $costo_km, $costo_diritto_chiamata, $costo_orario_tecnico, $costo_km_tecnico, $costo_diritto_chiamata_tecnico);
+ if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
+ $tipo->name = $descrizione;
+ }
$id_record = $dbo->lastInsertedID();
$tipo->setTranslation('title', post('descrizione'));
$tipo->save();
diff --git a/modules/tipi_intervento/edit.php b/modules/tipi_intervento/edit.php
index 2e80e7517..8571f7655 100755
--- a/modules/tipi_intervento/edit.php
+++ b/modules/tipi_intervento/edit.php
@@ -30,7 +30,7 @@ include_once __DIR__.'/../../core.php';
- {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$name$" ]}
+ {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$title$" ]}
diff --git a/modules/tipi_intervento/src/FasciaOraria.php b/modules/tipi_intervento/src/FasciaOraria.php
new file mode 100644
index 000000000..b40f093d1
--- /dev/null
+++ b/modules/tipi_intervento/src/FasciaOraria.php
@@ -0,0 +1,45 @@
+.
+ */
+
+namespace Modules\TipiIntervento;
+
+use Common\SimpleModelTrait;
+use Illuminate\Database\Eloquent\Model;
+use Traits\RecordTrait;
+
+class FasciaOraria extends Model
+{
+ use SimpleModelTrait;
+ use RecordTrait;
+ protected $table = 'in_fasceorarie';
+
+ protected static $translated_fields = [
+ 'title',
+ ];
+
+ public function getModuleAttribute()
+ {
+ return 'Fasce orarie';
+ }
+
+ public static function getTranslatedFields()
+ {
+ return self::$translated_fields;
+ }
+}
diff --git a/modules/tipi_scadenze/actions.php b/modules/tipi_scadenze/actions.php
index 8db25b195..52454c255 100755
--- a/modules/tipi_scadenze/actions.php
+++ b/modules/tipi_scadenze/actions.php
@@ -19,6 +19,7 @@
include_once __DIR__.'/../../core.php';
use Models\Module;
+use Modules\Scadenzario\Tipo;
switch (filter('op')) {
case 'update':
@@ -27,15 +28,16 @@ switch (filter('op')) {
if (isset($nome)) {
// Se non esiste già una tipo di scadenza con lo stesso nome
- $nome_new = $dbo->fetchOne('SELECT * FROM `co_tipi_scadenze` LEFT JOIN `co_tipi_scadenze_lang` ON (`co_tipi_scadenze_lang`.`id_record` = `co_tipi_scadenze`.`id` AND `co_tipi_scadenze_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `title` = '.prepare($nome).' AND `co_tipi_scadenze_lang`.`id_record` != '.prepare($id_record));
+ $nome_new = Tipo::where('id', '=', (new Tipo())->getByField('title', $descrizione))->where('id', '!=', $id_record)->first();
+ $nome_prev = $tipo->getTranslation('title');
if (empty($nome_new)) {
// nome_prev
- $nome_prev = $dbo->fetchOne('SELECT `title` AS nome_prev FROM `co_tipi_scadenze` LEFT JOIN `co_tipi_scadenze_lang` ON (`co_tipi_scadenze_lang`.`id_record` = `co_tipi_scadenze`.`id` AND `co_tipi_scadenze_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `co_tipi_scadenze`.`id`='.prepare($id_record))['nome_prev'];
-
- $dbo->update('co_tipi_scadenze_lang', [
- 'name' => $nome,
- 'description' => $descrizione,
- ], ['id_record' => $id_record, 'id_lang' => Models\Locale::getDefault()->id]);
+ $tipo->setTranslation('title', $descrizione);
+ if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
+ $tipo->name = $nome;
+ }
+ $tipo->save();
+ flash()->info(tr('Salvataggio completato.'));
$segmento = $dbo->fetchOne('SELECT `zz_segments`.`id` FROM `zz_segments` LEFT JOIN `zz_segments_lang` ON (`zz_segments_lang`.`id_record` = `zz_segments`.`id` AND `zz_segments_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `id_module` = '.prepare((new Module())->getByField('title', 'Scadenzario', Models\Locale::getPredefined()->id)).' AND `clause` = "co_scadenziario.tipo=\''.$nome_prev.'\'" AND `zz_segments_lang`.`title` = "Scadenzario '.$nome_prev.'"')['id'];
@@ -47,7 +49,7 @@ switch (filter('op')) {
]);
$dbo->update('zz_segments_lang', [
- 'name' => 'Scadenzario '.$nome,
+ 'title' => 'Scadenzario '.$nome,
], [
'id_record' => $segmento,
'id_lang' => Models\Locale::getDefault()->id,
@@ -72,17 +74,16 @@ switch (filter('op')) {
if (isset($nome)) {
// Se non esiste già un tipo di scadenza con lo stesso nome
- if (empty($dbo->fetchArray('SELECT * FROM `co_tipi_scadenze` LEFT JOIN `co_tipi_scadenze_lang` ON (`co_tipi_scadenze_lang`.`id_record` = `co_tipi_scadenze`.`id` AND `co_tipi_scadenze_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `title`='.prepare($nome)))) {
- $dbo->insert('co_tipi_scadenze', [
- 'created_at' => 'NOW()',
- ]);
+ if (empty(Tipo::where('id', '=', (new Tipo())->getByField('title', $descrizione))->where('id', '!=', $id_record)->first())) {
+ $tipo = tipo::build();
+ if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
+ $tipo->name = $nome;
+ }
+ $tipo->save();
+
$id_record = $dbo->lastInsertedID();
- $dbo->insert('co_tipi_scadenze_lang', [
- 'name' => $nome,
- 'description' => $descrizione,
- 'id_record' => $id_record,
- 'id_lang' => Models\Locale::getDefault()->id,
- ]);
+ $tipo->setTranslation('title', $descrizione);
+ $tipo->save();
// Aggiungo anche il segmento
$dbo->insert('zz_segments', [
@@ -92,7 +93,7 @@ switch (filter('op')) {
]);
$id_segment = $dbo->lastInsertedID();
$dbo->insert('zz_segments_lang', [
- 'name' => 'Scadenzario '.$nome,
+ 'title' => 'Scadenzario '.$nome,
'id_record' => $id_segment,
'id_lang' => Models\Locale::getDefault()->id,
]);
diff --git a/modules/tipi_scadenze/edit.php b/modules/tipi_scadenze/edit.php
index f569ce135..ff98a3d58 100755
--- a/modules/tipi_scadenze/edit.php
+++ b/modules/tipi_scadenze/edit.php
@@ -47,7 +47,7 @@ if ($record['can_delete'] and empty($scadenze)) {
- {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$description$" ]}
+ {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$title$" ]}
diff --git a/modules/tipi_scadenze/init.php b/modules/tipi_scadenze/init.php
index 8aa8f183e..a87c22af8 100755
--- a/modules/tipi_scadenze/init.php
+++ b/modules/tipi_scadenze/init.php
@@ -17,8 +17,12 @@
* along with this program. If not, see
.
*/
+use Modules\Scadenzario\Tipo;
+
include_once __DIR__.'/../../core.php';
if (!empty($id_record)) {
$record = $dbo->fetchOne('SELECT *, `co_tipi_scadenze`.`id` as id FROM `co_tipi_scadenze` LEFT JOIN `co_tipi_scadenze_lang` ON (`co_tipi_scadenze_lang`.`id_record` = `co_tipi_scadenze`.`id` AND `co_tipi_scadenze_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `co_tipi_scadenze`.`id`='.prepare($id_record));
+
+ $tipo = Tipo::find($id_record);
}
diff --git a/src/HTMLBuilder/Manager/ButtonManager.php b/src/HTMLBuilder/Manager/ButtonManager.php
index 08b5ec9db..2e8e5c134 100755
--- a/src/HTMLBuilder/Manager/ButtonManager.php
+++ b/src/HTMLBuilder/Manager/ButtonManager.php
@@ -126,10 +126,10 @@ class ButtonManager implements ManagerInterface
$results = \Prints::getModulePrints($options['id_module']);
} elseif ($options['type'] == 'email') {
$results = TemplateEmail::where('id_module', $options['id_module'])->with(['translations' => function ($query) {
- $query->orderBy('name');
+ $query->orderBy('title');
}])->get()->toArray();
} elseif ($options['type'] == 'sms') {
- $results = TemplateSMS::where('id_module', $options['id_module'])->orderBy('name')->get()->toArray();
+ $results = TemplateSMS::where('id_module', $options['id_module'])->orderBy('title')->get()->toArray();
}
return $results;
diff --git a/update/2_5.sql b/update/2_5.sql
index 323a46b22..7601b82cf 100644
--- a/update/2_5.sql
+++ b/update/2_5.sql
@@ -224,8 +224,6 @@ HAVING
2=2" WHERE `name` = 'Tipi di anagrafiche';
UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`an_tipianagrafiche`.`id`' WHERE `zz_modules`.`name` = 'Tipi di anagrafiche' AND `zz_views`.`name` = 'id';
-UPDATE `zz_settings` SET `tipo` = 'query=SELECT `an_anagrafiche`.`idanagrafica` AS id, `ragione_sociale` AS descrizione FROM `an_anagrafiche` INNER JOIN `an_tipianagrafiche_anagrafiche` ON `an_anagrafiche`.`idanagrafica` = `an_tipianagrafiche_anagrafiche`.`idanagrafica` WHERE `idtipoanagrafica` = (SELECT `an_tipianagrafiche`.`id` FROM `an_tipianagrafiche` LEFT JOIN `an_tipianagrafiche_lang` ON(`an_tipianagrafiche`.`id` = `an_tipianagrafiche_lang`.`id_record`) WHERE `name` = \'Azienda\') AND `deleted_at` IS NULL' WHERE `zz_settings`.`nome` = 'Azienda predefinita';
-
-- Aggiunta tabella co_iva_lang
CREATE TABLE IF NOT EXISTS `co_iva_lang` (
`id` int NOT NULL,
@@ -1639,7 +1637,6 @@ WHERE
HAVING
2=2" WHERE `zz_modules`.`id` = (SELECT `id_record` FROM `zz_modules_lang` WHERE `name` = 'Tipi scadenze');
UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` LEFT JOIN `zz_modules_lang` ON (`zz_modules_lang`.`id_record` = `zz_modules`.`id` AND `zz_modules_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `nome` = "Lingua")) SET `zz_views`.`query` = '`co_tipi_scadenze`.`id`' WHERE `zz_modules_lang`.`name` = 'Tipi scadenze' AND `zz_views`.`name` = 'id';
-UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` LEFT JOIN `zz_modules_lang` ON (`zz_modules_lang`.`id_record` = `zz_modules`.`id` AND `zz_modules_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `nome` = "Lingua")) SET `zz_views`.`query` = '`co_tipi_scadenze_lang`.`description`' WHERE `zz_modules_lang`.`name` = 'Tipi scadenze' AND `zz_views`.`name` = 'Descrizione';
-- Aggiunta tabella zz_segments_lang
CREATE TABLE IF NOT EXISTS `zz_segments_lang` (
diff --git a/update/2_5_1.php b/update/2_5_1.php
index cea873434..f4578d43f 100644
--- a/update/2_5_1.php
+++ b/update/2_5_1.php
@@ -138,6 +138,9 @@ if (!$has_name) {
if (database()->columnExists('co_tipi_scadenze_lang', 'name')) {
$database->query('ALTER TABLE `co_tipi_scadenze_lang` DROP `name`');
}
+if (database()->columnExists('co_tipi_scadenze_lang', 'description')) {
+ $database->query('ALTER TABLE `co_tipi_scadenze_lang` CHANGE `description` `title` VARCHAR(255) NOT NULL');
+}
// Controllo se è presente il campo name in do_categorie
$has_name = database()->columnExists('do_categorie', 'name');
diff --git a/update/2_5_1.sql b/update/2_5_1.sql
index 0aaf54161..ac970c0c0 100644
--- a/update/2_5_1.sql
+++ b/update/2_5_1.sql
@@ -378,9 +378,6 @@ ALTER TABLE `zz_settings_lang` CHANGE `help` `help` VARCHAR(500) NULL;
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`) VALUES (NULL, 'Visualizza numero ordine cliente', '1', 'boolean', '1', 'Ordini', NULL);
INSERT INTO `zz_settings_lang` (`id_record`, `id_lang`, `title`, `help`) VALUES ((SELECT `id` FROM `zz_settings` WHERE `nome` = 'Visualizza numero ordine cliente'), (SELECT `valore` FROM `zz_settings` WHERE `nome` = "Lingua"), 'Visualizza numero ordine cliente', 'Se abilitata, utilizza nei documenti il numero d\'ordine del cliente al posto del numero interno dell\'ordine');
--- Allineamento impostazioni
-UPDATE `zz_settings` SET `tipo` = 'query=SELECT `zz_prints`.`id`, `zz_prints_lang`.`name` AS descrizione FROM `zz_prints` LEFT JOIN `zz_prints_lang` ON (`zz_prints_lang`.`id_record` = `zz_prints`.`id` AND `zz_prints_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `nome` = "Lingua")) WHERE `id_module` = (SELECT `zz_modules`.`id` FROM `zz_modules` LEFT JOIN `zz_modules_lang` ON (`zz_modules_lang`.`id_record` = `zz_modules`.`id` AND `zz_modules_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `nome` = "Lingua")) WHERE `name` = "Interventi") AND `is_record` = 1' WHERE `zz_settings`.`nome` = 'Stampa per anteprima e firma';
-
-- Allineamento vista Gestione documentale
UPDATE `zz_modules` SET `options` = "
SELECT
@@ -922,7 +919,7 @@ UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_module
UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`zz_segments_lang`.`title`' WHERE `zz_modules`.`name` = 'Tipi documento' AND `zz_views`.`name` = 'Sezionale';
-- Allineamento vista Tipi scadenze
-UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`co_tipi_scadenze_lang`.`title`' WHERE `zz_modules`.`name` = 'Tipi scadenze' AND `zz_views`.`name` = 'Nome';
+UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`co_tipi_scadenze`.`name`' WHERE `zz_modules`.`name` = 'Tipi scadenze' AND `zz_views`.`name` = 'Nome';
UPDATE `zz_widgets` SET `query` = "SELECT\n CONCAT_WS(\' \', REPLACE(REPLACE(REPLACE(FORMAT((\n SELECT SUM(\n (`co_righe_documenti`.`subtotale` - `co_righe_documenti`.`sconto`) * IF(`co_tipidocumento`.`reversed`, -1, 1)\n )\n ), 2), \',\', \'#\'), \'.\', \',\'), \'#\', \'.\'), \'€\') AS dato\nFROM \n `co_righe_documenti`\n INNER JOIN `co_documenti` ON `co_righe_documenti`.`iddocumento` = `co_documenti`.`id`\n INNER JOIN `co_tipidocumento` ON `co_documenti`.`idtipodocumento` = `co_tipidocumento`.`id`\n INNER JOIN `co_statidocumento` ON `co_documenti`.`idstatodocumento` = `co_statidocumento`.`id`\n LEFT JOIN `co_statidocumento_lang` ON (`co_statidocumento`.`id` = `co_statidocumento_lang`.`id_record` AND `co_statidocumento_lang`.|lang|)\nWHERE \n `co_statidocumento_lang`.`title`!=\'Bozza\' AND `co_tipidocumento`.`dir`=\'entrata\' |segment(`co_documenti`.`id_segment`)| AND `data` >= \'|period_start|\' AND `data` <= \'|period_end|\' AND 1=1" WHERE `zz_widgets`.`name` = 'Fatturato';
@@ -944,4 +941,13 @@ UPDATE `zz_widgets` SET `query` = 'SELECT COUNT(`dati`.`id`) AS dato FROM (SELEC
UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`zz_plugins_lang`.`title`' WHERE `zz_modules`.`name` = 'Campi personalizzati' AND `zz_views`.`name` = 'Plugin';
UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`zz_plugins_lang`.`title`' WHERE `zz_modules`.`name` = 'Checklists' AND `zz_views`.`name` = 'Plugin';
UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`categoria_lang`.`title`' WHERE `zz_modules`.`name` = 'Giacenze sedi' AND `zz_views`.`name` = 'Categoria';
-UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`sottocategoria_lang`.`title`' WHERE `zz_modules`.`name` = 'Giacenze sedi' AND `zz_views`.`name` = 'Sottocategoria';
\ No newline at end of file
+UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`sottocategoria_lang`.`title`' WHERE `zz_modules`.`name` = 'Giacenze sedi' AND `zz_views`.`name` = 'Sottocategoria';
+
+
+-- Allineamento impostazioni
+UPDATE `zz_settings` SET `tipo` = 'query=SELECT `zz_prints`.`id`, `zz_prints_lang`.`title` AS descrizione FROM `zz_prints` LEFT JOIN `zz_prints_lang` ON (`zz_prints_lang`.`id_record` = `zz_prints`.`id` AND `zz_prints_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `nome` = "Lingua")) WHERE `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = "Interventi") AND `is_record` = 1' WHERE `zz_settings`.`nome` = 'Stampa per anteprima e firma';
+
+UPDATE `zz_settings` SET `tipo` = 'query=SELECT `an_anagrafiche`.`idanagrafica` AS id, `ragione_sociale` AS descrizione FROM `an_anagrafiche` INNER JOIN `an_tipianagrafiche_anagrafiche` ON `an_anagrafiche`.`idanagrafica` = `an_tipianagrafiche_anagrafiche`.`idanagrafica` WHERE `idtipoanagrafica` = (SELECT `an_tipianagrafiche`.`id` FROM `an_tipianagrafiche` LEFT JOIN `an_tipianagrafiche_lang` ON(`an_tipianagrafiche`.`id` = `an_tipianagrafiche_lang`.`id_record`) WHERE `title` = \'Azienda\') AND `deleted_at` IS NULL' WHERE `zz_settings`.`nome` = 'Azienda predefinita';
+
+UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`co_tipi_scadenze_lang`.`title`' WHERE `zz_modules`.`name` = 'Tipi scadenze' AND `zz_views`.`name` = 'Descrizione';
+UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`dt_causalet_lang`.`title`' WHERE `zz_modules`.`name` = 'Causali' AND `zz_views`.`name` = 'Descrizione';
\ No newline at end of file