From ab2f83fbf0e458da48adca366ecf76d7b2267b62 Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Thu, 28 Mar 2024 16:55:49 +0100 Subject: [PATCH] Aggiornamento CHANGELOG --- CHANGELOG.md | 4 ++-- include/common/importa.php | 10 ++++---- include/init/init.php | 4 ++-- modules/anagrafiche/init.php | 2 +- modules/fatture/actions.php | 2 +- modules/fatture/edit.php | 34 +++++++++++++-------------- modules/ordini/add.php | 2 +- modules/ordini/crea_documento.php | 6 ++--- modules/ordini/edit.php | 2 +- modules/preventivi/src/Preventivo.php | 2 +- src/Modules.php | 2 +- 11 files changed, 35 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4e845b46..ccabcd068 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Tutti i maggiori cambiamenti di questo progetto saranno documentati in questo fi Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://keepachangelog.com/), e il progetto segue il [Semantic Versioning](http://semver.org/) per definire le versioni delle release. -- [2.5 (2024-03-27)](#25-2024-03-27) +- [2.5 (2024-03-28)](#25-2024-03-28) - [2.4.54 (2024-02-02)](#2454-2024-02-02) - [2.4.53 (2024-01-05)](#2453-2024-01-05) - [2.4.52 (2023-12-08)](#2452-2023-12-08) @@ -66,7 +66,7 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k - [2.2 (2016-11-10)](#22-2016-11-10) - [2.1 (2015-04-02)](#21-2015-04-02) -## 2.5 (2024-03-27) +## 2.5 (2024-03-28) ### Aggiunto (Added) - Aggiunte le tabelle '_lang' per la gestione delle traduzioni dei dati presenti a database - Aggiunta log rimozione sessioni per velocizzare la sincronizzazione dell'app diff --git a/include/common/importa.php b/include/common/importa.php index f65b5708e..9d9b4d168 100755 --- a/include/common/importa.php +++ b/include/common/importa.php @@ -21,9 +21,9 @@ use Models\Module; use Modules\Contratti\Stato as StatoContratto; use Modules\DDT\Stato; use Modules\Fatture\Stato as StatoFattura; +use Modules\Fatture\Tipo as Tipofattura; use Modules\Ordini\Stato as StatoOrdine; use Plugins\ListinoFornitori\DettaglioFornitore; -use Modules\Fatture\Tipo as Tipofattura; // Inizializzazione $documento = $options['documento']; @@ -45,8 +45,8 @@ $id_iva = $id_iva ?: setting('Iva predefinita'); $righe_totali = $documento->getRighe(); -$id_module_interventi = (new Module)->getByField('name', 'Interventi', Models\Locale::getPredefined()->id); -$id_module_ordini_f = (new Module)->getByField('name', 'Ordini fornitore', Models\Locale::getPredefined()->id); +$id_module_interventi = (new Module())->getByField('name', 'Interventi', Models\Locale::getPredefined()->id); +$id_module_ordini_f = (new Module())->getByField('name', 'Ordini fornitore', Models\Locale::getPredefined()->id); if ($final_module->id == $id_module_interventi) { $righe = $righe_totali->where('is_descrizione', '=', 0) ->where('qta_rimanente', '>', 0); @@ -102,8 +102,8 @@ if (!empty($options['create_document'])) { $id_module_ddt_acquisto = (new Module())->getByField('name', 'Ddt di acquisto', Models\Locale::getPredefined()->id); if (in_array($final_module->id, [$id_module_fatt_vendita, $id_module_fatt_acquisto])) { $stato_predefinito = (new StatoFattura())->getByField('name', 'Bozza', Models\Locale::getPredefined()->id); - $fatt_differita_acquisto = (new TipoFattura())->getByField('name', 'Fattura differita di acquisto', Models\Locale::getPredefined()->id); - $fatt_differita_vendita = (new TipoFattura())->getByField('name', 'Fattura differita di vendita', Models\Locale::getPredefined()->id); + $fatt_differita_acquisto = (new Tipofattura())->getByField('name', 'Fattura differita di acquisto', Models\Locale::getPredefined()->id); + $fatt_differita_vendita = (new Tipofattura())->getByField('name', 'Fattura differita di vendita', Models\Locale::getPredefined()->id); if (!empty($options['reversed'])) { $idtipodocumento = database()->fetchOne('SELECT `co_tipidocumento`.`id` FROM `co_tipidocumento` LEFT JOIN `co_tipidocumento_lang` ON (`co_tipidocumento_lang`.`id_record` = `co_tipidocumento`.`id` AND `co_tipidocumento_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `name` = "Nota di credito" AND `dir` = \''.$dir.'\'')['id']; diff --git a/include/init/init.php b/include/init/init.php index 9c380be63..d235319fa 100755 --- a/include/init/init.php +++ b/include/init/init.php @@ -33,8 +33,8 @@ $id_tipo_azienda = Tipo::find((new Tipo())->getByField('name', 'Azienda', Models $has_azienda = $dbo->fetchNum('SELECT `an_anagrafiche`.`idanagrafica` FROM `an_anagrafiche` LEFT JOIN `an_tipianagrafiche_anagrafiche` ON `an_anagrafiche`.`idanagrafica`=`an_tipianagrafiche_anagrafiche`.`idanagrafica` LEFT JOIN `an_tipianagrafiche` ON `an_tipianagrafiche`.`id`=`an_tipianagrafiche_anagrafiche`.`idtipoanagrafica` - LEFT JOIN `an_tipianagrafiche_lang` ON (`an_tipianagrafiche`.`id`=`an_tipianagrafiche_lang`.`id_record` AND `an_tipianagrafiche_lang`.`id_lang`='.prepare(Models\Locale::getDefault()->id).") -WHERE `an_tipianagrafiche`.`id` = ".$id_tipo_azienda." AND `an_anagrafiche`.`deleted_at` IS NULL") != 0; + LEFT JOIN `an_tipianagrafiche_lang` ON (`an_tipianagrafiche`.`id`=`an_tipianagrafiche_lang`.`id_record` AND `an_tipianagrafiche_lang`.`id_lang`='.prepare(Models\Locale::getDefault()->id).') +WHERE `an_tipianagrafiche`.`id` = '.$id_tipo_azienda.' AND `an_anagrafiche`.`deleted_at` IS NULL') != 0; $has_user = $dbo->fetchNum('SELECT `id` FROM `zz_users`') != 0; $settings = [ diff --git a/modules/anagrafiche/init.php b/modules/anagrafiche/init.php index 14838466b..4fd9b74ac 100755 --- a/modules/anagrafiche/init.php +++ b/modules/anagrafiche/init.php @@ -25,7 +25,7 @@ use Modules\Anagrafiche\Tipo; $rs = Tipo::get(); foreach ($rs as $riga) { - ${'id_'.strtolower($riga->getTranslation('name', \Models\Locale::getPredefined()->id))} = $riga->id; + ${'id_'.strtolower($riga->getTranslation('name', Models\Locale::getPredefined()->id))} = $riga->id; } if (!empty($id_record)) { diff --git a/modules/fatture/actions.php b/modules/fatture/actions.php index 977f91fbb..58835adc1 100755 --- a/modules/fatture/actions.php +++ b/modules/fatture/actions.php @@ -37,7 +37,7 @@ use Util\XML; $module = Module::find($id_module); $op = post('op'); -if ($module->getTranslation('name', \Models\Locale::getPredefined()->id) == 'Fatture di vendita') { +if ($module->getTranslation('name', Models\Locale::getPredefined()->id) == 'Fatture di vendita') { $dir = 'entrata'; } else { $dir = 'uscita'; diff --git a/modules/fatture/edit.php b/modules/fatture/edit.php index 2cac1dc33..2a61dd1a9 100755 --- a/modules/fatture/edit.php +++ b/modules/fatture/edit.php @@ -21,25 +21,25 @@ use Carbon\Carbon; use Models\Module; use Models\Plugin; use Modules\Anagrafiche\Anagrafica; +use Modules\DDT\Stato as StatoDDT; use Modules\Fatture\Fattura; use Modules\Fatture\Gestori\Bollo; +use Modules\Fatture\Stato as StatoFattura; use Modules\Interventi\Intervento; use Modules\Iva\Aliquota; -use Plugins\ExportFE\Interaction; -use Modules\Fatture\Stato as StatoFattura; -use Modules\DDT\Stato as StatoDDT; use Modules\Ordini\Stato as StatoOrdine; +use Plugins\ExportFE\Interaction; include_once __DIR__.'/../../core.php'; $anagrafica_azienda = Anagrafica::find(setting('Azienda predefinita')); -$id_stato_bozza = (new StatoFattura())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id); -$id_stato_emessa = (new StatoFattura())->getByField('name', 'Emessa', \Models\Locale::getPredefined()->id); -$id_stato_pagato = (new StatoFattura())->getByField('name', 'Pagato', \Models\Locale::getPredefined()->id); -$id_stato_parz_pagato = (new StatoFattura())->getByField('name', 'Parzialmente pagato', \Models\Locale::getPredefined()->id); -$id_stato_non_valida = (new StatoFattura())->getByField('name', 'Non valida', \Models\Locale::getPredefined()->id); -$id_stato_annullata = (new StatoFattura())->getByField('name', 'Annullata', \Models\Locale::getPredefined()->id); +$id_stato_bozza = (new StatoFattura())->getByField('name', 'Bozza', Models\Locale::getPredefined()->id); +$id_stato_emessa = (new StatoFattura())->getByField('name', 'Emessa', Models\Locale::getPredefined()->id); +$id_stato_pagato = (new StatoFattura())->getByField('name', 'Pagato', Models\Locale::getPredefined()->id); +$id_stato_parz_pagato = (new StatoFattura())->getByField('name', 'Parzialmente pagato', Models\Locale::getPredefined()->id); +$id_stato_non_valida = (new StatoFattura())->getByField('name', 'Non valida', Models\Locale::getPredefined()->id); +$id_stato_annullata = (new StatoFattura())->getByField('name', 'Annullata', Models\Locale::getPredefined()->id); $block_edit = !empty($note_accredito) || in_array($fattura->stato->id, [$id_stato_parz_pagato, $id_stato_pagato, $id_stato_emessa]) || !$abilita_genera; @@ -296,7 +296,7 @@ if (empty($record['is_fiscale'])) { } // Forzo il passaggio della fattura da Bozza ad Emessa per il corretto calcolo del numero. elseif ($fattura->stato->id == $id_stato_bozza) { - $query .= " WHERE `co_statidocumento`.`id` IN (".$id_stato_emessa.", ".$id_stato_bozza.")"; + $query .= ' WHERE `co_statidocumento`.`id` IN ('.$id_stato_emessa.', '.$id_stato_bozza.')'; } $query .= ' ORDER BY `name`'; @@ -817,9 +817,9 @@ if (!$block_edit) { $contratti = $dbo->fetchArray($contr_query)[0]['tot']; } - $id_stato_evaso = (new StatoDDT())->getByField('name', 'Evaso', \Models\Locale::getPredefined()->id); - $id_stato_parz_evaso = (new StatoDDT())->getByField('name', 'Parziale evaso', \Models\Locale::getPredefined()->id); - $id_stato_parz_fatt = (new StatoDDT())->getByField('name', 'Parziale fatturato', \Models\Locale::getPredefined()->id); + $id_stato_evaso = (new StatoDDT())->getByField('name', 'Evaso', Models\Locale::getPredefined()->id); + $id_stato_parz_evaso = (new StatoDDT())->getByField('name', 'Parziale evaso', Models\Locale::getPredefined()->id); + $id_stato_parz_fatt = (new StatoDDT())->getByField('name', 'Parziale fatturato', Models\Locale::getPredefined()->id); // Lettura ddt (entrata o uscita) $ddt_query = 'SELECT @@ -840,10 +840,10 @@ if (!$block_edit) { $ddt = $dbo->fetchArray($ddt_query)[0]['tot']; // Lettura ordini (cliente o fornitore) - $id_stato_accettato = (new StatoOrdine())->getByField('name', 'Accettato', \Models\Locale::getPredefined()->id); - $id_stato_evaso = (new StatoOrdine())->getByField('name', 'Evaso', \Models\Locale::getPredefined()->id); - $id_stato_parz_evaso = (new StatoOrdine())->getByField('name', 'Parziale evaso', \Models\Locale::getPredefined()->id); - $id_stato_parz_fatt = (new StatoOrdine())->getByField('name', 'Parziale fatturato', \Models\Locale::getPredefined()->id); + $id_stato_accettato = (new StatoOrdine())->getByField('name', 'Accettato', Models\Locale::getPredefined()->id); + $id_stato_evaso = (new StatoOrdine())->getByField('name', 'Evaso', Models\Locale::getPredefined()->id); + $id_stato_parz_evaso = (new StatoOrdine())->getByField('name', 'Parziale evaso', Models\Locale::getPredefined()->id); + $id_stato_parz_fatt = (new StatoOrdine())->getByField('name', 'Parziale fatturato', Models\Locale::getPredefined()->id); $ordini_query = 'SELECT COUNT(*) AS tot diff --git a/modules/ordini/add.php b/modules/ordini/add.php index ed2ee9aee..abbe9691f 100755 --- a/modules/ordini/add.php +++ b/modules/ordini/add.php @@ -22,7 +22,7 @@ use Models\Module; $module = Module::find($id_module); -if ($module->getTranslation('name', \Models\Locale::getPredefined()->id) == 'Ordini cliente') { +if ($module->getTranslation('name', Models\Locale::getPredefined()->id) == 'Ordini cliente') { $dir = 'entrata'; $tipo_anagrafica = 'Cliente'; diff --git a/modules/ordini/crea_documento.php b/modules/ordini/crea_documento.php index a989dd047..8a1326cfd 100755 --- a/modules/ordini/crea_documento.php +++ b/modules/ordini/crea_documento.php @@ -30,7 +30,7 @@ $documento = Ordine::find($id_record); $module = Module::find((new Module())->getByField('name', $documento->module, Models\Locale::getPredefined()->id)); if (get('documento') == 'fattura') { - $final_module = $module->getTranslation('name', \Models\Locale::getPredefined()->id) == 'Ordini cliente' ? 'Fatture di vendita' : 'Fatture di acquisto'; + $final_module = $module->getTranslation('name', Models\Locale::getPredefined()->id) == 'Ordini cliente' ? 'Fatture di vendita' : 'Fatture di acquisto'; $op = 'add_documento'; $tipo_documento_finale = Fattura::class; } elseif (get('documento') == 'ordine_fornitore') { @@ -39,10 +39,10 @@ if (get('documento') == 'fattura') { $tipo_documento_finale = Ordine::class; } elseif (get('documento') == 'intervento') { $final_module = 'Interventi'; - $op = $module->getTranslation('name', \Models\Locale::getPredefined()->id) == 'Ordini cliente' ? 'add_documento' : 'add_intervento'; + $op = $module->getTranslation('name', Models\Locale::getPredefined()->id) == 'Ordini cliente' ? 'add_documento' : 'add_intervento'; $tipo_documento_finale = Intervento::class; } else { - $final_module = $module->getTranslation('name', \Models\Locale::getPredefined()->id) == 'Ordini cliente' ? 'Ddt di vendita' : 'Ddt di acquisto'; + $final_module = $module->getTranslation('name', Models\Locale::getPredefined()->id) == 'Ordini cliente' ? 'Ddt di vendita' : 'Ddt di acquisto'; $op = 'add_ordine'; $tipo_documento_finale = DDT::class; } diff --git a/modules/ordini/edit.php b/modules/ordini/edit.php index cfc51dfe9..58d74b9d2 100755 --- a/modules/ordini/edit.php +++ b/modules/ordini/edit.php @@ -24,7 +24,7 @@ use Modules\Ordini\Stato; $block_edit = $record['flag_completato']; $module = Module::find($id_module); -if ($module->getTranslation('name', \Models\Locale::getPredefined()->id) == 'Ordini cliente') { +if ($module->getTranslation('name', Models\Locale::getPredefined()->id) == 'Ordini cliente') { $dir = 'entrata'; } else { $dir = 'uscita'; diff --git a/modules/preventivi/src/Preventivo.php b/modules/preventivi/src/Preventivo.php index 3375c44a5..a1d1dced9 100755 --- a/modules/preventivi/src/Preventivo.php +++ b/modules/preventivi/src/Preventivo.php @@ -261,7 +261,7 @@ class Preventivo extends Document $qta = $righe->sum('qta'); $parziale = $qta != $qta_evasa; $stato = $this->stato; - + // Impostazione del nuovo stato if ($qta_evasa == 0) { $descrizione = 'In lavorazione'; diff --git a/src/Modules.php b/src/Modules.php index 3a9838cb3..024808577 100755 --- a/src/Modules.php +++ b/src/Modules.php @@ -282,7 +282,7 @@ class Modules $testo = $testo.' '; } - $module = self::get((new Module())->getByField('name', $modulo, \Models\Locale::getPredefined()->id)); + $module = self::get((new Module())->getByField('name', $modulo, Models\Locale::getPredefined()->id)); $extra .= !empty($blank) ? ' target="_blank"' : '';