Fix lingua inglese

This commit is contained in:
Pek5892 2024-03-28 16:38:03 +01:00
parent 41f75cf19f
commit cd1cb11198
15 changed files with 16 additions and 16 deletions

View File

@ -34,10 +34,10 @@ if (empty($documento)) {
// Informazioni utili
$dir = $documento->direzione;
$original_module = Module::find((new Module())->getByField('name', $documento->module));
$original_module = Module::find((new Module())->getByField('name', $documento->module, Models\Locale::getPredefined()->id));
$name = !empty($documento_finale) ? $documento_finale->module : $options['module'];
$final_module = Module::find((new Module())->getByField('name', $name));
$final_module = Module::find((new Module())->getByField('name', $name, Models\Locale::getPredefined()->id));
$id_segment = $_SESSION['module_'.$final_module->id]['id_segment'];
// IVA predefinita

View File

@ -25,7 +25,7 @@ use Modules\Anagrafiche\Tipo;
$rs = Tipo::get();
foreach ($rs as $riga) {
${'id_'.strtolower($riga->getTranslation('name'))} = $riga->id;
${'id_'.strtolower($riga->getTranslation('name', \Models\Locale::getPredefined()->id))} = $riga->id;
}
if (!empty($id_record)) {

View File

@ -26,7 +26,7 @@ use Models\PrintTemplate;
$id_record = filter('id_record');
$dir = filter('dir');
$nome_stampa = filter('nome_stampa');
$id_print = (new PrintTemplate())->getByField('name', $nome_stampa);
$id_print = (new PrintTemplate())->getByField('name', $nome_stampa, Models\Locale::getPredefined()->id);
$id_module = (new Module())->getByField('name', 'Stampe contabili', Models\Locale::getPredefined()->id);
$year = (new Carbon($_SESSION['period_end']))->format('Y');

View File

@ -207,7 +207,7 @@ class Articolo extends Model
return null;
}
$module = Module::find((new Module())->getByField('name', $this->module));
$module = Module::find((new Module())->getByField('name', $this->module, \Models\Locale::getPredefined()->id));
$fileinfo = \Uploads::fileInfo($this->immagine);
$directory = '/'.$module->upload_directory.'/';

View File

@ -248,7 +248,7 @@ class Contratto extends Document
$codice_intervento = 'FAT';
}
$stato = (new Stato())->getByField('name', $descrizione);
$stato = (new Stato())->getByField('name', $descrizione, \Models\Locale::getPredefined()->id);
$this->stato()->associate($stato);
$this->save();

View File

@ -46,7 +46,7 @@ foreach ($rs as $r) {
$result = [];
$module = ($r['dir'] == 'uscita') ? 'Ddt di acquisto' : 'Ddt di vendita';
$link_id = (new Module())->getByField('name', $module);
$link_id = (new Module())->getByField('name', $module, Models\Locale::getPredefined()->id);
$numero = empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'];

View File

@ -35,7 +35,7 @@ if ($module->getTranslation('name') == 'Ddt di vendita') {
}
// Segmenti
$id_fatture = (new Module())->getByField('name', $module_fatture);
$id_fatture = (new Module())->getByField('name', $module_fatture, Models\Locale::getPredefined()->id);
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
$segments = Modules::getSegments($id_fatture);
$_SESSION['module_'.$id_fatture]['id_segment'] = isset($segments[0]['id']) ? $segments[0]['id'] : null;

View File

@ -241,7 +241,7 @@ class DDT extends Document
$descrizione = $parziale_fatturato ? 'Parzialmente fatturato' : 'Fatturato';
}
$stato = (new Stato())->getByField('name', $descrizione);
$stato = (new Stato())->getByField('name', $descrizione, \Models\Locale::getPredefined()->id);
$this->stato()->associate($stato);
$this->save();
}

View File

@ -50,7 +50,7 @@ foreach ($rs as $r) {
$result = [];
$module = ($r['dir'] == 'uscita') ? 'Fatture di acquisto' : 'Fatture di vendita';
$link_id = (new Module())->getByField('name', $module);
$link_id = (new Module())->getByField('name', $module, Models\Locale::getPredefined()->id);
$numero = empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'];

View File

@ -26,7 +26,7 @@ use Modules\Interventi\Intervento;
use Modules\Ordini\Ordine;
$documento = Intervento::find($id_record);
$id_module = (new Module())->getByField('name', $documento->module);
$id_module = (new Module())->getByField('name', $documento->module, Models\Locale::getPredefined()->id);
if (get('documento') == 'fattura') {
$final_module = 'Fatture di vendita';

View File

@ -266,7 +266,7 @@ class FatturaElettronica
$info = $this->getAnagrafe();
$anagrafica = Anagrafica::build($info['ragione_sociale'], $info['nome'], $info['cognome'], [
(new TipoAnagrafica())->getByField('name', $type),
(new TipoAnagrafica())->getByField('name', $type, \Models\Locale::getPredefined()->id),
]);
if (!empty($info['partita_iva'])) {

View File

@ -221,7 +221,7 @@ class FatturaOrdinaria extends FatturaElettronica
if (empty($articolo)) {
$nome_categoria = 'Importazione automatica';
$categoria = Categoria::where('id', '=', (new Categoria())->getByField('name', strtolower($nome_categoria)))->first();
$categoria = Categoria::find((new Categoria())->getByField('name', strtolower($nome_categoria)));
if (empty($categoria)) {
$categoria = Categoria::build();
$categoria->setTranslation('nome', $nome_categoria);

View File

@ -30,7 +30,7 @@ abstract class CachedManager extends Manager
{
parent::__construct($hook);
$this->cache = Cache::find((new Cache())->getByField('name', $this->getCacheName()));
$this->cache = Cache::find((new Cache())->getByField('name', $this->getCacheName(), \Models\Locale::getPredefined()->id));
}
abstract public function cacheData();

View File

@ -282,7 +282,7 @@ class Modules
$testo = $testo.' <i class="fa fa-external-link"></i>';
}
$module = self::get((new Module())->getByField('name', $modulo));
$module = self::get((new Module())->getByField('name', $modulo, \Models\Locale::getPredefined()->id));
$extra .= !empty($blank) ? ' target="_blank"' : '';

View File

@ -1890,7 +1890,7 @@ FROM
LEFT JOIN `co_statidocumento_lang` ON (`co_statidocumento_lang`.`id_record` = `co_statidocumento`.`id` AND `co_statidocumento_lang`.|lang|)
LEFT JOIN (SELECT COUNT(id_email) as emails, zz_operations.id_record FROM zz_operations WHERE id_module IN(SELECT `id_record` FROM `zz_modules_lang` WHERE `name` = 'Scadenzario' AND |lang|) AND `zz_operations`.`op` = 'send-email' GROUP BY zz_operations.id_record) AS `email` ON `email`.`id_record` = `co_scadenziario`.`id`
WHERE
1=1 AND (`co_statidocumento_lang`.`name` IS NULL OR `co_statidocumento_lang`.`name` IN('Emessa','Parzialmente pagato','Pagato'))
1=1 AND (`co_statidocumento`.`id` IS NULL OR `co_statidocumento`.`id` IN(SELECT id_record FROM co_statidocumento_lang WHERE name IN ('Emessa', 'Parzialmente pagato', 'Pagato')))
HAVING
2=2
ORDER BY