Aggiunta tabella zz_settings_lang

This commit is contained in:
Pek5892 2024-03-11 15:22:37 +01:00
parent 1e41d3f33d
commit 407e04ee17
12 changed files with 148 additions and 35 deletions

View File

@ -23,6 +23,7 @@
* @since 2.4.2
*/
use HTMLBuilder\HTMLBuilder;
use Models\Setting;
/**
* Restituisce l'oggetto dedicato alla gestione della connessione con il database.
@ -105,7 +106,7 @@ function get($param, $raw = false)
*/
function setting($name, $again = false)
{
return Settings::getValue($name);
return Setting::find((new Setting())->getByName($name)->id_record)->valore;
}
/**

View File

@ -164,7 +164,7 @@ if ($smtp['pec'] == 1 && $module['name'] == 'Fatture di vendita') {
echo '
<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` WHERE `nome` = \'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` 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" ]}
</div>
</div>';

View File

@ -36,6 +36,7 @@ switch ($resource) {
$solo_non_varianti = $superselect['solo_non_varianti'];
$idagente = $superselect['idagente'];
$id_listino = $superselect['id_listino'];
$iva_predefinita = setting('IVA predefinita');
$query = "SELECT
DISTINCT `mg_articoli`.`id`,
@ -111,7 +112,7 @@ switch ($resource) {
ON `righe`.`id`=`mg_articoli`.`id`
LEFT JOIN `co_iva` AS iva_articolo ON `iva_articolo`.`id` = `mg_articoli`.`idiva_vendita`
LEFT JOIN `co_iva_lang` AS iva_articolo_lang on (`iva_articolo`.`id` = `iva_articolo_lang`.`id_record` AND `iva_articolo_lang`.`id_lang` = ".prepare(setting('Lingua')).")
LEFT JOIN `co_iva` AS `iva_predefinita` ON `iva_predefinita`.`id` = (SELECT `valore` FROM `zz_settings` WHERE `zz_settings`.`nome` = 'Iva predefinita')
LEFT JOIN `co_iva` AS `iva_predefinita` ON `iva_predefinita`.`id` = '.$iva_predefinita.'
LEFT JOIN `co_iva_lang` AS iva_predefinita_lang on (`iva_predefinita`.`id` = `iva_predefinita_lang`.`id_record` AND `iva_predefinita_lang`.`id_lang` = ".prepare(setting('Lingua')).')';
if ($usare_iva_anagrafica) {

View File

@ -28,7 +28,7 @@ $impostazioni = Setting::where('sezione', $sezione)
foreach ($impostazioni as $impostazione) {
echo '
<div class="col-md-6">
'.Settings::input($impostazione['id']).'
'.Settings::input($impostazione->id).'
</div>
<script>';

View File

@ -30,7 +30,7 @@ class Impostazioni extends AppResource
public function getModifiedRecords($last_sync_at)
{
$query = "SELECT zz_settings.id, zz_settings.updated_at FROM zz_settings WHERE (sezione = 'Applicazione'";
$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'";
// Aggiunta delle impostazioni esterne alla sezione Applicazione
$impostazioni_esterne = $this->getImpostazioniEsterne();
@ -40,13 +40,13 @@ class Impostazioni extends AppResource
$impostazioni[] = prepare($imp);
}
$query .= ' OR nome IN ('.implode(', ', $impostazioni).')';
$query .= ' OR `name` IN ('.implode(', ', $impostazioni).')';
}
$query .= ')';
// Filtro per data
if ($last_sync_at) {
$query .= ' AND zz_settings.updated_at > '.prepare($last_sync_at);
$query .= ' AND `zz_settings`.`updated_at` > '.prepare($last_sync_at);
}
$records = database()->fetchArray($query);
@ -57,12 +57,15 @@ class Impostazioni extends AppResource
public function retrieveRecord($id)
{
// Gestione della visualizzazione dei dettagli del record
$query = 'SELECT id AS id,
nome,
valore AS contenuto,
tipo
FROM zz_settings
WHERE zz_settings.id = '.prepare($id);
$query = 'SELECT `id` AS id,
`zz_settings_lang`.`name`,
`valore` AS contenuto,
`tipo`
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
`zz_settings`.`id` = '.prepare($id);
$record = database()->fetchOne($query);

View File

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

View File

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

View File

@ -26,9 +26,9 @@ $id_cliente = $id_cliente ?: $idcliente;
// Leggo i dati della destinazione (se 0=sede legale, se!=altra sede da leggere da tabella an_sedi)
if (empty($id_sede) || $id_sede == '-1') {
$queryc = 'SELECT * FROM an_anagrafiche WHERE idanagrafica='.prepare($id_cliente);
$queryc = 'SELECT * FROM `an_anagrafiche` WHERE `idanagrafica`='.prepare($id_cliente);
} else {
$queryc = 'SELECT an_anagrafiche.*, an_sedi.*, if(an_sedi.codice_fiscale != "", an_sedi.codice_fiscale, an_anagrafiche.codice_fiscale) AS codice_fiscale, if(an_sedi.piva != "", an_sedi.piva, an_anagrafiche.piva) AS piva, if(an_sedi.id_nazione != "", an_sedi.id_nazione, an_anagrafiche.id_nazione) AS id_nazione FROM an_sedi JOIN an_anagrafiche ON an_anagrafiche.idanagrafica=an_sedi.idanagrafica WHERE an_sedi.idanagrafica='.prepare($id_cliente).' AND an_sedi.id='.prepare($id_sede);
$queryc = 'SELECT `an_anagrafiche`.*, `an_sedi`.*, if(`an_sedi`.`codice_fiscale` != "", `an_sedi`.`codice_fiscale`, `an_anagrafiche`.`codice_fiscale`) AS codice_fiscale, if(`an_sedi`.`piva` != "", `an_sedi`.`piva`, `an_anagrafiche`.`piva`) AS piva, if(`an_sedi`.`id_nazione` != "", `an_sedi`.`id_nazione`, `an_anagrafiche`.`id_nazione`) AS id_nazione FROM `an_sedi` JOIN `an_anagrafiche` ON `an_anagrafiche`.`idanagrafica`=`an_sedi`.`idanagrafica` WHERE `an_sedi`.`idanagrafica`='.prepare($id_cliente).' AND `an_sedi`.`id`='.prepare($id_sede);
}
/**
* @deprecated
@ -39,7 +39,8 @@ $cliente = $dbo->fetchOne($queryc);
/**
* @deprecated
*/
$azienda = $dbo->fetchOne('SELECT *, (SELECT iban FROM co_banche WHERE id IN (SELECT id_banca_azienda FROM co_documenti WHERE id = '.prepare($id_record).')) AS codiceiban, (SELECT nome FROM co_banche WHERE id IN (SELECT id_banca_azienda FROM co_documenti WHERE id = '.prepare($id_record).')) AS appoggiobancario, (SELECT bic FROM co_banche WHERE id IN (SELECT id_banca_azienda FROM co_documenti WHERE id = '.prepare($id_record).")) AS bic FROM an_anagrafiche WHERE idanagrafica = (SELECT valore FROM zz_settings WHERE nome='Azienda predefinita')");
$id_azienda = setting('Azienda predefinita');
$azienda = $dbo->fetchOne('SELECT *, (SELECT `iban` FROM `co_banche` WHERE `id` IN (SELECT `id_banca_azienda` FROM `co_documenti` WHERE `id` = '.prepare($id_record).')) AS codiceiban, (SELECT `nome` FROM `co_banche` WHERE `id` IN (SELECT `id_banca_azienda` FROM `co_documenti` WHERE `id` = '.prepare($id_record).')) AS appoggiobancario, (SELECT `bic` FROM `co_banche` WHERE `id` IN (SELECT `id_banca_azienda` FROM `co_documenti` WHERE `id` = '.prepare($id_record).")) AS bic FROM `an_anagrafiche` WHERE `idanagrafica` = ".prepare($id_azienda));
// Prefissi e contenuti del replace
/**

View File

@ -20,6 +20,7 @@
include_once __DIR__.'/../../core.php';
use Carbon\Carbon;
use Models\Module;
use Models\Setting;
$date_start = filter('date_start');
$date_end = filter('date_end');
@ -27,8 +28,8 @@ $date_end = filter('date_end');
$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');
$periodo = $dbo->fetchOne('SELECT valore FROM zz_settings WHERE nome="Liquidazione iva"');
if ($periodo['valore'] == 'Mensile') {
$periodo = Setting::find((new Setting())->getByName('Liquidazione IVA')->id_record)->valore;
if ($periodo == 'Mensile') {
$periodo_precedente_start = (new Carbon($date_start))->subMonth()->format('Y-m-d');
$periodo_precedente_end = (new Carbon($date_end))->subMonth()->format('Y-m-d');
} else {

View File

@ -2080,3 +2080,58 @@ ALTER TABLE `zz_views`
DROP `name`;
ALTER TABLE `zz_views_lang` ADD CONSTRAINT `zz_views_lang_ibfk_1` FOREIGN KEY (`id_record`) REFERENCES `zz_views`(`id`) ON DELETE CASCADE ON UPDATE RESTRICT;
-- Aggiunta tabella zz_settings_lang
CREATE TABLE IF NOT EXISTS `zz_settings_lang` (
`id` int NOT NULL,
`id_lang` int NOT NULL,
`id_record` int NOT NULL,
`name` VARCHAR(255) NOT NULL,
`title` VARCHAR(255) NOT NULL
);
ALTER TABLE `zz_settings_lang`
ADD PRIMARY KEY (`id`);
ALTER TABLE `zz_settings_lang`
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`;
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;
-- 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 `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` 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` 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` 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 `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_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_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`, 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 `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` 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` = '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` = '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 `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_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 `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");

View File

@ -184,6 +184,7 @@ return [
'zz_segments_lang',
'zz_semaphores',
'zz_settings',
'zz_settings_lang',
'zz_tasks',
'zz_tasks_logs',
'zz_tokens',