This commit is contained in:
FabioL 2024-03-22 18:41:58 +01:00
commit 160947e49a
17 changed files with 29 additions and 29 deletions

View File

@ -56,7 +56,7 @@ echo '
<input type="hidden" name="blocca_minimo_vendita" value="'.setting('Bloccare i prezzi inferiori al minimo di vendita').'">';
// Selezione impianto per gli Interventi
if ($module['name'] == 'Interventi') {
if ($module->getTranslation('name') == 'Interventi') {
echo '
<div class="row">
<div class="col-md-12">

View File

@ -18,7 +18,7 @@
*/
// Informazioni aggiuntive per Fatture
if ($module['name'] != 'Fatture di acquisto' && $module['name'] != 'Fatture di vendita') {
if ($module->getTranslation('name') != 'Fatture di acquisto' && $module->getTranslation('name') != 'Fatture di vendita') {
return;
}

View File

@ -32,7 +32,7 @@ echo '
</div>
</div>';
if ($module['name'] == 'Preventivi' && $options['op'] == 'manage_descrizione') {
if ($module->getTranslation('name') == 'Preventivi' && $options['op'] == 'manage_descrizione') {
echo '
<div class="row">
<div class="col-md-6">

View File

@ -241,11 +241,11 @@ if ($options['dir'] == 'entrata') {
// Data prevista evasione (per ordini)
if (in_array($module['name'], ['Ordini cliente', 'Ordini fornitore', 'Preventivi'])) {
if (in_array($module->getTranslation('name'), ['Ordini cliente', 'Ordini fornitore', 'Preventivi'])) {
if ($options['action'] == 'add') {
if ($module['name'] == 'Ordini cliente') {
if ($module->getTranslation('name') == 'Ordini cliente') {
$confermato = setting('Conferma automaticamente le quantità negli ordini cliente');
} elseif ($module['name'] == 'Ordini fornitore') {
} elseif ($module->getTranslation('name') == 'Ordini fornitore') {
$confermato = setting('Conferma automaticamente le quantità negli ordini fornitore');
} else {
$confermato = setting('Conferma automaticamente le quantità nei preventivi');
@ -279,7 +279,7 @@ if (in_array($module['name'], ['Ordini cliente', 'Ordini fornitore', 'Preventivi
</div>
<div class="col-md-4">
{[ "type": "checkbox", "label": "'.tr('Articolo confermato').'", "name": "confermato", "value": "'.$confermato.'", "help": "'.tr('Articolo confermato dal _ANA_ e che è possibile evadere', ['_ANA_' => $module['name'] == 'Ordini fornitore' ? tr('fornitore') : tr('cliente')]).'" ]}
{[ "type": "checkbox", "label": "'.tr('Articolo confermato').'", "name": "confermato", "value": "'.$confermato.'", "help": "'.tr('Articolo confermato dal _ANA_ e che è possibile evadere', ['_ANA_' => $module->getTranslation('name') == 'Ordini fornitore' ? tr('fornitore') : tr('cliente')]).'" ]}
</div>
<div class="col-md-4">
{[ "type": "checkbox", "label": "'.tr('Cambia stato a tutte le righe').'", "name": "confermato_all", "value": "" ]}
@ -306,7 +306,7 @@ if (in_array($module['name'], ['Ordini cliente', 'Ordini fornitore', 'Preventivi
</script>';
}
if (in_array($module['name'], ['Fatture di vendita', 'Fatture di acquisto'])) {
if (in_array($module->getTranslation('name'), ['Fatture di vendita', 'Fatture di acquisto'])) {
echo '
<script>
$(document).ready(function() {

View File

@ -155,7 +155,7 @@ echo '
</div>';
$uploads = [];
if ($smtp['pec'] == 1 && $module['name'] == 'Fatture di vendita') {
if ($smtp['pec'] == 1 && $module->getTranslation('name') == 'Fatture di vendita') {
$uploads = $dbo->fetchArray('SELECT id FROM zz_files WHERE id_module = '.prepare($module['id']).' AND id_record = '.prepare($id_record).' AND category = \'Fattura Elettronica\'');
$uploads = array_column($uploads, 'id');
}

View File

@ -266,9 +266,9 @@ switch (post('op')) {
}
$operations['crea_fattura'] = [
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module['name'])]),
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'data' => [
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module['name'])]),
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'msg' => '{[ "type": "checkbox", "label": "<small>'.tr('Aggiungere alle fatture di vendita non ancora emesse?').'</small>", "placeholder": "'.tr('Aggiungere alle fatture esistenti non ancora emesse?').'", "name": "accodare" ]}<br>
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}<br>
{[ "type": "select", "label": "'.tr('Tipo documento').'", "name": "idtipodocumento", "required": 1, "values": "query=SELECT `co_tipidocumento`.`id`, CONCAT(`codice_tipo_documento_fe`, \' - \', `name`) AS descrizione FROM `co_tipidocumento` LEFT JOIN ` co_tipidocumento_lang` ON (`co_tipidocumento`.`id` = `co_tipidocumento_lang`.`id_record` AND `co_tipidocumento_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `enabled` = 1 AND `dir` =\'entrata\' ORDER BY `codice_tipo_documento_fe`", "value": "'.$idtipodocumento.'" ]}<br>

View File

@ -26,7 +26,7 @@ use Modules\Fatture\Fattura;
use Modules\Fatture\Stato;
use Modules\Fatture\Tipo;
if ($module['name'] == 'Ddt di vendita') {
if ($module->getTranslation('name') == 'Ddt di vendita') {
$dir = 'entrata';
$module_fatture = 'Fatture di vendita';
} else {
@ -194,9 +194,9 @@ if (App::debug()) {
}
$operations['crea_fattura'] = [
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module['name'])]),
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'data' => [
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module['name'])]),
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'msg' => '{[ "type": "checkbox", "label": "<small>'.tr('Aggiungere alle _TYPE_ non ancora emesse?', ['_TYPE_' => strtolower($module_fatture)]).'", "placeholder": "'.tr('Aggiungere alle _TYPE_ nello stato bozza?', ['_TYPE_' => strtolower($module_fatture)]).'</small>", "name": "accodare" ]}<br>
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}<br>
{[ "type": "select", "label": "'.tr('Tipo documento').'", "name": "idtipodocumento", "required": 1, "values": "query=SELECT `co_tipidocumento`.`id`, CONCAT(`codice_tipo_documento_fe`, \' - \', `name`) AS descrizione FROM `co_tipidocumento` LEFT JOIN `co_tipidocumento_lang` ON (`co_tipidocumento`.`id`=`co_tipidocumento_lang`.`id_record` AND `co_tipidocumento_lang`.`id_lang`='.prepare(Models\Locale::getDefault()->id).') WHERE `enabled` = 1 AND `dir` ='.prepare($dir).' ORDER BY `codice_tipo_documento_fe`", "value": "'.$idtipodocumento.'" ]}<br>

View File

@ -40,7 +40,7 @@ if ($dir == 'entrata') {
echo '
<div class="alert alert-warning">
<i class="fa fa-warning"></i> '.tr("E' assente un _TYPE_ numero _NUM_ in data precedente o corrispondente a _DATE_: si potrebbero verificare dei problemi con la numerazione corrente dei DDT", [
'_TYPE_' => $module['name'],
'_TYPE_' => $module->getTranslation('name'),
'_DATE_' => dateFormat($ddt->data),
'_NUM_' => '"'.$numero_previsto.'"',
]).'.</b>

View File

@ -24,7 +24,7 @@ use Modules\DDT\DDT;
$azienda = Anagrafica::find(setting('Azienda predefinita'));
if ($module['name'] == 'Ddt di vendita') {
if ($module->getTranslation('name') == 'Ddt di vendita') {
$dir = 'entrata';
} else {
$dir = 'uscita';

View File

@ -88,7 +88,7 @@ switch (post('op')) {
$module = Module::find($id_module);
if ($module['name'] == 'Fatture di vendita') {
if ($module->getTranslation('name') == 'Fatture di vendita') {
$print_name = 'Fattura elettronica di vendita';
} else {
$print_name = 'Fattura elettronica di acquisto';

View File

@ -466,7 +466,7 @@ if ($record['stato'] != 'Bozza' && $record['stato'] != 'Annullata') {
'.Modules::link('Scadenzario', $scadenze[0]['id'], tr('<i class="fa fa-edit tip" title="'.tr('Modifica scadenze').'"></i>'), '', 'class="btn btn-xs btn-primary"');
// Ricalcola scadenze disponibile solo per fatture di acquisto
if ($fattura->isFE() && $ricalcola && $module['name'] == 'Fatture di acquisto') {
if ($fattura->isFE() && $ricalcola && $module->getTranslation('name') == 'Fatture di acquisto') {
echo '
<button type="button" class="btn btn-info btn-xs pull-right tip" title="'.tr('Ricalcola le scadenze').'. '.tr('Per ricalcolare correttamente le scadenze, imposta la fattura di acquisto nello stato \'\'Bozza\'\' e correggi il documento come desiderato, poi re-imposta lo stato \'\'Emessa\'\' e utilizza questa funzione').'." id="ricalcola_scadenze">
<i class="fa fa-calculator" aria-hidden="true"></i>

View File

@ -22,7 +22,7 @@ use Modules\Fatture\StatoFE;
include_once __DIR__.'/../../core.php';
if ($module['name'] == 'Fatture di vendita') {
if ($module->getTranslation('name') == 'Fatture di vendita') {
$dir = 'entrata';
} else {
$dir = 'uscita';

View File

@ -427,9 +427,9 @@ $operations['export-bulk'] = [
];
$operations['crea_fattura'] = [
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module['name'])]),
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'data' => [
'title' => tr('Fatturare gli _TYPE_ selezionati?', ['_TYPE_' => strtolower($module['name'])]).' <small><i class="fa fa-question-circle-o tip" title="'.tr('Verranno fatturati solo gli interventi completati non collegati a contratti o preventivi').'."></i></small>',
'title' => tr('Fatturare gli _TYPE_ selezionati?', ['_TYPE_' => strtolower($module->getTranslation('name'))]).' <small><i class="fa fa-question-circle-o tip" title="'.tr('Verranno fatturati solo gli interventi completati non collegati a contratti o preventivi').'."></i></small>',
'msg' => '{[ "type": "checkbox", "label": "<small>'.tr('Aggiungere alle fatture di vendita non ancora emesse?').'</small>", "placeholder": "'.tr('Aggiungere alle fatture di vendita nello stato bozza?').'", "name": "accodare" ]}<br>
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}<br>
{[ "type": "select", "label": "'.tr('Tipo documento').'", "name": "idtipodocumento", "required": 1, "values": "query=SELECT `co_tipidocumento`.`id`, CONCAT(`codice_tipo_documento_fe`, \' - \', `name`) AS descrizione FROM `co_tipidocumento` LEFT JOIN `co_tipidocumento_lang` ON (`co_tipidocumento`.`id` = `co_tipidocumento_lang`.`id_record` AND `co_tipidocumento_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `enabled` = 1 AND `dir` =\'entrata\' ORDER BY `codice_tipo_documento_fe`", "value": "'.$idtipodocumento.'" ]}<br>

View File

@ -109,7 +109,7 @@ $segment = $dbo->selectOne('zz_segments_lang', 'name', ['id_record' => $_SESSION
if ($segment != 'Tutti') {
$operations['copy_listino'] = [
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Copia _TYPE_', ['_TYPE_' => strtolower($module['name'])]),
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Copia _TYPE_', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'data' => [
'title' => tr('Copiare i listini selezionati?'),
'msg' => '{[ "type": "select", "multiple":"1", "label": "<small>'.tr('Selezionare le anagrafiche in cui copiare i listini selezionati:').'</small>", "ajax-source":"'.strtolower($segment).'", "name": "idanagrafica[]" ]}',
@ -120,7 +120,7 @@ if ($segment != 'Tutti') {
];
} else {
$operations['copy_listino'] = [
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Copia _TYPE_', ['_TYPE_' => strtolower($module['name'])]),
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Copia _TYPE_', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'data' => [
'title' => tr('Selezionare prima un segmento tra "Clienti" e "Fornitori"'),
'msg' => '',

View File

@ -212,11 +212,11 @@ switch (post('op')) {
break;
}
if ($module['name'] == 'Ordini cliente') {
if ($module->getTranslation('name') == 'Ordini cliente') {
$operations['crea_fattura'] = [
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module['name'])]),
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'data' => [
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module['name'])]),
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'msg' => '{[ "type": "checkbox", "label": "<small>'.tr('Aggiungere alle _TYPE_ non ancora emesse?', ['_TYPE_' => strtolower($module_fatture)]).'", "placeholder": "'.tr('Aggiungere alle _TYPE_ nello stato bozza?', ['_TYPE_' => strtolower($module_fatture)]).'</small>", "name": "accodare" ]}
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_modulo_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}
{[ "type": "select", "label": "'.tr('Tipo documento').'", "name": "idtipodocumento", "required": 1, "values": "query=SELECT `co_tipidocumento`.`id`, CONCAT(`codice_tipo_documento_fe`, \' - \', `name`) AS descrizione FROM `co_tipidocumento` LEFT JOIN `co_tipidocumento_lang` ON (`co_tipidocumento`.`id` = `co_tipidocumento_lang`.`id_record` AND `co_tipidocumento_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `enabled` = 1 AND `dir` =\'entrata\' ORDER BY `codice_tipo_documento_fe`", "value": "'.$idtipodocumento.'" ]}<br>

View File

@ -169,9 +169,9 @@ switch (post('op')) {
}
$operations['crea_fattura'] = [
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module['name'])]),
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'data' => [
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module['name'])]),
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
'msg' => '{[ "type": "checkbox", "label": "<small>'.tr('Aggiungere alle fatture di vendita non ancora emesse?').'</small>", "placeholder": "'.tr('Aggiungere alle fatture di vendita nello stato bozza?').'", "name": "accodare" ]}<br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "values": "query=SELECT `zz_segments`.`id`, `zz_segments_lang`.`name` AS descrizione FROM `zz_segments` LEFT JOIN `zz_segments_lang` ON (`zz_segments`.`id` = `zz_segments_lang`.`id_record` AND `zz_segments_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `id_module`=\''.$id_fatture.'\' ORDER BY `zz_segments_lang`.`name`", "value": "'.$id_segment.'" ]}<br>
{[ "type": "select", "label": "'.tr('Tipo documento').'", "name": "idtipodocumento", "required": 1, "values": "query=SELECT `co_tipidocumento`.`id`, CONCAT(`codice_tipo_documento_fe`, \' - \', `name`) AS descrizione FROM `co_tipidocumento` LEFT JOIN `co_tipidocumento_lang` ON (`co_tipidocumento`.`id` = `co_tipidocumento_lang`.`id_record` AND `co_tipidocumento_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `enabled` = 1 AND `dir` =\'entrata\' ORDER BY `codice_tipo_documento_fe`", "value": "'.$idtipodocumento.'" ]}<br>
{[ "type": "select", "label": "'.tr('Raggruppa per').'", "name": "raggruppamento", "required": 1, "values": "list=\"cliente\":\"Cliente\",\"sede\":\"Sede\"" ]}',

View File

@ -79,7 +79,7 @@ class Upload extends Model
$category = isset($data['category']) ? $data['category'] : $category;
// Nome e categoria dell'allegato
$model->setTranslation('name', !empty($name) ? $name : $original_name);
$model->name (!empty($name) ? $name : $original_name);
$model->category = $category;
// Nome di origine dell'allegato