Fix minore

This commit is contained in:
Pek5892 2024-03-11 16:15:49 +01:00
parent 407e04ee17
commit 169df3fc07
9 changed files with 49 additions and 82 deletions

View File

@ -212,7 +212,13 @@ echo '
}); });
</script>'; </script>';
$custom_css = $dbo->isInstalled() ? html_entity_decode(setting('CSS Personalizzato')) : ''; if ($dbo->isInstalled()) {
try {
$custom_css = html_entity_decode(setting('CSS Personalizzato'));
} catch (QueryException $e) {
}
}
if (!empty($custom_css)) { if (!empty($custom_css)) {
echo ' echo '
<style>'.$custom_css.'</style>'; <style>'.$custom_css.'</style>';

View File

@ -106,7 +106,7 @@ function get($param, $raw = false)
*/ */
function setting($name, $again = false) function setting($name, $again = false)
{ {
return Setting::find((new Setting())->getByName($name)->id_record)->valore; return Settings::getValue($name);
} }
/** /**

View File

@ -164,7 +164,7 @@ if ($smtp['pec'] == 1 && $module['name'] == 'Fatture di vendita') {
echo ' echo '
<div class="col-md-6"> <div class="col-md-6">
{[ "type": "select", "multiple": "1", "label": "'.tr('Allegati').'", "name": "uploads[]", "value": "'.implode(',', $uploads).'", "help": "'.tr('Allegati del documento o caricati nell\'anagrafica dell\'azienda.').'", "values": "query=SELECT `id`, `name` AS text FROM `zz_files` WHERE `id_module` = '.prepare($id_module).' AND `id_record` = '.prepare($id_record).' UNION SELECT `id`, CONCAT(`name`, \' (Azienda)\') AS text FROM `zz_files` WHERE `id_module` = '.(new Module())->getByName('Anagrafiche')->id_record.' AND `id_record` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON (`zz_settings`.`id` = `zz_settings_lang`.`id_record` AND `zz_settings_lang`.`id_lang` = '.prepare(setting('Lingua')).') WHERE `name` = \'Azienda predefinita\')", "link": "allegato" ]} {[ "type": "select", "multiple": "1", "label": "'.tr('Allegati').'", "name": "uploads[]", "value": "'.implode(',', $uploads).'", "help": "'.tr('Allegati del documento o caricati nell\'anagrafica dell\'azienda.').'", "values": "query=SELECT `id`, `name` AS text FROM `zz_files` WHERE `id_module` = '.prepare($id_module).' AND `id_record` = '.prepare($id_record).' UNION SELECT `id`, CONCAT(`name`, \' (Azienda)\') AS text FROM `zz_files` WHERE `id_module` = '.(new Module())->getByName('Anagrafiche')->id_record.' AND `id_record` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \'Azienda predefinita\')", "link": "allegato" ]}
</div> </div>
</div>'; </div>';

View File

@ -30,7 +30,7 @@ class Impostazioni extends AppResource
public function getModifiedRecords($last_sync_at) public function getModifiedRecords($last_sync_at)
{ {
$query = "SELECT `zz_settings`.`id`, `zz_settings`.`updated_at` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON (`zz_settings`.`id` = `zz_settings_lang`.`id_record` AND `zz_settings_lang`.`id_lang` = ".prepare(setting('Lingua')).") WHERE (`sezione` = 'Applicazione'"; $query = "SELECT `zz_settings`.`id`, `zz_settings`.`updated_at` FROM `zz_settings` WHERE `sezione` = 'Applicazione'";
// Aggiunta delle impostazioni esterne alla sezione Applicazione // Aggiunta delle impostazioni esterne alla sezione Applicazione
$impostazioni_esterne = $this->getImpostazioniEsterne(); $impostazioni_esterne = $this->getImpostazioniEsterne();

View File

@ -50,21 +50,6 @@ class Setting extends Model
return $value; return $value;
} }
/**
* Ritorna l'attributo name dell'impostazione.
*
* @return string
*/
public function getNameAttribute()
{
return database()->table($this->table.'_lang')
->select('name')
->where('id_record', '=', $this->id)
->where('id_lang', '=', setting('Lingua'))
->first()->name;
}
/** /**
* Ritorna l'attributo title dell'impostazione. * Ritorna l'attributo title dell'impostazione.
* *
@ -72,29 +57,10 @@ class Setting extends Model
*/ */
public function getTitleAttribute() public function getTitleAttribute()
{ {
$lang = database()->query('SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings`.`id` = `zz_settings_lang`.`id_record` WHERE `name` = "Lingua"');
return database()->table($this->table.'_lang') return database()->table($this->table.'_lang')
->select('title') ->select('title')
->where('id_record', '=', $this->id) ->where('id_record', '=', $this->id)
->where('id_lang', '=', $lang) ->where('id_lang', '=', setting('Lingua'))
->first()->title; ->first()->title;
} }
/**
* Ritorna l'id dell'impostazione a partire dal nome.
*
* @param string $name il nome da ricercare
*
* @return \Illuminate\Support\Collection
*/
public function getByName($name)
{
$lang = database()->query('SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings`.`id` = `zz_settings_lang`.`id_record` WHERE `name` = "Lingua"');
return database()->table($this->table.'_lang')
->select('id_record')
->where('name', '=', $name)
->where('id_lang', '=', $lang)
->first();
}
} }

View File

@ -33,7 +33,7 @@ class Settings
protected static $sections = []; protected static $sections = [];
/** /**
* Restituisce tutte le informazioni di tutte le impostazioni presenti. * Restituisce tutte le informazioni di tutti le impostazioni presenti.
* *
* @return array * @return array
*/ */
@ -44,11 +44,11 @@ class Settings
$references = []; $references = [];
$sections = []; $sections = [];
$results = Setting::get()->toArray(); $results = Setting::all();
foreach ($results as $result) { foreach ($results as $result) {
$settings[$result['id']] = $result; $settings[$result->id] = $result;
$references[$result['name']] = $result->id; $references[$result->nome] = $result->id;
if (!isset($sections[$result['sezione']])) { if (!isset($sections[$result['sezione']])) {
$sections[$result['sezione']] = []; $sections[$result['sezione']] = [];
@ -91,7 +91,7 @@ class Settings
*/ */
public static function getValue($setting) public static function getValue($setting)
{ {
return Setting::find((new Setting())->getByName($setting)->id_record)->valore; return self::get($setting)->valore;
} }
/** /**
@ -103,7 +103,7 @@ class Settings
*/ */
public static function setValue($setting, $value) public static function setValue($setting, $value)
{ {
$setting = Setting::find($setting); $setting = self::get($setting);
$value = (is_array($value) ? implode(',', $value) : $value); $value = (is_array($value) ? implode(',', $value) : $value);
// Trasformazioni // Trasformazioni
@ -155,7 +155,7 @@ class Settings
*/ */
public static function input($setting, $required = false) public static function input($setting, $required = false)
{ {
$setting = Setting::find($setting); $setting = self::get($setting);
// Lista predefinita // Lista predefinita
if (preg_match("/list\[(.+?)\]/", $setting->tipo, $m)) { if (preg_match("/list\[(.+?)\]/", $setting->tipo, $m)) {
@ -170,7 +170,7 @@ class Settings
} }
$result = ' $result = '
{[ "type": "select", "multiple": 0, "label": '.json_encode($setting->name).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "values": '.json_encode($list).', "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}'; {[ "type": "select", "multiple": 0, "label": '.json_encode($setting->nome).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "values": '.json_encode($list).', "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}';
} }
// Lista multipla // Lista multipla
@ -203,26 +203,26 @@ class Settings
} }
$result = ' $result = '
{[ "type": "select", "multiple": 1, "label": '.json_encode($setting->name).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.'][]", "values": '.json_encode($list).', "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}'; {[ "type": "select", "multiple": 1, "label": '.json_encode($setting->nome).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.'][]", "values": '.json_encode($list).', "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}';
} }
// Lista da query // Lista da query
elseif (preg_match('/^query=(.+?)$/', $setting->tipo, $m)) { elseif (preg_match('/^query=(.+?)$/', $setting->tipo, $m)) {
$result = ' $result = '
{[ "type": "select", "label": '.json_encode($setting->name).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "values": "'.str_replace('"', '\"', $setting->tipo).'", "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}'; {[ "type": "select", "label": '.json_encode($setting->nome).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "values": "'.str_replace('"', '\"', $setting->tipo).'", "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}';
} }
// Boolean (checkbox) // Boolean (checkbox)
elseif ($setting->tipo == 'boolean') { elseif ($setting->tipo == 'boolean') {
$result = ' $result = '
{[ "type": "checkbox", "label": '.json_encode($setting->name).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "placeholder": "'.tr('Attivo').'", "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}'; {[ "type": "checkbox", "label": '.json_encode($setting->nome).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "placeholder": "'.tr('Attivo').'", "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}';
} }
// Editor // Editor
elseif ($setting->tipo == 'ckeditor') { elseif ($setting->tipo == 'ckeditor') {
$result = input([ $result = input([
'type' => 'ckeditor', 'type' => 'ckeditor',
'label' => json_encode($setting->name), 'label' => json_encode($setting->nome),
'readonly' => !$setting->editable, 'readonly' => !$setting->editable,
'name' => 'setting['.$setting->id.']', 'name' => 'setting['.$setting->id.']',
'value' => $setting->valore, 'value' => $setting->valore,
@ -234,18 +234,18 @@ class Settings
// Campi di default // Campi di default
elseif (in_array($setting->tipo, ['textarea', 'timestamp', 'date', 'time'])) { elseif (in_array($setting->tipo, ['textarea', 'timestamp', 'date', 'time'])) {
$result = ' $result = '
{[ "type": "'.$setting->tipo.'", "label": '.json_encode($setting->name).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "value": '.json_encode($setting->valore).', "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}'; {[ "type": "'.$setting->tipo.'", "label": '.json_encode($setting->nome).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "value": '.json_encode($setting->valore).', "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}';
} }
// Campo di testo // Campo di testo
else { else {
$numerico = in_array($setting->tipo, ['integer', 'decimal']); $numerico = in_array($setting->tipo, ['integer', 'decimal']);
$tipo = preg_match('/password/i', $setting->name, $m) ? 'password' : $setting->tipo; $tipo = preg_match('/password/i', $setting->nome, $m) ? 'password' : $setting->tipo;
$tipo = $numerico ? 'number' : 'text'; $tipo = $numerico ? 'number' : 'text';
$result = ' $result = '
{[ "type": "'.$tipo.'", "label": '.json_encode($setting->name).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "value": "'.$setting->valore.'"'.($numerico && $setting->tipo == 'integer' ? ', "decimals": 0' : '').', "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}'; {[ "type": "'.$tipo.'", "label": '.json_encode($setting->nome).', "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "value": "'.$setting->valore.'"'.($numerico && $setting->tipo == 'integer' ? ', "decimals": 0' : '').', "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}';
} }
return $result; return $result;

View File

@ -20,8 +20,6 @@
use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem; use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem;
use Models\Cache; use Models\Cache;
use Models\Setting;
/** /**
* Classe dedicata alla gestione delle procedure di aggiornamento del database del progetto. * Classe dedicata alla gestione delle procedure di aggiornamento del database del progetto.
* *
@ -422,7 +420,7 @@ class Update
public static function getSettings() public static function getSettings()
{ {
$settings = Setting::get()->toArray(); $settings = database()->table('zz_settings')->pluck('tipo', 'nome')->toArray();
return $settings; return $settings;
} }

View File

@ -20,7 +20,6 @@
include_once __DIR__.'/../../core.php'; include_once __DIR__.'/../../core.php';
use Carbon\Carbon; use Carbon\Carbon;
use Models\Module; use Models\Module;
use Models\Setting;
$date_start = filter('date_start'); $date_start = filter('date_start');
$date_end = filter('date_end'); $date_end = filter('date_end');
@ -28,8 +27,8 @@ $date_end = filter('date_end');
$anno_precedente_start = (new Carbon($date_start))->subYears(1)->format('Y-m-d'); $anno_precedente_start = (new Carbon($date_start))->subYears(1)->format('Y-m-d');
$anno_precedente_end = (new Carbon($date_end))->subYears(1)->format('Y-m-d'); $anno_precedente_end = (new Carbon($date_end))->subYears(1)->format('Y-m-d');
$periodo = Setting::find((new Setting())->getByName('Liquidazione IVA')->id_record)->valore;
if ($periodo == 'Mensile') { if (setting('Liquidazione IVA') == 'Mensile') {
$periodo_precedente_start = (new Carbon($date_start))->subMonth()->format('Y-m-d'); $periodo_precedente_start = (new Carbon($date_start))->subMonth()->format('Y-m-d');
$periodo_precedente_end = (new Carbon($date_end))->subMonth()->format('Y-m-d'); $periodo_precedente_end = (new Carbon($date_end))->subMonth()->format('Y-m-d');
} else { } else {

View File

@ -2086,52 +2086,50 @@ CREATE TABLE IF NOT EXISTS `zz_settings_lang` (
`id` int NOT NULL, `id` int NOT NULL,
`id_lang` int NOT NULL, `id_lang` int NOT NULL,
`id_record` int NOT NULL, `id_record` int NOT NULL,
`name` VARCHAR(255) NOT NULL,
`title` VARCHAR(255) NOT NULL `title` VARCHAR(255) NOT NULL
); );
ALTER TABLE `zz_settings` CHANGE `nome` `name` VARCHAR(255) NOT NULL;
ALTER TABLE `zz_settings_lang` ALTER TABLE `zz_settings_lang`
ADD PRIMARY KEY (`id`); ADD PRIMARY KEY (`id`);
ALTER TABLE `zz_settings_lang` ALTER TABLE `zz_settings_lang`
MODIFY `id` int NOT NULL AUTO_INCREMENT; MODIFY `id` int NOT NULL AUTO_INCREMENT;
INSERT INTO `zz_settings_lang` (`id`, `id_lang`, `id_record`, `name`, `title`) SELECT NULL, (SELECT `id` FROM `zz_langs` WHERE `iso_code` = 'it'), `id`, `nome`, `nome` FROM `zz_settings`; INSERT INTO `zz_settings_lang` (`id`, `id_lang`, `id_record`, `title`) SELECT NULL, (SELECT `id` FROM `zz_langs` WHERE `iso_code` = 'it'), `id`, `nome`, FROM `zz_settings`;
ALTER TABLE `zz_settings`
DROP `nome`;
ALTER TABLE `zz_settings_lang` ADD CONSTRAINT `zz_settings_lang_ibfk_1` FOREIGN KEY (`id_record`) REFERENCES `zz_settings`(`id`) ON DELETE CASCADE ON UPDATE RESTRICT; ALTER TABLE `zz_settings_lang` ADD CONSTRAINT `zz_settings_lang_ibfk_1` FOREIGN KEY (`id_record`) REFERENCES `zz_settings`(`id`) ON DELETE CASCADE ON UPDATE RESTRICT;
-- Allineamento impostazioni -- Allineamento impostazioni
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `id`, `title` AS descrizione FROM `zz_prints` 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` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = Lingua)) WHERE `name` = "Interventi") AND `is_record` = 1' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = 'Stampa per anteprima e firma'); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `id`, `title` AS descrizione FROM `zz_prints` 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 `name` = Lingua)) WHERE `name` = "Interventi") AND `is_record` = 1' WHERE `zz_settings`.`name` = 'Stampa per anteprima e firma';
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `in_statiintervento`.`id`, `name` AS text FROM `in_statiintervento` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_statiintervento`.`id` AND `in_statiintervento_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = "Lingua")) WHERE is_completato = 1' WHERE `zz_settings`.`id` = (SELECT id_record FROM `zz_settings_lang` WHERE `name` = "Stato dell'attività alla chiusura"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `in_statiintervento`.`id`, `name` AS text FROM `in_statiintervento` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_statiintervento`.`id` AND `in_statiintervento_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = "Lingua")) WHERE is_completato = 1' WHERE `zz_settings`.`name` = "Stato dell'attività alla chiusura";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `in_statiintervento`.`id`, `name` AS text FROM `in_statiintervento` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_statiintervento`.`id` AND `in_statiintervento_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = "Lingua"))' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Stato dell'attività dopo la firma"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `in_statiintervento`.`id`, `name` AS text FROM `in_statiintervento` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_statiintervento`.`id` AND `in_statiintervento_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = "Lingua"))' WHERE `zz_settings`.`name` = "Stato dell'attività dopo la firma";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `in_statiintervento`.`id`, `name` AS text FROM `in_statiintervento` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_statiintervento`.`id` AND `in_statiintervento_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Stato predefinito dell'attività"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `in_statiintervento`.`id`, `name` AS text FROM `in_statiintervento` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_statiintervento`.`id` AND `in_statiintervento_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`name` = "Stato predefinito dell'attività";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `in_statiintervento`.`id`, `name` AS text FROM `in_statiintervento` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_statiintervento`.`id` AND `in_statiintervento_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Stato predefinito dell'attività da Dashboard"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `in_statiintervento`.`id`, `name` AS text FROM `in_statiintervento` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_statiintervento`.`id` AND `in_statiintervento_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`name` = "Stato predefinito dell'attività da Dashboard";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `co_iva`.`id`, `name` AS text FROM `co_iva` LEFT JOIN `co_iva_lang` ON (`co_iva_lang`.`id_record` = `co_iva`.`id` AND `co_iva_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Iva predefinita"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `co_iva`.`id`, `name` AS text FROM `co_iva` LEFT JOIN `co_iva_lang` ON (`co_iva_lang`.`id_record` = `co_iva`.`id` AND `co_iva_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`name` = "Iva predefinita";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `co_pagamenti`.`id`, `name` AS descrizione FROM `co_pagamenti` LEFT JOIN `co_pagamenti_lang` ON (`co_pagamenti_lang`.`id_record` = `co_pagamenti`.`id` AND `co_pagamenti_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Tipo di pagamento predefinito"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `co_pagamenti`.`id`, `name` AS descrizione FROM `co_pagamenti` LEFT JOIN `co_pagamenti_lang` ON (`co_pagamenti_lang`.`id_record` = `co_pagamenti`.`id` AND `co_pagamenti_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`name` = "Tipo di pagamento predefinito";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `co_iva`.`id`, IF(`codice_natura_fe` IS NULL, IF(`codice` IS NULL, `name`, CONCAT(`codice`, " - ", `name`)), CONCAT( IF(`codice` IS NULL, `name`, CONCAT(`codice`, " - ", `name`)), " (", `codice_natura_fe`, ")" )) AS descrizione FROM `co_iva` LEFT JOIN `co_iva_lang` ON (`co_iva_lang`.`id_record` = `co_iva`.`id` AND `co_iva_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\")) WHERE `deleted_at` IS NULL ORDER BY `name` ASC' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Iva da applicare su marca da bollo"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `co_iva`.`id`, IF(`codice_natura_fe` IS NULL, IF(`codice` IS NULL, `name`, CONCAT(`codice`, " - ", `name`)), CONCAT( IF(`codice` IS NULL, `name`, CONCAT(`codice`, " - ", `name`)), " (", `codice_natura_fe`, ")" )) AS descrizione FROM `co_iva` LEFT JOIN `co_iva_lang` ON (`co_iva_lang`.`id_record` = `co_iva`.`id` AND `co_iva_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"Lingua\")) WHERE `deleted_at` IS NULL ORDER BY `name` ASC' WHERE `zz_settings`.`name` = "Iva da applicare su marca da bollo";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `co_iva`.`id`, CONCAT(`codice`," - ",`name`) AS descrizione FROM `co_iva` LEFT JOIN `co_iva_lang` ON (`co_iva_lang`.`id_record` = `co_iva`.`id` AND `co_iva_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\")) WHERE codice_natura_fe LIKE "N3.%" AND `deleted_at` IS NULL ORDER BY `name` ASC' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Iva per lettere d'intento"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `co_iva`.`id`, CONCAT(`codice`," - ",`name`) AS descrizione FROM `co_iva` LEFT JOIN `co_iva_lang` ON (`co_iva_lang`.`id_record` = `co_iva`.`id` AND `co_iva_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"Lingua\")) WHERE codice_natura_fe LIKE "N3.%" AND `deleted_at` IS NULL ORDER BY `name` ASC' WHERE `zz_settings`.`name` = "Iva per lettere d'intento";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `zz_segments`.`id`, `name` AS descrizione FROM `zz_segments` LEFT JOIN `zz_segments_lang` ON (`zz_segments_lang`.`id_record` = `zz_segments`.`id` AND `zz_segments_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"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` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\")) WHERE `name`="Fatture di vendita") ORDER BY `name`' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Sezionale per autofatture di vendita"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `zz_segments`.`id`, `name` AS descrizione FROM `zz_segments` LEFT JOIN `zz_segments_lang` ON (`zz_segments_lang`.`id_record` = `zz_segments`.`id` AND `zz_segments_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"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 `name` = \"Lingua\")) WHERE `name`="Fatture di vendita") ORDER BY `name`' WHERE `zz_settings`.`name` = "Sezionale per autofatture di vendita";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `zz_segments`.`id`, `name` AS descrizione FROM `zz_segments` LEFT JOIN `zz_segments_lang` ON (`zz_segments_lang`.`id_record` = `zz_segments`.`id` AND `zz_segments_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"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` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\")) WHERE `name`="Fatture di acquisto") ORDER BY `name`' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Sezionale per autofatture di acquisto"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `zz_segments`.`id`, `name` AS descrizione FROM `zz_segments` LEFT JOIN `zz_segments_lang` ON (`zz_segments_lang`.`id_record` = `zz_segments`.`id` AND `zz_segments_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"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 `name` = \"Lingua\")) WHERE `name`="Fatture di acquisto") ORDER BY `name`' WHERE `zz_settings`.`name` = "Sezionale per autofatture di acquisto";
UPDATE `zz_settings` SET `tipo` = 'SELECT `codice` AS id, CONCAT(`codice`, " - ", `name`)as descrizione FROM `fe_regime_fiscale` LEFT JOIN `fe_regime_fiscale_lang` ON (`fe_regime_fiscale_lang`.`id_record`=`fe_regime_fiscale`.`codice` AND `fe_regime_fiscale_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Regime fiscale"); UPDATE `zz_settings` SET `tipo` = 'SELECT `codice` AS id, CONCAT(`codice`, " - ", `name`)as descrizione FROM `fe_regime_fiscale` LEFT JOIN `fe_regime_fiscale_lang` ON (`fe_regime_fiscale_lang`.`id_record`=`fe_regime_fiscale`.`codice` AND `fe_regime_fiscale_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`name` = "Regime fiscale";
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 `idtipoanagrafica` FROM `an_tipianagrafiche` LEFT JOIN `an_tipianagrafiche_lang` ON (`an_tipianagrafiche_lang`.`id_record` = `an_tipianagrafiche`.`id` AND `an_tipianagrafiche_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\")) WHERE `name` = "Fornitore") AND `deleted_at` IS NULL' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Terzo intermediario"); 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 `idtipoanagrafica` FROM `an_tipianagrafiche` LEFT JOIN `an_tipianagrafiche_lang` ON (`an_tipianagrafiche_lang`.`id_record` = `an_tipianagrafiche`.`id` AND `an_tipianagrafiche_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"Lingua\")) WHERE `name` = "Fornitore") AND `deleted_at` IS NULL' WHERE `zz_settings`.`name` = "Terzo intermediario";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `zz_modules`.`id`, `title` AS descrizione 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` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\")) WHERE `enabled` = 1 AND `options` != "" AND `options` != "menu" AND `options` IS NOT NULL ORDER BY `order` ASC' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Prima pagina"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `zz_modules`.`id`, `title` AS descrizione 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 `name` = \"Lingua\")) WHERE `enabled` = 1 AND `options` != "" AND `options` != "menu" AND `options` IS NOT NULL ORDER BY `order` ASC' WHERE `zz_settings`.`name` = "Prima pagina";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `zz_currencies`.`id`, `name` AS descrizione FROM `zz_currencies` LEFT JOIN `zz_currencies_lang` ON (`zz_currencies_lang`.`id_record` = `zz_currencies`.`id` AND `zz_currencies_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Valuta"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `zz_currencies`.`id`, `name` AS descrizione FROM `zz_currencies` LEFT JOIN `zz_currencies_lang` ON (`zz_currencies_lang`.`id_record` = `zz_currencies`.`id` AND `zz_currencies_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`name` = "Valuta";
UPDATE `zz_settings` SET `tipo` = 'query=SELECT `em_templates`.`id`, `name` AS descrizione FROM `em_templates` LEFT JOIN `em_templates_lang` ON (`em_templates_lang`.`id_record` = `em_templates`.`id` AND `em_templates_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` LEFT JOIN `zz_settings_lang` ON `zz_settings_lang`.`id_record` = `zz_settings`.`id` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`id` = (SELECT `id_record` FROM `zz_settings_lang` WHERE `name` = "Template email invio sollecito"); UPDATE `zz_settings` SET `tipo` = 'query=SELECT `em_templates`.`id`, `name` AS descrizione FROM `em_templates` LEFT JOIN `em_templates_lang` ON (`em_templates_lang`.`id_record` = `em_templates`.`id` AND `em_templates_lang`.`id_lang` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \"Lingua\"))' WHERE `zz_settings`.`name` = "Template email invio sollecito";