Rimozione Translator
This commit is contained in:
parent
12c6243b8d
commit
a72c68909a
|
@ -129,13 +129,13 @@ if (!empty($query)) {
|
|||
// Formattazione automatica
|
||||
if (!empty($total['format'][$pos]) && !empty($value)) {
|
||||
if (formatter()->isStandardTimestamp($value)) {
|
||||
$value = Translator::timestampToLocale($value);
|
||||
$value = timestampFormat($value);
|
||||
} elseif (formatter()->isStandardDate($value)) {
|
||||
$value = Translator::dateToLocale($value);
|
||||
$value = dateFormat($value);
|
||||
} elseif (formatter()->isStandardTime($value)) {
|
||||
$value = Translator::timeToLocale($value);
|
||||
$value = timeFormat($value);
|
||||
} elseif (formatter()->isStandardNumber($value)) {
|
||||
$value = Translator::numberToLocale($value);
|
||||
$value = numberFormat($value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
7
core.php
7
core.php
|
@ -39,12 +39,6 @@ if (file_exists(__DIR__.'/config.inc.php')) {
|
|||
include_once __DIR__.'/config.inc.php';
|
||||
}
|
||||
|
||||
// Individuazione dei percorsi di base
|
||||
AppLegacy::definePaths(__DIR__);
|
||||
|
||||
$docroot = DOCROOT;
|
||||
$rootdir = ROOTDIR;
|
||||
$baseurl = BASEURL;
|
||||
/*
|
||||
// Sicurezza della sessioni
|
||||
ini_set('session.cookie_samesite', 'strict');
|
||||
|
@ -151,7 +145,6 @@ $dbo = $database = database();
|
|||
// Istanziamento del gestore delle traduzioni del progetto
|
||||
$lang = !empty($config['lang']) ? $config['lang'] : (isset($_GET['lang']) ? $_GET['lang'] : null);
|
||||
$formatter = !empty($config['formatter']) ? $config['formatter'] : [];
|
||||
AppLegacy::setFormatter($lang, $formatter);
|
||||
//$translator->addLocalePath(base_dir().'/locale');
|
||||
//$translator->addLocalePath(base_dir().'/modules/*/locale');
|
||||
//$translator->setLocale($lang, $formatter);
|
||||
|
|
|
@ -133,7 +133,7 @@ if (empty($record) || !$has_access) {
|
|||
$operation = $dbo->fetchOne("SELECT zz_operations.created_at, username FROM zz_operations INNER JOIN zz_users ON zz_operations.id_utente = zz_users.id WHERE op='delete' AND id_module=".prepare($id_module).' AND id_record='.prepare($id_record).' ORDER BY zz_operations.created_at DESC');
|
||||
|
||||
$info = tr('Il record è stato eliminato il <b>_DATE_</b> da <b>_USER_</b>', [
|
||||
'_DATE_' => (($operation['created_at']) ? Translator::timestampToLocale($operation['created_at']) : Translator::timestampToLocale($record['deleted_at'])),
|
||||
'_DATE_' => (($operation['created_at']) ? timestampFormat($operation['created_at']) : timestampFormat($record['deleted_at'])),
|
||||
'_USER_' => ((!empty($operation['username'])) ? $operation['username'] : 'N.D.'),
|
||||
]).'. ';
|
||||
|
||||
|
@ -381,7 +381,7 @@ if (empty($record) || !$has_access) {
|
|||
<h4 class="timeline-title">'.$description.'</h4>
|
||||
</div>
|
||||
<div class="col-md-4 text-right">
|
||||
<p><small class="label label-default tip" title="'.Translator::timestampToLocale($operation['created_at']).'"><i class="fa fa-clock-o"></i> '.Carbon::parse($operation['created_at'])->diffForHumans().'</small></p>
|
||||
<p><small class="label label-default tip" title="'.timestampFormat($operation['created_at']).'"><i class="fa fa-clock-o"></i> '.Carbon::parse($operation['created_at'])->diffForHumans().'</small></p>
|
||||
<p><small class="label label-default"><i class="fa fa-user"></i> '.$operation['username'].'</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -204,9 +204,9 @@ if (auth()->check()) {
|
|||
full_locale: "'.$lang.'",
|
||||
|
||||
start_date: "'.session('period_start').'",
|
||||
start_date_formatted: "'.Translator::dateToLocale(session('period_start')).'",
|
||||
start_date_formatted: "'.dateFormat(session('period_start')).'",
|
||||
end_date: "'.session('period_end').'",
|
||||
end_date_formatted: "'.Translator::dateToLocale(session('period_end')).'",
|
||||
end_date_formatted: "'.dateFormat(session('period_end')).'",
|
||||
|
||||
collapse_plugin_sidebar: '.intval(setting('Nascondere la barra dei plugin di default')).',
|
||||
|
||||
|
@ -384,7 +384,7 @@ if (auth()->check()) {
|
|||
</a></li>
|
||||
|
||||
<li><a style="cursor:default;padding:0px;padding-right:5px;padding-left:5px;margin-top:15px;" class="label label-'.$calendar_color_label.'">
|
||||
'.Translator::dateToLocale(session('period_start')).' - '.Translator::dateToLocale(session('period_end')).'
|
||||
'.dateFormat(session('period_start')).' - '.dateFormat(session('period_end')).'
|
||||
</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -142,7 +142,7 @@ function discountInfo(Accounting $riga, $mostra_maggiorazione = true)
|
|||
$totale = !empty($riga->sconto_percentuale) ? $riga->sconto_percentuale : $riga->sconto_unitario_corrente;
|
||||
|
||||
return replace($text, [
|
||||
'_TOT_' => Translator::numberToLocale(abs($totale)),
|
||||
'_TOT_' => numberFormat(abs($totale)),
|
||||
'_TYPE_' => !empty($riga->sconto_percentuale) ? '%' : currency(),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -356,7 +356,7 @@ function doc_references($info, $dir, $ignore = [])
|
|||
$description = tr('Rif. _DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => $document,
|
||||
'_NUM_' => $data[0]['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($data[0]['data']),
|
||||
'_DATE_' => dateFormat($data[0]['data']),
|
||||
]);
|
||||
} else {
|
||||
$description = tr('_DOC_ di riferimento _ID_ eliminato', [
|
||||
|
|
|
@ -437,3 +437,30 @@ function base_dir()
|
|||
{
|
||||
return base_url().'/legacy/';
|
||||
}
|
||||
|
||||
/**
|
||||
* Argomenti di ricerca dalla sessione.
|
||||
*
|
||||
* @param $module_id
|
||||
*
|
||||
* @since 2.5
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getSessionSearch($module_id)
|
||||
{
|
||||
$search = [];
|
||||
|
||||
$array = session('module_'.$module_id);
|
||||
if (!empty($array)) {
|
||||
foreach ($array as $field => $value) {
|
||||
if (!empty($value) && string_starts_with($field, 'search_')) {
|
||||
$field_name = str_replace('search_', '', $field);
|
||||
|
||||
$search[$field_name] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $search;
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ if (!function_exists('_')) {
|
|||
*/
|
||||
function numberFormat($number, $decimals = null)
|
||||
{
|
||||
return Translator::numberToLocale($number, $decimals);
|
||||
return formatter()->formatNumber($number, $decimals);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -211,7 +211,7 @@ function numberFormat($number, $decimals = null)
|
|||
*/
|
||||
function timestampFormat($timestamp)
|
||||
{
|
||||
return Translator::timestampToLocale($timestamp);
|
||||
return formatter()->formatTimestamp($timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -225,7 +225,7 @@ function timestampFormat($timestamp)
|
|||
*/
|
||||
function dateFormat($date)
|
||||
{
|
||||
return Translator::dateToLocale($date);
|
||||
return formatter()->formatDate($date);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -239,7 +239,7 @@ function dateFormat($date)
|
|||
*/
|
||||
function timeFormat($time)
|
||||
{
|
||||
return Translator::timeToLocale($time);
|
||||
return formatter()->formatTime($time);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -251,7 +251,7 @@ function timeFormat($time)
|
|||
*/
|
||||
function currency()
|
||||
{
|
||||
return \Translator::getCurrency();
|
||||
return AppLegacy::getCurrency();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
2
log.php
2
log.php
|
@ -59,7 +59,7 @@ for ($i = 0; $i < $n; ++$i) {
|
|||
$username = $rs[$i]['username'];
|
||||
$ip = $rs[$i]['ip'];
|
||||
|
||||
$timestamp = Translator::timestampToLocale($rs[$i]['created_at']);
|
||||
$timestamp = timestampFormat($rs[$i]['created_at']);
|
||||
|
||||
$status = auth()->getStatus();
|
||||
if ($rs[$i]['stato'] == $status['success']['code']) {
|
||||
|
|
|
@ -759,8 +759,8 @@ if (!empty($elementi)) {
|
|||
$descrizione = tr('_DOC_ _NUM_ del _DATE_ _DELETED_AT_', [
|
||||
'_DOC_' => $elemento['tipo_documento'],
|
||||
'_NUM_' => !empty($elemento['numero_esterno']) ? $elemento['numero_esterno'] : $elemento['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($elemento['data']),
|
||||
'_DELETED_AT_' => (!empty($elemento['deleted_at']) ? tr('Eliminato il:').' '.Translator::dateToLocale($elemento['deleted_at']) : ''),
|
||||
'_DATE_' => dateFormat($elemento['data']),
|
||||
'_DELETED_AT_' => (!empty($elemento['deleted_at']) ? tr('Eliminato il:').' '.dateFormat($elemento['deleted_at']) : ''),
|
||||
]);
|
||||
|
||||
//se non è un preventivo è un ddt o una fattura
|
||||
|
|
|
@ -138,7 +138,7 @@ echo '
|
|||
</a>
|
||||
</td>
|
||||
<td>'.Modules::link(Modules::get($allegato['id_module'])['name'], $file->id_record, $documento['descrizione']).'</td>
|
||||
<td class="text-center">'.Translator::dateToLocale($file->created_at).'</td>
|
||||
<td class="text-center">'.dateFormat($file->created_at).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ if( !$contratti->isEmpty() ){
|
|||
|
||||
$descrizione = tr('Contratto num. _NUM_ del _DATA_',[
|
||||
'_NUM_' => $contratto->numero,
|
||||
'_DATA_' => Translator::dateToLocale($contratto->data_bozza),
|
||||
'_DATA_' => dateFormat($contratto->data_bozza),
|
||||
]);
|
||||
echo '
|
||||
<tr>
|
||||
|
|
|
@ -44,7 +44,7 @@ switch ($resource) {
|
|||
($documenti[$i]['n2_documento'] != '') ? $n_documento = $documenti[$i]['n2_documento'] : $n_documento = $documenti[$i]['n_documento'];
|
||||
|
||||
$link_id = Modules::get($documenti[$i]['modulo'])['id'];
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_url().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.Translator::dateToLocale($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_url().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.dateFormat($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<td class='table_cell text-right'>".moneyFormat($documenti[$i]['costo_unitario'])."</td></tr>\n";
|
||||
array_push($ids, '"'.$documenti[$i]['id'].'"');
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ switch ($resource) {
|
|||
($documenti[$i]['n2_documento'] != '') ? $n_documento = $documenti[$i]['n2_documento'] : $n_documento = $documenti[$i]['n_documento'];
|
||||
|
||||
$link_id = Modules::get($documenti[$i]['modulo'])['id'];
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_url().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.Translator::dateToLocale($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_url().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.dateFormat($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<td class='table_cell text-right'>".moneyFormat($documenti[$i]['costo_unitario'])."</td></tr>\n";
|
||||
array_push($ids, '"'.$documenti[$i]['id'].'"');
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ switch ($resource) {
|
|||
($documenti[$i]['n2_documento'] != '') ? $n_documento = $documenti[$i]['n2_documento'] : $n_documento = $documenti[$i]['n_documento'];
|
||||
|
||||
$link_id = Modules::get($documenti[$i]['modulo'])['id'];
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_url().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.Translator::dateToLocale($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_url().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.dateFormat($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<td class='table_cell text-right'>".moneyFormat($documenti[$i]['costo_unitario'])."</td></tr>\n";
|
||||
array_push($ids, '"'.$documenti[$i]['id'].'"');
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@ switch ($resource) {
|
|||
$qta_sede = $dbo->fetchOne('SELECT SUM(mg_movimenti.qta) AS qta FROM mg_movimenti LEFT JOIN an_sedi ON an_sedi.id = mg_movimenti.idsede WHERE mg_movimenti.idarticolo = '.prepare($r['id']).' AND idsede = '.prepare($superselect['idsede_partenza']))['qta'];
|
||||
|
||||
$rs[$k] = array_merge($r, [
|
||||
'text' => $r['codice'].' - '.$r['descrizione'].' '.(!$r['servizio'] ? '('.Translator::numberToLocale($qta_sede).(!empty($r['um']) ? ' '.$r['um'] : '').')' : ''),
|
||||
'text' => $r['codice'].' - '.$r['descrizione'].' '.(!$r['servizio'] ? '('.numberFormat($qta_sede).(!empty($r['um']) ? ' '.$r['um'] : '').')' : ''),
|
||||
'disabled' => $qta_sede <= 0 && !$permetti_movimenti_sotto_zero && !$r['servizio'],
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -371,7 +371,7 @@ if (!empty($elementi)) {
|
|||
$descrizione = tr('_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => $elemento['tipo_documento'],
|
||||
'_NUM_' => !empty($elemento['numero_esterno']) ? $elemento['numero_esterno'] : $elemento['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($elemento['data']),
|
||||
'_DATE_' => dateFormat($elemento['data']),
|
||||
]);
|
||||
|
||||
//se non è un preventivo è un ddt o una fattura
|
||||
|
@ -389,7 +389,7 @@ if (!empty($elementi)) {
|
|||
echo '
|
||||
<tr>
|
||||
<td>'.Modules::link($modulo, $id, $descrizione).'</td>
|
||||
<td class="text-center">'.Translator::numberToLocale($elemento['qta_totale']).'</td>
|
||||
<td class="text-center">'.numberFormat($elemento['qta_totale']).'</td>
|
||||
<td class="text-right">'.moneyFormat($elemento['prezzo_unitario']).'</td>
|
||||
<td class="text-right">'.moneyFormat($elemento['prezzo_totale']).'</td>
|
||||
<tr>';
|
||||
|
|
|
@ -132,7 +132,7 @@ for ($i = 0; $i < count($rs2); ++$i) {
|
|||
<td>'.$rs2[$i]['serial'].'</td>';
|
||||
|
||||
echo '
|
||||
<td>'.Translator::timestampToLocale($rs2[$i]['created_at']).'</td>';
|
||||
<td>'.timestampFormat($rs2[$i]['created_at']).'</td>';
|
||||
|
||||
// Ricerca acquisti
|
||||
$acquisti = $dbo->fetchArray('SELECT * FROM mg_prodotti WHERE dir=\'uscita\' AND id_articolo='.prepare($id_record).' AND (id_riga_documento IS NOT NULL OR id_riga_ordine IS NOT NULL OR id_riga_ddt IS NOT NULL) AND serial='.prepare($rs2[$i]['serial']));
|
||||
|
@ -183,7 +183,7 @@ for ($i = 0; $i < count($rs2); ++$i) {
|
|||
$text = tr('_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => $data[0]['tipo_documento'],
|
||||
'_NUM_' => $numero,
|
||||
'_DATE_' => Translator::dateToLocale($data[0]['data']),
|
||||
'_DATE_' => dateFormat($data[0]['data']),
|
||||
]).(!empty($extra) ? ' '.$extra : '');
|
||||
|
||||
echo
|
||||
|
@ -202,7 +202,7 @@ for ($i = 0; $i < count($rs2); ++$i) {
|
|||
<span>'.moneyFormat($subtotale + $iva).'</span>';
|
||||
if (!empty($subtotale) && !empty($iva)) {
|
||||
echo '
|
||||
<small style="color:#555;">('.Translator::numberToLocale($subtotale).' + '.Translator::numberToLocale($iva).')</small>';
|
||||
<small style="color:#555;">('.numberFormat($subtotale).' + '.numberFormat($iva).')</small>';
|
||||
}
|
||||
echo '
|
||||
<br>';
|
||||
|
@ -285,11 +285,11 @@ for ($i = 0; $i < count($rs2); ++$i) {
|
|||
$text = tr('_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => $data[0]['tipo_documento'],
|
||||
'_NUM_' => $numero,
|
||||
'_DATE_' => Translator::dateToLocale($data[0]['data']),
|
||||
]).(!empty($extra) ? ' '.$extra : '');
|
||||
|
||||
echo
|
||||
Modules::link($module_id, $id, $text).'<br>';
|
||||
'_DATE_' => dateFormat($data[0]['data']),
|
||||
]).(!empty($extra) ? ' '.$extra : '');
|
||||
|
||||
echo '
|
||||
'.Modules::link($module_id, $id, $text).'<br>';
|
||||
}
|
||||
|
||||
echo '
|
||||
|
@ -304,7 +304,7 @@ for ($i = 0; $i < count($rs2); ++$i) {
|
|||
<span>'.moneyFormat($subtotale + $iva).'</span>';
|
||||
if (!empty($subtotale) && !empty($iva)) {
|
||||
echo '
|
||||
<small style="color:#555;">('.Translator::numberToLocale($subtotale).' + '.Translator::numberToLocale($iva).')</small>';
|
||||
<small style="color:#555;">('.numberFormat($subtotale).' + '.numberFormat($iva).')</small>';
|
||||
}
|
||||
echo '
|
||||
<br>';
|
||||
|
|
|
@ -55,10 +55,10 @@ $qta_totale = $dbo->fetchOne('SELECT SUM(qta) AS qta FROM mg_movimenti WHERE ida
|
|||
$qta_totale_attuale = $dbo->fetchOne('SELECT SUM(qta) AS qta FROM mg_movimenti WHERE idarticolo='.prepare($id_record).' AND data <= CURDATE()')['qta'];
|
||||
|
||||
echo '
|
||||
<p>'.tr('Quantità calcolata dai movimenti').': <b>'.Translator::numberToLocale($qta_totale, 'qta').' '.$record['um'].'</b> <span class="tip" title="'.tr('Quantità calcolata da tutti i movimenti registrati').'." ><i class="fa fa-question-circle-o"></i></span></p>';
|
||||
<p>'.tr('Quantità calcolata dai movimenti').': <b>'.numberFormat($qta_totale, 'qta').' '.$record['um'].'</b> <span class="tip" title="'.tr('Quantità calcolata da tutti i movimenti registrati').'." ><i class="fa fa-question-circle-o"></i></span></p>';
|
||||
|
||||
echo '
|
||||
<p>'.tr('Quantità calcolata attuale').': <b>'.Translator::numberToLocale($qta_totale_attuale, 'qta').' '.$record['um'].'</b> <span class="tip" title="'.tr('Quantità calcolata secondo i movimenti registrati con data oggi o date trascorse').'." ><i class="fa fa-question-circle-o"></i></span></p>';
|
||||
<p>'.tr('Quantità calcolata attuale').': <b>'.numberFormat($qta_totale_attuale, 'qta').' '.$record['um'].'</b> <span class="tip" title="'.tr('Quantità calcolata secondo i movimenti registrati con data oggi o date trascorse').'." ><i class="fa fa-question-circle-o"></i></span></p>';
|
||||
|
||||
// Individuazione movimenti
|
||||
$movimenti = $articolo->movimentiComposti()
|
||||
|
|
|
@ -37,7 +37,7 @@ if (!empty($rs)) {
|
|||
<br><small>'.$r['codice'].'</small>
|
||||
</td>
|
||||
<td>
|
||||
'.Translator::numberToLocale($r['qta'], 'qta').' '.$r['unitamisura'].'
|
||||
'.numberFormat($r['qta'], 'qta').' '.$r['unitamisura'].'
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
|
|
|
@ -222,8 +222,8 @@ if (file_exists($backup_dir)) {
|
|||
echo '
|
||||
<div class="callout callout-info">
|
||||
<h4>'.tr('Backup del _DATE_ alle _TIME_', [
|
||||
'_DATE_' => Translator::dateToLocale($data),
|
||||
'_TIME_' => Translator::timeToLocale($ora),
|
||||
'_DATE_' => dateFormat($data),
|
||||
'_TIME_' => timeFormat($ora),
|
||||
]).'</h4>
|
||||
<p><small>
|
||||
'.tr('Nome del file').': '.$name.'<br>
|
||||
|
@ -272,8 +272,8 @@ if (file_exists($backup_dir)) {
|
|||
echo '
|
||||
<div class="callout callout-warning">
|
||||
<h4>'.tr('Backup del _DATE_ alle _TIME_', [
|
||||
'_DATE_' => Translator::dateToLocale($data),
|
||||
'_TIME_' => Translator::timeToLocale($ora),
|
||||
'_DATE_' => dateFormat($data),
|
||||
'_TIME_' => timeFormat($ora),
|
||||
]).'</h4>
|
||||
<p><small>
|
||||
'.tr('Nome del file').': '.$name.'<br>
|
||||
|
|
|
@ -482,7 +482,7 @@ if (!empty($elementi)) {
|
|||
$descrizione = tr('_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => $elemento['tipo_documento'],
|
||||
'_NUM_' => !empty($elemento['numero_esterno']) ? $elemento['numero_esterno'] : $elemento['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($elemento['data']),
|
||||
'_DATE_' => dateFormat($elemento['data']),
|
||||
]);
|
||||
|
||||
echo '
|
||||
|
|
|
@ -52,7 +52,7 @@ if (!empty($interventi)) {
|
|||
<a href="javascript:;" class="btn btn-primary btn-xs" onclick="$(\'#dettagli_'.$intervento->id.'\').toggleClass(\'hide\'); $(this).find(\'i\').toggleClass(\'fa-plus\').toggleClass(\'fa-minus\');"><i class="fa fa-plus"></i></a>
|
||||
'.Modules::link('Interventi', $intervento->id, tr('Intervento num. _NUM_ del _DATE_', [
|
||||
'_NUM_' => $intervento->codice,
|
||||
'_DATE_' => Translator::dateToLocale($intervento->inizio),
|
||||
'_DATE_' => dateFormat($intervento->inizio),
|
||||
])).'
|
||||
</td>
|
||||
|
||||
|
@ -289,31 +289,31 @@ echo '
|
|||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Ore a contratto').':</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($totale_ore_contratto).'</td>
|
||||
<td class="text-right">'.numberFormat($totale_ore_contratto).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Ore erogate totali').':</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($totale_ore).'</td>
|
||||
<td class="text-right">'.numberFormat($totale_ore).'</td>
|
||||
</tr>';
|
||||
if (!empty($totale_ore_contratto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Ore residue totali').':</td>
|
||||
<td class="text-right">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore)).'</td>
|
||||
<td class="text-right">'.numberFormat(floatval($totale_ore_contratto) - floatval($totale_ore)).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Ore erogate concluse').':</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($totale_ore_completate).'</td>
|
||||
<td class="text-right">'.numberFormat($totale_ore_completate).'</td>
|
||||
</tr>';
|
||||
if (!empty($totale_ore_contratto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Ore residue concluse').':</td>
|
||||
<td class="text-right">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore_completate)).'</td>
|
||||
<td class="text-right">'.numberFormat(floatval($totale_ore_contratto) - floatval($totale_ore_completate)).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -345,10 +345,10 @@ if (empty($totale_ore_contratto)) {
|
|||
echo '
|
||||
<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tipologia['ore']).'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tipologia['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tipologia['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($tipologia['ore']).'</td>
|
||||
<td class="text-right">'.numberFormat($tipologia['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($tipologia['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -372,11 +372,11 @@ if (empty($totale_ore_contratto)) {
|
|||
echo '
|
||||
<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tecnico['ore']).'</td>
|
||||
<td class="text-right">'.numberFormat($tecnico['ore']).'</td>
|
||||
<td class="text-right">'.(int)$tecnico['km'].'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tecnico['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tecnico['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($tecnico['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($tecnico['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -401,10 +401,10 @@ if (empty($totale_ore_contratto)) {
|
|||
echo '
|
||||
<tr>
|
||||
<td><div class="img-circle" style="width:18px; height:18px; position:relative; bottom:-2px; background:'.$stato['colore'].'; float:left;"></div> '.$key.'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($stato['ore']).'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($stato['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($stato['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($stato['ore']).'</td>
|
||||
<td class="text-right">'.numberFormat($stato['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($stato['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -430,9 +430,9 @@ if (empty($totale_ore_contratto)) {
|
|||
<tr>
|
||||
<td>'.Modules::link('Articoli', $materiale['id'], $key).'</td>
|
||||
<td class="text-center">'.$materiale['qta'].'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
@ -446,9 +446,9 @@ if (empty($totale_ore_contratto)) {
|
|||
<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td class="text-center">'.$materiale['qta'].'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
|
|
@ -28,6 +28,6 @@ return [
|
|||
'ragione_sociale' => $r['ragione_sociale'],
|
||||
'numero' => $r['numero'],
|
||||
'descrizione' => $r['descrizione'],
|
||||
'data' => Translator::dateToLocale($r['data_bozza']),
|
||||
'data' => dateFormat($r['data_bozza']),
|
||||
'id_anagrafica' => $r['idanagrafica'],
|
||||
];
|
||||
|
|
|
@ -44,9 +44,9 @@ if (!empty($rs)) {
|
|||
</tr>';
|
||||
|
||||
foreach ($rs as $r) {
|
||||
$data_accettazione = !empty($r['data_accettazione']) ? Translator::dateToLocale($r['data_accettazione']) : '';
|
||||
$data_accettazione = !empty($r['data_accettazione']) ? dateFormat($r['data_accettazione']) : '';
|
||||
|
||||
$data_conclusione = !empty($r['data_conclusione']) ? Translator::dateToLocale($r['data_conclusione']) : '';
|
||||
$data_conclusione = !empty($r['data_conclusione']) ? dateFormat($r['data_conclusione']) : '';
|
||||
|
||||
// Se scaduto, segna la riga in rosso
|
||||
$class = (strtotime($r['data_conclusione']) < strtotime(date('Y-m-d')) && !empty($data_conclusione)) ? 'danger' : '';
|
||||
|
|
|
@ -223,7 +223,7 @@ switch (filter('op')) {
|
|||
if (!empty($rs)) {
|
||||
$tecnici = [];
|
||||
foreach ($rs as $sessione) {
|
||||
$tecnici[] = $sessione['nome_tecnico'].' ('.Translator::timestampToLocale($sessione['orario_inizio']).' - '.Translator::timeToLocale($sessione['orario_fine']).')';
|
||||
$tecnici[] = $sessione['nome_tecnico'].' ('.timestampFormat($sessione['orario_inizio']).' - '.timeFormat($sessione['orario_fine']).')';
|
||||
}
|
||||
|
||||
// Lettura dati intervento
|
||||
|
@ -243,10 +243,10 @@ switch (filter('op')) {
|
|||
|
||||
$tooltip = '<b>'.tr('Numero intervento').'</b>: '.$rs[0]['codice'].'<br/>';
|
||||
|
||||
$tooltip .= '<b>'.tr('Data richiesta').'</b>: '.Translator::timestampToLocale($rs[0]['data_richiesta']).'<br/>';
|
||||
$tooltip .= '<b>'.tr('Data richiesta').'</b>: '.timestampFormat($rs[0]['data_richiesta']).'<br/>';
|
||||
|
||||
if (!empty($rs[0]['data_scadenza'])) {
|
||||
$tooltip .= '<b>'.tr('Data scadenza').'</b>: '.Translator::timestampToLocale($rs[0]['data_scadenza']).'<br/>';
|
||||
$tooltip .= '<b>'.tr('Data scadenza').'</b>: '.timestampFormat($rs[0]['data_scadenza']).'<br/>';
|
||||
}
|
||||
|
||||
$tooltip .= '<b>'.tr('Tipo intervento').'</b>: '.nl2br($desc_tipointervento).'<br/>';
|
||||
|
|
|
@ -52,7 +52,7 @@ foreach ($rs as $r) {
|
|||
$numero = empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'];
|
||||
|
||||
$result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['title'] = $r['tipologia'].' num. '.$numero.' del '.Translator::dateToLocale($r['data']);
|
||||
$result['title'] = $r['tipologia'].' num. '.$numero.' del '.dateFormat($r['data']);
|
||||
$result['category'] = $r['tipologia'];
|
||||
|
||||
// Campi da evidenziare
|
||||
|
|
|
@ -515,7 +515,7 @@ if (!empty($elementi)) {
|
|||
$descrizione = tr('_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => $fattura['tipo_documento'],
|
||||
'_NUM_' => !empty($fattura['numero_esterno']) ? $fattura['numero_esterno'] : $fattura['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($fattura['data']),
|
||||
'_DATE_' => dateFormat($fattura['data']),
|
||||
]);
|
||||
|
||||
$modulo = ($fattura['dir'] == 'entrata') ? 'Fatture di vendita' : 'Fatture di acquisto';
|
||||
|
|
|
@ -26,7 +26,7 @@ return [
|
|||
'email' => $r['email'],
|
||||
'numero' => empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'],
|
||||
'note' => $r['note'],
|
||||
'data' => Translator::dateToLocale($r['data']),
|
||||
'data' => dateFormat($r['data']),
|
||||
'id_anagrafica' => $r['idanagrafica'],
|
||||
'ragione_sociale' => $r['ragione_sociale'],
|
||||
];
|
||||
|
|
|
@ -71,7 +71,7 @@ foreach ($rs as $key => $value) {
|
|||
$intervento = \Modules\Interventi\Intervento::find($value['id']);
|
||||
$prezzo = $intervento->totale;
|
||||
|
||||
$rs[$key]['prezzo'] = Translator::numberToLocale($prezzo);
|
||||
$rs[$key]['prezzo'] = numberFormat($prezzo);
|
||||
$rs[$key]['descrizione_intervento'] = strip_tags($rs[$key]['descrizione_intervento']);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ foreach ($rs as $r) {
|
|||
$numero = empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'];
|
||||
|
||||
$result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['title'] = $r['tipologia'].' num. '.$numero.' del '.Translator::dateToLocale($r['data']);
|
||||
$result['title'] = $r['tipologia'].' num. '.$numero.' del '.dateFormat($r['data']);
|
||||
$result['category'] = $r['tipologia'];
|
||||
|
||||
// Campi da evidenziare
|
||||
|
|
|
@ -229,7 +229,7 @@ elseif ($record['stato'] == 'Bozza') {
|
|||
?>
|
||||
|
||||
<div class="col-md-2" <?php echo ($is_fiscale) ? '' : 'hidden'; ?> >
|
||||
{[ "type": "select", "label": "<?php echo tr('Stato FE'); ?>", "name": "codice_stato_fe", "values": "query=SELECT codice as id, CONCAT_WS(' - ',codice,descrizione) as text FROM fe_stati_documento", "value": "$codice_stato_fe$", "disabled": <?php echo intval(Interaction::isEnabled() || ($record['stato'] == 'Bozza' && $abilita_genera)); ?>, "class": "unblockable", "help": "<?php echo (!empty($record['data_stato_fe'])) ? Translator::timestampToLocale($record['data_stato_fe']) : ''; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Stato FE'); ?>", "name": "codice_stato_fe", "values": "query=SELECT codice as id, CONCAT_WS(' - ',codice,descrizione) as text FROM fe_stati_documento", "value": "$codice_stato_fe$", "disabled": <?php echo intval(Interaction::isEnabled() || ($record['stato'] == 'Bozza' && $abilita_genera)); ?>, "class": "unblockable", "help": "<?php echo (!empty($record['data_stato_fe'])) ? timestampFormat($record['data_stato_fe']) : ''; ?>" ]}
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
@ -867,7 +867,7 @@ if (!empty($note_accredito)) {
|
|||
foreach ($note_accredito as $nota) {
|
||||
$text = tr('Rif. fattura _NUM_ del _DATE_', [
|
||||
'_NUM_' => $nota['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($nota['data']),
|
||||
'_DATE_' => dateFormat($nota['data']),
|
||||
]);
|
||||
|
||||
echo '
|
||||
|
|
|
@ -198,10 +198,10 @@ class Fattura extends Document
|
|||
// Registrazione dell'operazione nelle note
|
||||
$notes[] = tr("Operazione non imponibile come da vostra dichiarazione d'intento nr _PROT_ del _PROT_DATE_ emessa in data _RELEASE_DATE_, da noi registrata al nr _ID_ del _DATE_", [
|
||||
'_PROT_' => $dichiarazione->numero_protocollo,
|
||||
'_PROT_DATE_' => Translator::dateToLocale($dichiarazione->data_protocollo),
|
||||
'_RELEASE_DATE_' => Translator::dateToLocale($dichiarazione->data_emissione),
|
||||
'_PROT_DATE_' => dateFormat($dichiarazione->data_protocollo),
|
||||
'_RELEASE_DATE_' => dateFormat($dichiarazione->data_emissione),
|
||||
'_ID_' => $dichiarazione->id,
|
||||
'_DATE_' => Translator::dateToLocale($dichiarazione->data),
|
||||
'_DATE_' => dateFormat($dichiarazione->data),
|
||||
]).'.';
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ return [
|
|||
'numero' => empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'],
|
||||
'tipo_documento' => $r['tipo_documento'],
|
||||
'note' => $r['note'],
|
||||
'data' => Translator::dateToLocale($r['data']),
|
||||
'data' => dateFormat($r['data']),
|
||||
'logo_azienda' => !empty($logo_azienda) ? '<img src="'.$logo_azienda.'" />' : '',
|
||||
'conto' => $conto,
|
||||
'conto_descrizione' => $conto_descrizione,
|
||||
|
|
|
@ -54,7 +54,7 @@ foreach ($rs as $r) {
|
|||
$result = [];
|
||||
|
||||
$result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['title'] = 'Intervento '.$r['codice'].' del '.Translator::dateToLocale($r['data']);
|
||||
$result['title'] = 'Intervento '.$r['codice'].' del '.dateFormat($r['data']);
|
||||
$result['category'] = 'Interventi';
|
||||
|
||||
// Campi da evidenziare
|
||||
|
|
|
@ -98,39 +98,39 @@ if (!empty($sessioni)) {
|
|||
// Orario di inizio
|
||||
echo '
|
||||
<td>
|
||||
'.Translator::timestampToLocale($sessione['orario_inizio']).'
|
||||
'.timestampFormat($sessione['orario_inizio']).'
|
||||
</td>';
|
||||
|
||||
// Orario di fine
|
||||
echo '
|
||||
<td>
|
||||
'.Translator::timestampToLocale($sessione['orario_fine']).'
|
||||
'.timestampFormat($sessione['orario_fine']).'
|
||||
</td>';
|
||||
|
||||
// ORE
|
||||
echo '
|
||||
<td style="border-right:1px solid #aaa;">
|
||||
'.Translator::numberToLocale($ore).'
|
||||
'.numberFormat($ore).'
|
||||
|
||||
<div class="extra hide">
|
||||
<table class="table table-condensed table-bordered">
|
||||
<tr>
|
||||
<th class="text-danger">'.tr('Costo').':</th>
|
||||
<td class="text-right">
|
||||
'.Translator::numberToLocale($costo_ore_consuntivo_tecnico)."
|
||||
<small class='help-block'>".Translator::numberToLocale($costo_ore_unitario_tecnico).'x'.Translator::numberToLocale($ore).'<br>+'.Translator::numberToLocale($costo_dirittochiamata_tecnico).'</small>
|
||||
'.numberFormat($costo_ore_consuntivo_tecnico)."
|
||||
<small class='help-block'>".numberFormat($costo_ore_unitario_tecnico).'x'.numberFormat($ore).'<br>+'.numberFormat($costo_dirittochiamata_tecnico).'</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>'.tr('Addebito').':</th>
|
||||
<td class="text-right">
|
||||
'.Translator::numberToLocale($costo_ore_consuntivo).'
|
||||
<small class="help-block">'.Translator::numberToLocale($costo_ore_unitario).'x'.Translator::numberToLocale($ore).'<br>+'.Translator::numberToLocale($costo_dirittochiamata).'</small>
|
||||
'.numberFormat($costo_ore_consuntivo).'
|
||||
<small class="help-block">'.numberFormat($costo_ore_unitario).'x'.numberFormat($ore).'<br>+'.numberFormat($costo_dirittochiamata).'</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>'.tr('Scontato').':</th>
|
||||
<td class="text-right">'.Translator::numberToLocale($costo_ore_consuntivo - $sconto).'</td>
|
||||
<td class="text-right">'.numberFormat($costo_ore_consuntivo - $sconto).'</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -139,31 +139,31 @@ if (!empty($sessioni)) {
|
|||
// KM
|
||||
echo '
|
||||
<td style="border-right:1px solid #aaa;">
|
||||
'.Translator::numberToLocale($km).'
|
||||
'.numberFormat($km).'
|
||||
|
||||
<div class="extra hide">
|
||||
<table class="table table-condensed table-bordered">
|
||||
<tr>
|
||||
<th class="text-danger">'.tr('Costo').':</th>
|
||||
<td class="text-right">
|
||||
'.Translator::numberToLocale($costo_km_consuntivo_tecnico).'
|
||||
'.numberFormat($costo_km_consuntivo_tecnico).'
|
||||
<small class="help-block">
|
||||
'.Translator::numberToLocale($costo_km_unitario_tecnico).'x'.Translator::numberToLocale($km).'
|
||||
'.numberFormat($costo_km_unitario_tecnico).'x'.numberFormat($km).'
|
||||
</small><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>'.tr('Addebito').':</th>
|
||||
<td class="text-right">
|
||||
'.Translator::numberToLocale($costo_km_consuntivo).'
|
||||
'.numberFormat($costo_km_consuntivo).'
|
||||
<small class="help-block">
|
||||
'.Translator::numberToLocale($costo_km_unitario).'x'.Translator::numberToLocale($km).'
|
||||
'.numberFormat($costo_km_unitario).'x'.numberFormat($km).'
|
||||
</small><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>'.tr('Scontato').':</th>
|
||||
<td class="text-right">'.Translator::numberToLocale($costo_km_consuntivo - $scontokm).'</td>
|
||||
<td class="text-right">'.numberFormat($costo_km_consuntivo - $scontokm).'</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -174,7 +174,7 @@ if (!empty($sessioni)) {
|
|||
echo '
|
||||
<td style="border-right:1px solid #aaa;">
|
||||
'.tr('_TOT_ _TYPE_', [
|
||||
'_TOT_' => Translator::numberToLocale($sessione['sconto_unitario']),
|
||||
'_TOT_' => numberFormat($sessione['sconto_unitario']),
|
||||
'_TYPE_' => ($sessione['tipo_sconto'] == 'PRC' ? '%' : currency()),
|
||||
]).'
|
||||
</td>';
|
||||
|
@ -185,7 +185,7 @@ if (!empty($sessioni)) {
|
|||
echo '
|
||||
<td style="border-right:1px solid #aaa;">
|
||||
'.tr('_TOT_ _TYPE_', [
|
||||
'_TOT_' => Translator::numberToLocale($sessione['scontokm_unitario']),
|
||||
'_TOT_' => numberFormat($sessione['scontokm_unitario']),
|
||||
'_TYPE_' => ($sessione['tipo_sconto_km'] == 'PRC' ? '%' : currency()),
|
||||
]).'
|
||||
</td>';
|
||||
|
|
|
@ -118,7 +118,7 @@ switch (post('op')) {
|
|||
|
||||
$descrizione = tr('Attività numero _NUM_ del _DATE_ [_STATE_]', [
|
||||
'_NUM_' => $intervento['codice_intervento'],
|
||||
'_DATE_' => Translator::dateToLocale($intervento['data']),
|
||||
'_DATE_' => dateFormat($intervento['data']),
|
||||
'_STATE_' => $intervento['stato'],
|
||||
]);
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ if (empty($record['firma_file'])) {
|
|||
} else {
|
||||
$frase = tr('Nuova anteprima e firma');
|
||||
$info_firma = ''.tr('Firmato il _DATE_ alle _TIME_ da _PERSON_', [
|
||||
'_DATE_' => Translator::dateToLocale($record['firma_data']),
|
||||
'_TIME_' => Translator::timeToLocale($record['firma_data']),
|
||||
'_DATE_' => dateFormat($record['firma_data']),
|
||||
'_TIME_' => timeFormat($record['firma_data']),
|
||||
'_PERSON_' => '<b>'.$record['firma_nome'].'</b>',
|
||||
]).'';
|
||||
}
|
||||
|
|
|
@ -534,8 +534,8 @@ $articoli = $intervento->articoli;
|
|||
echo '
|
||||
<img src="'.base_url().'/files/interventi/'.$record['firma_file'].'" class="img-thumbnail"><div> </div>
|
||||
<div class="col-md-6 col-md-offset-3 alert alert-success"><i class="fa fa-check"></i> '.tr('Firmato il _DATE_ alle _TIME_ da _PERSON_', [
|
||||
'_DATE_' => Translator::dateToLocale($record['firma_data']),
|
||||
'_TIME_' => Translator::timeToLocale($record['firma_data']),
|
||||
'_DATE_' => dateFormat($record['firma_data']),
|
||||
'_TIME_' => timeFormat($record['firma_data']),
|
||||
'_PERSON_' => '<b>'.$record['firma_nome'].'</b>',
|
||||
]).'</div>';
|
||||
}
|
||||
|
@ -763,7 +763,7 @@ if (!empty($elementi)) {
|
|||
$descrizione = tr('_DOC_ num. _NUM_ del _DATE_ [_STATE_]', [
|
||||
'_DOC_' => $fattura['tipo_documento'],
|
||||
'_NUM_' => !empty($fattura['numero_esterno']) ? $fattura['numero_esterno'] : $fattura['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($fattura['data']),
|
||||
'_DATE_' => dateFormat($fattura['data']),
|
||||
'_STATE_' => $fattura['stato_documento'],
|
||||
]);
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ $righe = $intervento->getRighe();
|
|||
// Quantità
|
||||
echo '
|
||||
<td class="text-right">
|
||||
'.Translator::numberToLocale($riga->qta, 'qta').' '.$riga->um.'
|
||||
'.numberFormat($riga->qta, 'qta').' '.$riga->um.'
|
||||
</td>';
|
||||
|
||||
if ($show_prezzi) {
|
||||
|
|
|
@ -29,9 +29,9 @@ return [
|
|||
'numero' => $r['codice'],
|
||||
'richiesta' => $r['richiesta'],
|
||||
'descrizione' => $r['descrizione'],
|
||||
'data' => Translator::dateToLocale($r['data_richiesta']),
|
||||
'data richiesta' => Translator::dateToLocale($r['data_richiesta']),
|
||||
'data fine intervento' => empty($r['data_fine']) ? Translator::dateToLocale($r['data_richiesta']) : Translator::dateToLocale($r['data_fine']),
|
||||
'data' => dateFormat($r['data_richiesta']),
|
||||
'data richiesta' => dateFormat($r['data_richiesta']),
|
||||
'data fine intervento' => empty($r['data_fine']) ? dateFormat($r['data_richiesta']) : dateFormat($r['data_fine']),
|
||||
'id_anagrafica' => $r['idanagrafica'],
|
||||
'stato' => $r['stato'],
|
||||
];
|
||||
|
|
|
@ -30,7 +30,7 @@ if (!empty($rs)) {
|
|||
</tr>';
|
||||
|
||||
foreach ($rs as $r) {
|
||||
$data_richiesta = !empty($r['data_richiesta']) ? Translator::dateToLocale($r['data_richiesta']) : '';
|
||||
$data_richiesta = !empty($r['data_richiesta']) ? dateFormat($r['data_richiesta']) : '';
|
||||
|
||||
echo '
|
||||
<tr >
|
||||
|
|
|
@ -92,7 +92,7 @@ foreach ($raggruppamenti as $mese => $raggruppamento) {
|
|||
echo '
|
||||
</small>
|
||||
</td>
|
||||
<td>'.Translator::dateToLocale($r['data_richiesta']).' '.((empty($r['data_scadenza'])) ? '' : '<br><small>Entro il '.Translator::dateToLocale($r['data_scadenza']).'</small>').'</td>
|
||||
<td>'.dateFormat($r['data_richiesta']).' '.((empty($r['data_scadenza'])) ? '' : '<br><small>Entro il '.dateFormat($r['data_scadenza']).'</small>').'</td>
|
||||
<td>
|
||||
'.$rs_tecnici[0]['tecnici'].'
|
||||
</td>
|
||||
|
|
|
@ -53,7 +53,7 @@ if (!empty($rs)) {
|
|||
echo '
|
||||
</small>
|
||||
</td>
|
||||
<td>'.Translator::dateToLocale($r['data_richiesta']).' '.((empty($r['data_scadenza'])) ? '' : '<br><small>Entro il '.Translator::dateToLocale($r['data_scadenza']).'</small>').'</td>
|
||||
<td>'.dateFormat($r['data_richiesta']).' '.((empty($r['data_scadenza'])) ? '' : '<br><small>Entro il '.dateFormat($r['data_scadenza']).'</small>').'</td>
|
||||
<td>
|
||||
'.$rs_tecnici[0]['tecnici'].'
|
||||
</td>
|
||||
|
|
|
@ -358,7 +358,7 @@ if (!empty($elementi)) {
|
|||
$descrizione = tr('_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => $elemento['tipo_documento'],
|
||||
'_NUM_' => !empty($elemento['numero_esterno']) ? $elemento['numero_esterno'] : $elemento['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($elemento['data']),
|
||||
'_DATE_' => dateFormat($elemento['data']),
|
||||
]);
|
||||
|
||||
if (!in_array($elemento['tipo_documento'], ['Ddt in uscita', 'Ddt in entrata'])) {
|
||||
|
|
|
@ -49,7 +49,7 @@ if (!empty($interventi)) {
|
|||
<a href="javascript:;" class="btn btn-primary btn-xs" onclick="$(\'#dettagli_'.$intervento->id.'\').toggleClass(\'hide\'); $(this).find(\'i\').toggleClass(\'fa-plus\').toggleClass(\'fa-minus\');"><i class="fa fa-plus"></i></a>
|
||||
'.Modules::link('Interventi', $intervento->id, tr('Intervento num. _NUM_ del _DATE_', [
|
||||
'_NUM_' => $intervento->codice,
|
||||
'_DATE_' => Translator::dateToLocale($intervento->inizio),
|
||||
'_DATE_' => dateFormat($intervento->inizio),
|
||||
])).'
|
||||
</td>
|
||||
|
||||
|
@ -290,10 +290,10 @@ if ($diff > 0) {
|
|||
echo '
|
||||
<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tipologia['ore']).'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tipologia['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tipologia['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($tipologia['ore']).'</td>
|
||||
<td class="text-right">'.numberFormat($tipologia['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($tipologia['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -317,11 +317,11 @@ if ($diff > 0) {
|
|||
echo '
|
||||
<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tecnico['ore']).'</td>
|
||||
<td class="text-right">'.numberFormat($tecnico['ore']).'</td>
|
||||
<td class="text-right">'.(int)$tecnico['km'].'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tecnico['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tecnico['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($tecnico['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($tecnico['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -346,10 +346,10 @@ if ($diff > 0) {
|
|||
echo '
|
||||
<tr>
|
||||
<td><div class="img-circle" style="width:18px; height:18px; position:relative; bottom:-2px; background:'.$stato['colore'].'; float:left;"></div> '.$key.'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($stato['ore']).'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($stato['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($stato['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($stato['ore']).'</td>
|
||||
<td class="text-right">'.numberFormat($stato['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($stato['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -375,9 +375,9 @@ if ($diff > 0) {
|
|||
<tr>
|
||||
<td>'.Modules::link('Articoli', $materiale['id'], $key).'</td>
|
||||
<td class="text-center">'.$materiale['qta'].'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
@ -391,9 +391,9 @@ if ($diff > 0) {
|
|||
<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td class="text-center">'.$materiale['qta'].'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
|
|
@ -130,12 +130,12 @@ foreach ($righe as $riga) {
|
|||
}
|
||||
|
||||
if (!empty($riga->ora_evasione)) {
|
||||
$ora_evasione = '<br>'.Translator::timeToLocale($riga->ora_evasione).'';
|
||||
$ora_evasione = '<br>'.timeFormat($riga->ora_evasione).'';
|
||||
} else {
|
||||
$ora_evasione = '';
|
||||
}
|
||||
|
||||
$info_evasione = '<span class="tip" title="'.$evasione_help.'"><i class="'.$evasione_icon.'"></i> '.Translator::dateToLocale($riga->data_evasione).$ora_evasione.'</span>';
|
||||
$info_evasione = '<span class="tip" title="'.$evasione_help.'"><i class="'.$evasione_icon.'"></i> '.dateFormat($riga->data_evasione).$ora_evasione.'</span>';
|
||||
}
|
||||
|
||||
echo '
|
||||
|
|
|
@ -27,5 +27,5 @@ return [
|
|||
'id_anagrafica' => $r['idanagrafica'],
|
||||
'numero' => empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'],
|
||||
'note' => $r['note'],
|
||||
'data' => Translator::dateToLocale($r['data']),
|
||||
'data' => dateFormat($r['data']),
|
||||
];
|
||||
|
|
|
@ -195,7 +195,7 @@ foreach ($primo_livello as $conto_primo) {
|
|||
// Span con info del conto
|
||||
echo '
|
||||
<span class="clickable" id="movimenti-'.$conto_terzo['id'].'">
|
||||
'.$conto_secondo['numero'].'.'.$conto_terzo['numero'].' '.$conto_terzo['descrizione'].($conto_terzo['percentuale_deducibile'] < 100 ? ' <span class="text-muted">('.tr('deducibile al _PERC_%', ['_PERC_' => Translator::numberToLocale($conto_terzo['percentuale_deducibile'], 0)]).')</span>' : '').'
|
||||
'.$conto_secondo['numero'].'.'.$conto_terzo['numero'].' '.$conto_terzo['descrizione'].($conto_terzo['percentuale_deducibile'] < 100 ? ' <span class="text-muted">('.tr('deducibile al _PERC_%', ['_PERC_' => numberFormat($conto_terzo['percentuale_deducibile'], 0)]).')</span>' : '').'
|
||||
</span>
|
||||
<div id="conto_'.$conto_terzo['id'].'" style="display:none;"></div>
|
||||
</td>
|
||||
|
|
|
@ -50,7 +50,7 @@ foreach ($rs as $r) {
|
|||
$result['title'] = 'Preventivo '.$r['numero'];
|
||||
|
||||
if ($r['data_accettazione'] == '0000-00-00') {
|
||||
$result['title'] .= ' del '.Translator::dateToLocale($r['data_accettazione']);
|
||||
$result['title'] .= ' del '.dateFormat($r['data_accettazione']);
|
||||
}
|
||||
|
||||
$result['category'] = 'Preventivi';
|
||||
|
|
|
@ -402,7 +402,7 @@ if (!empty($elementi)) {
|
|||
$descrizione = tr('_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => $elemento['tipo_documento'],
|
||||
'_NUM_' => !empty($elemento['numero_esterno']) ? $elemento['numero_esterno'] : $elemento['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($elemento['data']),
|
||||
'_DATE_' => dateFormat($elemento['data']),
|
||||
]);
|
||||
|
||||
echo '
|
||||
|
|
|
@ -49,7 +49,7 @@ if (!empty($interventi)) {
|
|||
<a href="javascript:;" class="btn btn-primary btn-xs" onclick="$(\'#dettagli_'.$intervento->id.'\').toggleClass(\'hide\'); $(this).find(\'i\').toggleClass(\'fa-plus\').toggleClass(\'fa-minus\');"><i class="fa fa-plus"></i></a>
|
||||
'.Modules::link('Interventi', $intervento->id, tr('Intervento num. _NUM_ del _DATE_', [
|
||||
'_NUM_' => $intervento->codice,
|
||||
'_DATE_' => Translator::dateToLocale($intervento->inizio),
|
||||
'_DATE_' => dateFormat($intervento->inizio),
|
||||
])).'
|
||||
</td>
|
||||
|
||||
|
@ -290,10 +290,10 @@ if ($diff > 0) {
|
|||
echo '
|
||||
<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tipologia['ore']).'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tipologia['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tipologia['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($tipologia['ore']).'</td>
|
||||
<td class="text-right">'.numberFormat($tipologia['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($tipologia['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -317,11 +317,11 @@ if ($diff > 0) {
|
|||
echo '
|
||||
<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tecnico['ore']).'</td>
|
||||
<td class="text-right">'.numberFormat($tecnico['ore']).'</td>
|
||||
<td class="text-right">'.(int)$tecnico['km'].'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tecnico['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($tecnico['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($tecnico['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($tecnico['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -346,10 +346,10 @@ if ($diff > 0) {
|
|||
echo '
|
||||
<tr>
|
||||
<td><div class="img-circle" style="width:18px; height:18px; position:relative; bottom:-2px; background:'.$stato['colore'].'; float:left;"></div> '.$key.'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($stato['ore']).'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($stato['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($stato['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($stato['ore']).'</td>
|
||||
<td class="text-right">'.numberFormat($stato['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($stato['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -375,9 +375,9 @@ if ($diff > 0) {
|
|||
<tr>
|
||||
<td>'.Modules::link('Articoli', $materiale['id'], $key).'</td>
|
||||
<td class="text-center">'.$materiale['qta'].'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
@ -391,9 +391,9 @@ if ($diff > 0) {
|
|||
<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td class="text-center">'.$materiale['qta'].'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right">'.numberFormat($materiale['costo']).' €</td>
|
||||
<td class="text-right">'.numberFormat($materiale['ricavo']).' €</td>
|
||||
<td class="text-right '.($margine>0 ? 'bg-success' : 'bg-danger').'">'.numberFormat($margine).' € ('.$margine_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
|
|
@ -91,12 +91,12 @@ foreach ($righe as $riga) {
|
|||
}
|
||||
|
||||
if (!empty($riga->ora_evasione)) {
|
||||
$ora_evasione = '<br>'.Translator::timeToLocale($riga->ora_evasione).'';
|
||||
$ora_evasione = '<br>'.timeFormat($riga->ora_evasione).'';
|
||||
} else {
|
||||
$ora_evasione = '';
|
||||
}
|
||||
|
||||
$info_evasione = '<span class="tip" title="'.$evasione_help.'"><i class="'.$evasione_icon.'"></i> '.Translator::dateToLocale($riga->data_evasione).$ora_evasione.'</span>';
|
||||
$info_evasione = '<span class="tip" title="'.$evasione_help.'"><i class="'.$evasione_icon.'"></i> '.dateFormat($riga->data_evasione).$ora_evasione.'</span>';
|
||||
}
|
||||
|
||||
echo '
|
||||
|
|
|
@ -30,7 +30,7 @@ return [
|
|||
'numero' => $r['numero'],
|
||||
'ragione_sociale' => $r['ragione_sociale'],
|
||||
'descrizione' => $r['descrizione'],
|
||||
'data' => Translator::dateToLocale($r['data_bozza']),
|
||||
'data' => dateFormat($r['data_bozza']),
|
||||
'id_anagrafica' => $r['idanagrafica'],
|
||||
'revisione' => $revisione,
|
||||
];
|
||||
|
|
|
@ -33,8 +33,8 @@ if (!empty($rs)) {
|
|||
</tr>";
|
||||
|
||||
foreach ($rs as $preventivo) {
|
||||
$data_accettazione = ($preventivo['data_accettazione'] != '0000-00-00') ? Translator::dateToLocale($preventivo['data_accettazione']) : '';
|
||||
$data_conclusione = ($preventivo['data_conclusione'] != '0000-00-00') ? Translator::dateToLocale($preventivo['data_conclusione']) : '';
|
||||
$data_accettazione = ($preventivo['data_accettazione'] != '0000-00-00') ? dateFormat($preventivo['data_accettazione']) : '';
|
||||
$data_conclusione = ($preventivo['data_conclusione'] != '0000-00-00') ? dateFormat($preventivo['data_conclusione']) : '';
|
||||
|
||||
if (strtotime($preventivo['data_conclusione']) < strtotime(date('Y-m-d')) && $data_conclusione != '') {
|
||||
$attr = ' class="danger"';
|
||||
|
|
|
@ -227,13 +227,13 @@ if ($numero_documenti + $numero_scadenze > 1) {
|
|||
'_OP_' => $operation,
|
||||
'_DOC_' => strtolower($tipo_fattura),
|
||||
'_NUM_' => $numero_fattura,
|
||||
'_DATE_' => Translator::dateToLocale($fattura['data']),
|
||||
'_DATE_' => dateFormat($fattura['data']),
|
||||
'_NAME_' => $fattura->anagrafica['ragione_sociale'],
|
||||
]);
|
||||
} elseif ($numero_scadenze == 1) {
|
||||
$descrizione = tr('Pag. _OP_ del _DATE_', [
|
||||
'_OP_' => $scadenza['descrizione'],
|
||||
'_DATE_' => Translator::dateToLocale($scadenza['scadenza']),
|
||||
'_DATE_' => dateFormat($scadenza['scadenza']),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ if (!empty($documento)) {
|
|||
|
||||
<tr>
|
||||
<th>'.tr('Data').':</th>
|
||||
<td>'.Translator::dateToLocale($documento->data).'</td>
|
||||
<td>'.dateFormat($documento->data).'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -94,7 +94,7 @@ if (!empty($documento)) {
|
|||
|
||||
if( !empty($record['presentazioni_exported_at']) ){
|
||||
$export_riba = '<i class="fa fa-check text-success"></i> '.tr('Esportata il _DATA_',[
|
||||
'_DATA_' => Translator::timestampToLocale($record['presentazioni_exported_at']),
|
||||
'_DATA_' => timestampFormat($record['presentazioni_exported_at']),
|
||||
]).'';
|
||||
}else{
|
||||
$export_riba = '<i class="fa fa-clock-o text-warning"></i> '.tr('Non ancora esportata');
|
||||
|
|
|
@ -39,8 +39,8 @@ return [
|
|||
'numero' => empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'],
|
||||
'note' => $r['note'],
|
||||
'pagamento' => $r['pagamento'],
|
||||
'totale' => Translator::numberToLocale(abs($r['totale'])),
|
||||
'data_scadenza' => Translator::dateToLocale($r['scadenza']),
|
||||
'data' => Translator::dateToLocale($r['data']),
|
||||
'totale' => numberFormat(abs($r['totale'])),
|
||||
'data_scadenza' => dateFormat($r['scadenza']),
|
||||
'data' => dateFormat($r['data']),
|
||||
'logo_azienda' => !empty($logo_azienda) ? '<img src="'.$logo_azienda.'" />' : '',
|
||||
];
|
||||
|
|
|
@ -47,8 +47,8 @@ echo '
|
|||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">'.tr('Comunicazione dati fatture (ex-spesometro)<br> dal _START_ al _END_', [
|
||||
'_START_' => Translator::dateToLocale(session('period_start')),
|
||||
'_END_' => Translator::dateToLocale(session('period_end')),
|
||||
'_START_' => dateFormat(session('period_start')),
|
||||
'_END_' => dateFormat(session('period_end')),
|
||||
]).'</h3>
|
||||
</div>
|
||||
|
||||
|
@ -62,8 +62,8 @@ echo '
|
|||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">'.tr('Dati economici<br> dal _START_ al _END_', [
|
||||
'_START_' => Translator::dateToLocale($_SESSION['period_start']),
|
||||
'_END_' => Translator::dateToLocale($_SESSION['period_end']),
|
||||
'_START_' => dateFormat($_SESSION['period_start']),
|
||||
'_END_' => dateFormat($_SESSION['period_end']),
|
||||
]).'</h3>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -39,11 +39,11 @@ echo '
|
|||
}
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
{[ "type": "date", "label": "'.tr('Data inizio').'", "required": "1", "name": "date_start", "value": "'.Translator::dateToLocale(session('period_start')).'" ]}
|
||||
{[ "type": "date", "label": "'.tr('Data inizio').'", "required": "1", "name": "date_start", "value": "'.dateFormat(session('period_start')).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "date", "label": "'.tr('Data fine').'", "required": "1", "name": "date_end", "value": "'.Translator::dateToLocale(session('period_end')).'" ]}
|
||||
{[ "type": "date", "label": "'.tr('Data fine').'", "required": "1", "name": "date_end", "value": "'.dateFormat(session('period_end')).'" ]}
|
||||
</div>
|
||||
|
||||
</div>';
|
||||
|
|
|
@ -211,7 +211,7 @@ if (!empty($clienti)) {
|
|||
<td>'.Modules::link('Anagrafiche', $cliente['idanagrafica'], $cliente['ragione_sociale']).'</td>
|
||||
<td class="text-right">'.intval($cliente['qta']).'</td>
|
||||
<td class="text-right">'.moneyFormat($cliente['totale'], 2).'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($cliente['totale'] * 100 / $totale[0]['totale'], 2).' %</td>
|
||||
<td class="text-right">'.numberFormat($cliente['totale'] * 100 / $totale[0]['totale'], 2).' %</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -257,8 +257,8 @@ if (!empty($articoli)) {
|
|||
echo '
|
||||
<tr>
|
||||
<td>'.Modules::link('Articoli', $articolo['id'], $articolo['codice'].' - '.$articolo['descrizione']).'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($articolo['qta'], 'qta').' '.$articolo['um'].'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($articolo['qta'] * 100 / $totale[0]['totale_qta'], 2).' %</td>
|
||||
<td class="text-right">'.numberFormat($articolo['qta'], 'qta').' '.$articolo['um'].'</td>
|
||||
<td class="text-right">'.numberFormat($articolo['qta'] * 100 / $totale[0]['totale_qta'], 2).' %</td>
|
||||
<td class="text-right">'.moneyFormat($articolo['totale'], 2).'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
if (!empty($record['failed_at'])) {
|
||||
echo '
|
||||
<span class="label label-danger">
|
||||
<i class="fa fa-times"></i> '.tr('Email fallita il: ').Translator::timestampToLocale($record['failed_at']).'
|
||||
<i class="fa fa-times"></i> '.tr('Email fallita il: ').timestampFormat($record['failed_at']).'
|
||||
</span> ';
|
||||
|
||||
echo '
|
||||
|
@ -35,6 +35,6 @@ if (!empty($record['failed_at'])) {
|
|||
} elseif (!empty($record['sent_at'])) {
|
||||
echo '
|
||||
<span class="label label-success">
|
||||
<i class="fa fa-success"></i> '.tr('Email inviata il: ').Translator::timestampToLocale($record['sent_at']).'
|
||||
<i class="fa fa-success"></i> '.tr('Email inviata il: ').timestampFormat($record['sent_at']).'
|
||||
</span>';
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ if (!empty($elementi)) {
|
|||
$descrizione = tr('_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => $elemento['tipo_documento'],
|
||||
'_NUM_' => $elemento['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($elemento['data']),
|
||||
'_DATE_' => dateFormat($elemento['data']),
|
||||
]);
|
||||
|
||||
if (in_array($elemento['tipo_documento'], ['Intervento'])) {
|
||||
|
|
|
@ -26,7 +26,6 @@ use Modules\Anagrafiche\Anagrafica;
|
|||
use Modules\Fatture\Fattura;
|
||||
use Modules\Fatture\Gestori\Bollo;
|
||||
use Prints;
|
||||
use Translator;
|
||||
use UnexpectedValueException;
|
||||
use Uploads;
|
||||
use Validate;
|
||||
|
@ -1427,7 +1426,7 @@ class FatturaElettronica
|
|||
if (!empty($riga['ritenuta_contributi'])) {
|
||||
$dettaglio[]['AltriDatiGestionali'] = [
|
||||
'TipoDato' => 'CASSA-PREV',
|
||||
'RiferimentoTesto' => setting('Tipo Cassa Previdenziale').' - '.$ritenuta_contributi->descrizione.' ('.Translator::numberToLocale($ritenuta_contributi->percentuale).'%)',
|
||||
'RiferimentoTesto' => setting('Tipo Cassa Previdenziale').' - '.$ritenuta_contributi->descrizione.' ('.numberFormat($ritenuta_contributi->percentuale).'%)',
|
||||
'RiferimentoNumero' => $riga->ritenuta_contributi,
|
||||
];
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ echo '
|
|||
|
||||
<br><small>
|
||||
'.$tipo_documento.'
|
||||
<br>'.Translator::dateToLocale($dati_generali['Data']).'
|
||||
<br>'.dateFormat($dati_generali['Data']).'
|
||||
<br>'.$dati_generali['Divisa'].'
|
||||
</small>
|
||||
</h4>
|
||||
|
|
|
@ -95,7 +95,7 @@ if (!$clienti->isEmpty()) {
|
|||
|
||||
<td class="text-right">
|
||||
'.moneyFormat($dettaglio->prezzo_unitario).'
|
||||
<p><small class="label label-default tip" title="'.Translator::timestampToLocale($dettaglio['updated_at']).'"><i class="fa fa-clock-o"></i> '.Carbon::parse($dettaglio['updated_at'])->diffForHumans().'</small></p>
|
||||
<p><small class="label label-default tip" title="'.timestampFormat($dettaglio['updated_at']).'"><i class="fa fa-clock-o"></i> '.Carbon::parse($dettaglio['updated_at'])->diffForHumans().'</small></p>
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
|
|
|
@ -181,7 +181,7 @@ if (!$fornitori_disponibili->isEmpty()) {
|
|||
|
||||
<td class="text-right">
|
||||
'.moneyFormat($dettaglio->prezzo_unitario).'
|
||||
<p><small class="label label-default tip" title="'.Translator::timestampToLocale($dettaglio['updated_at']).'"><i class="fa fa-clock-o"></i> '.$dettaglio->updated_at->diffForHumans().'</small></p>
|
||||
<p><small class="label label-default tip" title="'.timestampFormat($dettaglio['updated_at']).'"><i class="fa fa-clock-o"></i> '.$dettaglio->updated_at->diffForHumans().'</small></p>
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
|
|
|
@ -57,7 +57,7 @@ if (!empty($movimenti)) {
|
|||
|
||||
echo '
|
||||
<tr>
|
||||
<td class="text-center">'.Translator::dateToLocale($movimento['data']).'</td>
|
||||
<td class="text-center">'.dateFormat($movimento['data']).'</td>
|
||||
<td>'.$descrizione.'<small class="pull-right text-right text-muted" style="font-size:8pt;">'.($documento ? $documento->getReference() : '').'</small></td>
|
||||
<td class="text-right">'.($movimento['totale']>0 ? moneyFormat(abs($movimento['totale'])) : "").'</td>
|
||||
<td class="text-right">'.($movimento['totale']<0 ? moneyFormat(abs($movimento['totale'])) : "").'</td>
|
||||
|
@ -82,7 +82,7 @@ if (!empty($movimenti)) {
|
|||
|
||||
echo '
|
||||
<tr>
|
||||
<td class="text-center">'.Translator::dateToLocale($altro_movimento['data']).'</td>
|
||||
<td class="text-center">'.dateFormat($altro_movimento['data']).'</td>
|
||||
<td>'.$descrizione.'<small class="pull-right text-right text-muted" style="font-size:8pt;">'.($documento ? $documento->getReference() : '').'</small></td>
|
||||
<td class="text-right">'.($altro_movimento['totale']>0 ? moneyFormat(abs($altro_movimento['totale'])) : "").'</td>
|
||||
<td class="text-right">'.($altro_movimento['totale']<0 ? moneyFormat(abs($altro_movimento['totale'])) : "").'</td>
|
||||
|
|
|
@ -130,7 +130,7 @@ foreach ($righe as $riga) {
|
|||
{[ "type": "textarea", "label": "'.tr('Descrizione').'", "name": "descrizione['.$riga->id.']", "value": "'.$descrizione.'", "extra": "rows=6" ]}
|
||||
|
||||
{[ "type": "number", "label": "'.tr('Q.tà per fattura').'", "class":"qta_fattura", "name": "qta['.$riga->id.']", "required": 1, "value": "1", "decimals": "qta", "min-value": "1", "icon-after":"'.tr('su _TOT_ totali', [
|
||||
'_TOT_' => Translator::numberToLocale(($riga->qta - $riga->qta_evasa)),
|
||||
'_TOT_' => numberFormat(($riga->qta - $riga->qta_evasa)),
|
||||
]).'", "options":"'.str_replace('"', '\"', $options).'" ]}
|
||||
</div>
|
||||
<div class="col-md-3" id="totali_'.$riga->id.'">
|
||||
|
@ -142,7 +142,7 @@ foreach ($righe as $riga) {
|
|||
echo ' <div class="label label-warning alert_rate hide">
|
||||
<i class="fa fa-warning"></i> <span>'.tr('Attenzione, sono previste _RATE_ rate su _TOT_ quantità totali', [
|
||||
'_RATE_' => '<span class="num_rate"></span>',
|
||||
'_TOT_' => '<span class="qta_disponibili">'.Translator::numberToLocale(($riga->qta - $riga->qta_evasa)).'</span>',
|
||||
'_TOT_' => '<span class="qta_disponibili">'.numberFormat(($riga->qta - $riga->qta_evasa)).'</span>',
|
||||
]).'</span>.
|
||||
</div><hr>';
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
</ul>';
|
||||
|
||||
if (!empty($descrizione)) {
|
||||
$result['descrizione'] = str_replace('{periodo}', 'durata dal '.Translator::dateToLocale($inizio).' al '.Translator::dateToLocale($fine), $descrizione);
|
||||
$result['descrizione'] = str_replace('{data_inizio}', Translator::dateToLocale($inizio), $result['descrizione']);
|
||||
$result['descrizione'] = str_replace('{data_fine}', Translator::dateToLocale($fine), $result['descrizione']);
|
||||
$result['descrizione'] = str_replace('{periodo}', 'durata dal '.dateFormat($inizio).' al '.dateFormat($fine), $descrizione);
|
||||
$result['descrizione'] = str_replace('{data_inizio}', dateFormat($inizio), $result['descrizione']);
|
||||
$result['descrizione'] = str_replace('{data_fine}', dateFormat($fine), $result['descrizione']);
|
||||
$result['descrizione'] = str_replace('{mese_fatturazione}', $mese[date('m', strtotime($inizio))], $result['descrizione']);
|
||||
$result['descrizione'] = str_replace('{rata_attuale}', $rata, $result['descrizione']);
|
||||
$result['descrizione'] = str_replace('{numero_rate}', $numero_fatture, $result['descrizione']);
|
||||
|
|
|
@ -122,7 +122,7 @@ if (!$elenco_promemoria->isEmpty()) {
|
|||
foreach ($righe as $riga) {
|
||||
$info_righe .= tr('_QTA_ _UM_ x _DESC_', [
|
||||
'_DESC_' => ($riga->isArticolo() ? Modules::link('Articoli', $riga['idarticolo'], $riga['descrizione']) : $riga['descrizione']),
|
||||
'_QTA_' => Translator::numberToLocale($riga['qta']),
|
||||
'_QTA_' => numberFormat($riga['qta']),
|
||||
'_UM_' => $riga['um'],
|
||||
]).'<br>';
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ if (!$elenco_promemoria->isEmpty()) {
|
|||
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.Translator::dateToLocale($promemoria['data_richiesta']).'</td>
|
||||
<td>'.dateFormat($promemoria['data_richiesta']).'</td>
|
||||
<td>'.$promemoria->tipo->descrizione.'</td>
|
||||
<td>'.nl2br($promemoria['richiesta']).'</td>
|
||||
<td>'.$info_intervento.'</td>
|
||||
|
|
|
@ -87,7 +87,7 @@ if (!$righe->isEmpty()) {
|
|||
// Quantità
|
||||
echo '
|
||||
<td class="text-right">
|
||||
'.Translator::numberToLocale($riga->qta, 'qta').' '.$riga->um.'
|
||||
'.numberFormat($riga->qta, 'qta').' '.$riga->um.'
|
||||
</td>';
|
||||
|
||||
if ($show_prezzi) {
|
||||
|
|
|
@ -85,8 +85,8 @@ while (!empty($id_contratto_precedente) && $counter < 50) {
|
|||
]).'<br><small class="text-muted">'.$rs[0]['nome'].'</small>').'
|
||||
</td>
|
||||
<td class="text-right">'.moneyFormat($rs[0]['budget']).'</td>
|
||||
<td align="center">'.Translator::dateToLocale($rs[0]['data_accettazione']).'</td>
|
||||
<td align="center">'.Translator::dateToLocale($rs[0]['data_conclusione']).'</td>
|
||||
<td align="center">'.dateFormat($rs[0]['data_accettazione']).'</td>
|
||||
<td align="center">'.dateFormat($rs[0]['data_conclusione']).'</td>
|
||||
</tr>';
|
||||
|
||||
$id_contratto_precedente = $rs[0]['idcontratto_prev'];
|
||||
|
|
|
@ -52,6 +52,6 @@ echo '
|
|||
<td class="text-right">'.moneyFormat($prezzo_medio).'</td>
|
||||
<td class="text-right">'.moneyFormat($prezzo_max['prezzo']).'</td>
|
||||
<td class="text-right">'.moneyFormat($oscillazione).'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($oscillazione_percentuale, '2').' %</td>
|
||||
<td class="text-right">'.numberFormat($oscillazione_percentuale, '2').' %</td>
|
||||
<td>'.$andamento.'</td>
|
||||
</tr>';
|
||||
|
|
350
src/App.php
350
src/App.php
|
@ -1,350 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Util\Messages;
|
||||
|
||||
/**
|
||||
* Classe per la gestione delle utenze.
|
||||
*
|
||||
* @since 2.4
|
||||
*/
|
||||
class App
|
||||
{
|
||||
public static $docroot;
|
||||
public static $rootdir;
|
||||
public static $baseurl;
|
||||
|
||||
/** @var array Identificativo del modulo corrente */
|
||||
protected static $current_module;
|
||||
/** @var int Identificativo dell'elemento corrente */
|
||||
protected static $current_element;
|
||||
|
||||
/** @var Messages Gestione dei messaggi flash */
|
||||
protected static $flash = null;
|
||||
|
||||
/** @var bool Stato di debug */
|
||||
protected static $config = [];
|
||||
|
||||
/** @var array Elenco degli assets del progetto */
|
||||
protected static $assets = [
|
||||
// CSS
|
||||
'css' => [
|
||||
'app.min.css',
|
||||
'style.min.css',
|
||||
'themes.min.css',
|
||||
],
|
||||
|
||||
// Print CSS
|
||||
'print' => [
|
||||
'print.min.css',
|
||||
],
|
||||
|
||||
// JS
|
||||
'js' => [
|
||||
'app.min.js',
|
||||
'functions.min.js',
|
||||
'custom.min.js',
|
||||
'i18n/parsleyjs/|lang|.min.js',
|
||||
'i18n/select2/|lang|.min.js',
|
||||
'i18n/moment/|lang|.min.js',
|
||||
'i18n/fullcalendar/|lang|.min.js',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Restituisce la configurazione dell'installazione in utilizzo del progetto.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getConfig()
|
||||
{
|
||||
if (empty(self::$config['db_host'])) {
|
||||
if (file_exists(base_dir().'/config.inc.php')) {
|
||||
include base_dir().'/config.inc.php';
|
||||
|
||||
$config = get_defined_vars();
|
||||
} else {
|
||||
$config = [];
|
||||
}
|
||||
|
||||
$defaultConfig = self::getDefaultConfig();
|
||||
|
||||
$result = array_merge($defaultConfig, $config);
|
||||
|
||||
// Operazioni di normalizzazione sulla configurazione
|
||||
$result['debug'] = isset(self::$config['debug']) ? self::$config['debug'] : !empty($result['debug']);
|
||||
$result['lang'] = $result['lang'] == 'it' ? 'it_IT' : $result['lang'];
|
||||
|
||||
self::$config = $result;
|
||||
}
|
||||
|
||||
return self::$config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta e restituisce lo stato di debug del progetto.
|
||||
*
|
||||
* @param bool $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function debug($value = null)
|
||||
{
|
||||
if (is_bool($value)) {
|
||||
self::$config['debug'] = $value;
|
||||
}
|
||||
|
||||
if (!isset(self::$config['debug'])) {
|
||||
App::getConfig();
|
||||
}
|
||||
|
||||
return self::$config['debug'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'oggetto dedicato alla gestione dei messaggi per l'utente.
|
||||
*
|
||||
* @return Messages
|
||||
*/
|
||||
public static function flash()
|
||||
{
|
||||
if (empty(self::$flash)) {
|
||||
$storage = null;
|
||||
self::$flash = new Messages($storage, 'messages');
|
||||
}
|
||||
|
||||
return self::$flash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Individua i percorsi di base necessari per il funzionamento del gestionale.
|
||||
* <b>Attenzione<b>: questo metodo deve essere eseguito all'interno di un file nella cartella principale del progetto per permettere il corretto funzionamento degli URL.
|
||||
*/
|
||||
public static function definePaths($docroot)
|
||||
{
|
||||
if (!defined('DOCROOT')) {
|
||||
// Individuazione di $rootdir
|
||||
$rootdir = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')).'/';
|
||||
if (strrpos($rootdir, '/'.basename($docroot).'/') !== false) {
|
||||
$rootdir = substr($rootdir, 0, strrpos($rootdir, '/'.basename($docroot).'/')).'/'.basename($docroot);
|
||||
} else {
|
||||
$rootdir = '/';
|
||||
}
|
||||
$rootdir = rtrim($rootdir, '/');
|
||||
$rootdir = str_replace('%2F', '/', rawurlencode($rootdir));
|
||||
|
||||
// Individuazione di $baseurl
|
||||
$baseurl = (isHTTPS(true) ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$rootdir;
|
||||
|
||||
// Impostazione delle variabili globali
|
||||
define('DOCROOT', $docroot);
|
||||
define('ROOTDIR', $rootdir);
|
||||
define('BASEURL', $baseurl);
|
||||
|
||||
self::$docroot = $docroot;
|
||||
self::$rootdir = $rootdir;
|
||||
self::$baseurl = $baseurl;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Individua i percorsi principali del progetto.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getPaths()
|
||||
{
|
||||
$assets = base_url().'/assets/dist';
|
||||
|
||||
return [
|
||||
'assets' => $assets,
|
||||
'css' => $assets.'/css',
|
||||
'js' => $assets.'/js',
|
||||
'img' => $assets.'/img',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'elenco degli assets del progetto.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getAssets()
|
||||
{
|
||||
// Assets aggiuntivi
|
||||
$config = self::getConfig();
|
||||
|
||||
$version = Update::getVersion();
|
||||
|
||||
// Impostazione dei percorsi
|
||||
$paths = self::getPaths();
|
||||
$lang = trans()->getCurrentLocale();
|
||||
|
||||
// Sezioni: nome - percorso
|
||||
$sections = [
|
||||
'css' => 'css',
|
||||
'print' => 'css',
|
||||
'js' => 'js',
|
||||
];
|
||||
|
||||
$first_lang = explode('_', $lang);
|
||||
$lang_replace = [
|
||||
$lang,
|
||||
strtolower($lang),
|
||||
strtolower($first_lang[0]),
|
||||
strtoupper($first_lang[0]),
|
||||
str_replace('_', '-', $lang),
|
||||
str_replace('_', '-', strtolower($lang)),
|
||||
];
|
||||
|
||||
$assets = [];
|
||||
|
||||
foreach ($sections as $section => $dir) {
|
||||
$result = array_unique(array_merge(self::$assets[$section], $config['assets'][$section]));
|
||||
|
||||
foreach ($result as $key => $element) {
|
||||
$element = string_starts_with($element, 'http') ? $element : $paths[$dir].'/'.$element;
|
||||
|
||||
if (string_contains($element, '|lang|')) {
|
||||
foreach ($lang_replace as $replace) {
|
||||
$name = str_replace('|lang|', $replace, $element);
|
||||
|
||||
if (file_exists(base_dir().str_replace(base_url(), '', $name))) {
|
||||
$element = $name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result[$key] = $element.'?v='.$version;
|
||||
}
|
||||
|
||||
$assets[$section] = $result;
|
||||
}
|
||||
|
||||
return $assets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il codice HTML per il form contenente il file indicato.
|
||||
*
|
||||
* @param string $file
|
||||
* @param array $result
|
||||
* @param array $options
|
||||
* @param bool $disableForm
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function load($file, $result, $options, $disableForm = false)
|
||||
{
|
||||
$form = $disableForm ? '|response|' : self::internalLoad('form.php', $result, $options);
|
||||
|
||||
$response = self::internalLoad($file, $result, $options);
|
||||
|
||||
$form = str_replace('|response|', $response, $form);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il codice HTML generato del file indicato.
|
||||
*
|
||||
* @param string $file
|
||||
* @param array $result
|
||||
* @param array $options
|
||||
* @param string $directory
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function internalLoad($file, $result, $options, $directory = null)
|
||||
{
|
||||
$module = Modules::getCurrent();
|
||||
|
||||
$database = $dbo = database();
|
||||
|
||||
$id_module = $module['id'];
|
||||
$id_record = filter('id_record');
|
||||
$id_plugin = $options['id_plugin'];
|
||||
|
||||
$directory = empty($directory) ? 'include|custom|/common/' : $directory;
|
||||
|
||||
ob_start();
|
||||
include self::filepath($directory, $file);
|
||||
$response = ob_get_clean();
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Individua il percorso per il file da includere considerando gli eventuali custom.
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $file
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public static function filepath($path, $file = null)
|
||||
{
|
||||
$path = string_contains($path, base_dir()) ? $path : base_dir().'/'.ltrim($path, '/');
|
||||
$path = empty($file) ? $path : rtrim($path, '/').'/'.$file;
|
||||
|
||||
$original_file = str_replace('|custom|', '', $path);
|
||||
$custom_file = str_replace('|custom|', '/custom', $path);
|
||||
|
||||
$result = '';
|
||||
if (file_exists($custom_file)) {
|
||||
$result = $custom_file;
|
||||
} elseif (file_exists($original_file)) {
|
||||
$result = $original_file;
|
||||
}
|
||||
|
||||
return slashes($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce la configurazione di default del progetto.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function getDefaultConfig()
|
||||
{
|
||||
if (file_exists(base_dir().'/config.example.php')) {
|
||||
include base_dir().'/config.example.php';
|
||||
}
|
||||
|
||||
$db_host = '';
|
||||
$db_username = '';
|
||||
$db_password = '';
|
||||
$db_name = '';
|
||||
$port = '';
|
||||
$lang = '';
|
||||
|
||||
$formatter = [
|
||||
'timestamp' => 'd/m/Y H:i',
|
||||
'date' => 'd/m/Y',
|
||||
'time' => 'H:i',
|
||||
'number' => [
|
||||
'decimals' => ',',
|
||||
'thousands' => '.',
|
||||
],
|
||||
];
|
||||
|
||||
return get_defined_vars();
|
||||
}
|
||||
}
|
|
@ -27,14 +27,8 @@ use Util\Messages;
|
|||
*/
|
||||
class AppLegacy
|
||||
{
|
||||
public static $docroot;
|
||||
public static $rootdir;
|
||||
public static $baseurl;
|
||||
|
||||
/** @var array Identificativo del modulo corrente */
|
||||
protected static $current_module;
|
||||
/** @var int Identificativo dell'elemento corrente */
|
||||
protected static $current_element;
|
||||
/** @var string Simbolo della valuta corrente */
|
||||
protected static $currency;
|
||||
|
||||
/** @var Messages Gestione dei messaggi flash */
|
||||
protected static $flash = null;
|
||||
|
@ -139,37 +133,6 @@ class AppLegacy
|
|||
return self::$flash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Individua i percorsi di base necessari per il funzionamento del gestionale.
|
||||
* <b>Attenzione<b>: questo metodo deve essere eseguito all'interno di un file nella cartella principale del progetto per permettere il corretto funzionamento degli URL.
|
||||
*/
|
||||
public static function definePaths($docroot)
|
||||
{
|
||||
if (!defined('DOCROOT')) {
|
||||
// Individuazione di $rootdir
|
||||
$rootdir = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')).'/';
|
||||
if (strrpos($rootdir, '/'.basename($docroot).'/') !== false) {
|
||||
$rootdir = substr($rootdir, 0, strrpos($rootdir, '/'.basename($docroot).'/')).'/'.basename($docroot);
|
||||
} else {
|
||||
$rootdir = '/';
|
||||
}
|
||||
$rootdir = rtrim($rootdir, '/');
|
||||
$rootdir = str_replace('%2F', '/', rawurlencode($rootdir));
|
||||
|
||||
// Individuazione di $baseurl
|
||||
$baseurl = (isHTTPS(true) ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$rootdir;
|
||||
|
||||
// Impostazione delle variabili globali
|
||||
define('DOCROOT', $docroot);
|
||||
define('ROOTDIR', $rootdir);
|
||||
define('BASEURL', $baseurl);
|
||||
|
||||
self::$docroot = $docroot;
|
||||
self::$rootdir = $rootdir;
|
||||
self::$baseurl = $baseurl;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Individua i percorsi principali del progetto.
|
||||
*
|
||||
|
@ -187,25 +150,6 @@ class AppLegacy
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta l'oggetto responsabile della localizzazione di date e numeri.
|
||||
*/
|
||||
public static function setFormatter($locale, $options)
|
||||
{
|
||||
self::$formatter = new Intl\Formatter(
|
||||
$locale,
|
||||
empty($options['timestamp']) ? 'd/m/Y H:i' : $options['timestamp'],
|
||||
empty($options['date']) ? 'd/m/Y' : $options['date'],
|
||||
empty($options['time']) ? 'H:i' : $options['time'],
|
||||
empty($options['number']) ? [
|
||||
'decimals' => ',',
|
||||
'thousands' => '.',
|
||||
] : $options['number']
|
||||
);
|
||||
|
||||
self::$formatter->setPrecision(auth()->check() ? setting('Cifre decimali per importi') : 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'elenco degli assets del progetto.
|
||||
*
|
||||
|
@ -372,4 +316,24 @@ class AppLegacy
|
|||
|
||||
return get_defined_vars();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il simbolo della valuta del gestione.
|
||||
*
|
||||
* @since 2.4.9
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getCurrency()
|
||||
{
|
||||
if (!isset(self::$currency)) {
|
||||
$id = setting('Valuta');
|
||||
$valuta = database()->fetchOne('SELECT symbol FROM zz_currencies WHERE id = '.prepare($id));
|
||||
|
||||
self::$currency = $valuta['symbol'];
|
||||
}
|
||||
|
||||
return self::$currency;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -121,6 +121,10 @@ class HTMLBuilder
|
|||
|
||||
foreach ($managers[0] as $value) {
|
||||
$json = self::decode($value, 'manager');
|
||||
if (empty($json)){
|
||||
continue;
|
||||
}
|
||||
|
||||
$class = self::getManager($json['name']);
|
||||
|
||||
$result = '';
|
||||
|
|
|
@ -45,17 +45,17 @@ class DateHandler implements HandlerInterface
|
|||
// Restrizione dei valori permessi
|
||||
// Timestamp
|
||||
if ($values['type'] == 'timestamp' && formatter()->isStandardTimestamp($values['value'])) {
|
||||
$values['value'] = \Translator::timestampToLocale($values['value']);
|
||||
$values['value'] = timestampFormat($values['value']);
|
||||
}
|
||||
|
||||
// Data
|
||||
elseif ($values['type'] == 'date' && formatter()->isStandardDate($values['value'])) {
|
||||
$values['value'] = \Translator::dateToLocale($values['value']);
|
||||
$values['value'] = dateFormat($values['value']);
|
||||
}
|
||||
|
||||
// Orario
|
||||
elseif ($values['type'] == 'time' && formatter()->isStandardTime($values['value'])) {
|
||||
$values['value'] = \Translator::timeToLocale($values['value']);
|
||||
$values['value'] = timeFormat($values['value']);
|
||||
}
|
||||
|
||||
// Controllo sulla correttezza sintattica del valore impostato
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Intl;
|
||||
|
||||
/**
|
||||
* Classe dedicata al caricamento delle risorse per le traduzioni.
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
class FileLoader extends \Symfony\Component\Translation\Loader\FileLoader
|
||||
{
|
||||
protected static $loaders = [];
|
||||
protected $include_filename;
|
||||
|
||||
public function __construct($include_filename = false)
|
||||
{
|
||||
$this->include_filename = $include_filename;
|
||||
}
|
||||
|
||||
protected function loadResource($resource)
|
||||
{
|
||||
$result = [];
|
||||
|
||||
$extension = strtolower(pathinfo($resource, PATHINFO_EXTENSION));
|
||||
$loader = $this->getLoader($extension);
|
||||
if (!empty($extension) && $extension != 'po' && !empty($loader)) {
|
||||
$result = $loader->loadResource($resource);
|
||||
|
||||
if (!empty($this->include_filename)) {
|
||||
$result = array_combine(
|
||||
array_map(function ($k) use ($resource, $extension) {
|
||||
return basename($resource, '.'.$extension).'.'.$k;
|
||||
}, array_keys($result)),
|
||||
$result
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function getLoader($name)
|
||||
{
|
||||
if (empty(self::$loaders[$name])) {
|
||||
$class = '\Symfony\Component\Translation\Loader\\'.ucfirst($name).'FileLoader';
|
||||
if (class_exists($class)) {
|
||||
self::$loaders[$name] = new $class();
|
||||
}
|
||||
}
|
||||
|
||||
return !empty(self::$loaders[$name]) ? self::$loaders[$name] : null;
|
||||
}
|
||||
}
|
|
@ -76,8 +76,8 @@ trait LocalPoolTrait
|
|||
}
|
||||
|
||||
// Consultazione Database
|
||||
$result = self::where(self::$id, $identifier)
|
||||
->orWhere(self::$name, $identifier)
|
||||
$result = self::where(self::$id, '=', $identifier)
|
||||
->orWhere(self::$name, '=', $identifier)
|
||||
->first();
|
||||
|
||||
if (!empty($result)) {
|
||||
|
|
|
@ -1,382 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Carbon\CarbonInterval;
|
||||
|
||||
/**
|
||||
* Classe per gestire le traduzioni del progetto.
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
class Translator extends Util\Singleton
|
||||
{
|
||||
/** @var Intl\Formatter Oggetto per la conversione di date e numeri nella lingua selezionata */
|
||||
protected static $formatter;
|
||||
/** @var string Simbolo della valuta corrente */
|
||||
protected static $currency;
|
||||
|
||||
/** @var Symfony\Component\Translation\Translator Oggetto dedicato alle traduzioni */
|
||||
protected $translator;
|
||||
|
||||
/** @var array Lingue disponibili */
|
||||
protected $locales = [];
|
||||
/** @var string Lingua selezionata */
|
||||
protected $locale;
|
||||
|
||||
public function __construct($default_locale = 'it_IT', $fallback_locales = ['it_IT'])
|
||||
{
|
||||
$translator = new Symfony\Component\Translation\Translator($default_locale);
|
||||
$translator->setFallbackLocales($fallback_locales);
|
||||
// Imposta la classe per il caricamento
|
||||
$translator->addLoader('default', new Intl\FileLoader());
|
||||
|
||||
$this->translator = $translator;
|
||||
|
||||
$this->locale = $default_locale;
|
||||
self::setFormatter($default_locale, []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ricerca e aggiunge le traduzioni presenti nei percorsi predefiniti (cartella locale sia nella root che nei diversi moduli).
|
||||
*
|
||||
* @param string $string
|
||||
*/
|
||||
public function addLocalePath($string)
|
||||
{
|
||||
$paths = glob($string);
|
||||
foreach ($paths as $path) {
|
||||
$this->addLocales($path);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'elenco dei linguaggi disponibili.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAvailableLocales()
|
||||
{
|
||||
return $this->locales;
|
||||
}
|
||||
|
||||
/**
|
||||
* Controlla se il linguaggio indicato è disponibile.
|
||||
*
|
||||
* @param string $language
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isLocaleAvailable($language)
|
||||
{
|
||||
return in_array($language, $this->getAvailableLocales());
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il linguaggio in utilizzo.
|
||||
*
|
||||
* @param string $locale
|
||||
*/
|
||||
public function setLocale($locale, $formatter = [])
|
||||
{
|
||||
if (!empty($locale) && $this->isLocaleAvailable($locale)) {
|
||||
$this->translator->setLocale($locale);
|
||||
$this->locale = $locale;
|
||||
|
||||
$result = setlocale(LC_TIME, $locale);
|
||||
Carbon::setLocale($locale);
|
||||
|
||||
if (empty($result)) {
|
||||
$result = setlocale(LC_TIME, $locale.'.UTF-8');
|
||||
} else {
|
||||
Carbon::setUtf8(true);
|
||||
}
|
||||
|
||||
$reduced = explode('_', $locale)[0];
|
||||
CarbonInterval::setLocale($reduced);
|
||||
|
||||
if (empty($result)) {
|
||||
$result = setlocale(LC_TIME, $reduced);
|
||||
}
|
||||
|
||||
self::setFormatter($locale, $formatter);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il linguaggio attualmente in utilizzo.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrentLocale()
|
||||
{
|
||||
return $this->locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'oggetto responsabile della gestione delle traduzioni.
|
||||
*
|
||||
* @return Symfony\Component\Translation\Translator
|
||||
*/
|
||||
public function getTranslator()
|
||||
{
|
||||
return $this->translator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce la traduzione richiesta.
|
||||
*
|
||||
* @param string $string
|
||||
* @param array $parameters
|
||||
* @param array $operations
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function translate($string, $parameters = [], $operations = [])
|
||||
{
|
||||
$result = self::getInstance()->getTranslator()->trans($string, $parameters);
|
||||
|
||||
// Operazioni aggiuntive sul risultato
|
||||
if (!empty($operations)) {
|
||||
$result = new Stringy\Stringy($result);
|
||||
|
||||
if (!empty($operations['upper'])) {
|
||||
$result = $result->toUpperCase();
|
||||
} elseif (!empty($operations['lower'])) {
|
||||
$result = $result->toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
return (string) $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'oggetto responsabile della localizzazione di date e numeri.
|
||||
*
|
||||
* @return Intl\Formatter
|
||||
*/
|
||||
public static function getFormatter()
|
||||
{
|
||||
return formatter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il simbolo della valuta del gestione.
|
||||
*
|
||||
* @since 2.4.9
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getCurrency()
|
||||
{
|
||||
if (!isset(self::$currency)) {
|
||||
$id = setting('Valuta');
|
||||
$valuta = database()->fetchOne('SELECT symbol FROM zz_currencies WHERE id = '.prepare($id));
|
||||
|
||||
self::$currency = $valuta['symbol'];
|
||||
}
|
||||
|
||||
return self::$currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converte il numero dalla formattazione locale a quella inglese.
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function numberToEnglish($string)
|
||||
{
|
||||
return self::getFormatter()->parseNumber($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converte il numero dalla formattazione inglese a quella locale.
|
||||
*
|
||||
* @param string $string
|
||||
* @param string|int $decimals
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function numberToLocale($string, $decimals = null)
|
||||
{
|
||||
$string = !isset($string) ? 0 : $string;
|
||||
|
||||
if (!empty($decimals) && is_string($decimals)) {
|
||||
$decimals = ($decimals == 'qta') ? setting('Cifre decimali per quantità') : null;
|
||||
}
|
||||
|
||||
return self::getFormatter()->formatNumber($string, $decimals);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converte la data dalla formattazione locale a quella inglese.
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function dateToEnglish($string)
|
||||
{
|
||||
return self::getFormatter()->parseDate($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converte la data dalla formattazione inglese a quella locale.
|
||||
*
|
||||
* @param string $string
|
||||
* @param string $fail
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function dateToLocale($string)
|
||||
{
|
||||
return self::getFormatter()->formatDate($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converte la data dalla formattazione locale a quella inglese.
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function timeToEnglish($string)
|
||||
{
|
||||
return self::getFormatter()->parseTime($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converte la data dalla formattazione inglese a quella locale.
|
||||
*
|
||||
* @param string $string
|
||||
* @param string $fail
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function timeToLocale($string)
|
||||
{
|
||||
return self::getFormatter()->formatTime($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converte un timestamp dalla formattazione locale a quella inglese.
|
||||
*
|
||||
* @param string $timestamp
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function timestampToEnglish($string)
|
||||
{
|
||||
return self::getFormatter()->parseTimestamp($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converte un timestamp dalla formattazione inglese a quella locale.
|
||||
*
|
||||
* @param string $timestamp
|
||||
* @param string $fail
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function timestampToLocale($string)
|
||||
{
|
||||
return self::getFormatter()->formatTimestamp($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converte il numero in ore.
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function numberToHours($string)
|
||||
{
|
||||
$string = !isset($string) ? 0 : $string;
|
||||
|
||||
$ore = number_format($string, 2);
|
||||
$splitted_hour = explode('.', $ore);
|
||||
$hour = $splitted_hour[0];
|
||||
$minutes = ($splitted_hour[1] / 100) * 60;
|
||||
$time = $hour.':'.sprintf('%02d', $minutes);
|
||||
|
||||
return $time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Aggiunge i contenuti della cartella specificata alle traduzioni disponibili.
|
||||
*
|
||||
* @param string $path
|
||||
*/
|
||||
protected function addLocales($path)
|
||||
{
|
||||
// Individua i linguaggi disponibili
|
||||
$dirs = glob($path.DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR);
|
||||
foreach ($dirs as $dir) {
|
||||
$this->addLocale(basename($dir));
|
||||
}
|
||||
|
||||
// Aggiunge le singole traduzioni
|
||||
foreach ($this->locales as $lang) {
|
||||
$done = [];
|
||||
|
||||
$files = glob($path.DIRECTORY_SEPARATOR.$lang.DIRECTORY_SEPARATOR.'*.*');
|
||||
foreach ($files as $file) {
|
||||
if (!in_array(basename($file), $done)) {
|
||||
$this->translator->addResource('default', $file, $lang);
|
||||
|
||||
$done[] = basename($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Aggiunge il linguaggio indicato all'elenco di quelli disponibili.
|
||||
*
|
||||
* @param string $language
|
||||
*/
|
||||
protected function addLocale($language)
|
||||
{
|
||||
if (!$this->isLocaleAvailable($language)) {
|
||||
$this->locales[] = $language;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta l'oggetto responsabile della localizzazione di date e numeri.
|
||||
*/
|
||||
protected static function setFormatter($locale, $options)
|
||||
{
|
||||
self::$formatter = new Intl\Formatter(
|
||||
$locale,
|
||||
empty($options['timestamp']) ? 'd/m/Y H:i' : $options['timestamp'],
|
||||
empty($options['date']) ? 'd/m/Y' : $options['date'],
|
||||
empty($options['time']) ? 'H:i' : $options['time'],
|
||||
empty($options['number']) ? [
|
||||
'decimals' => ',',
|
||||
'thousands' => '.',
|
||||
] : $options['number']
|
||||
);
|
||||
|
||||
self::$formatter->setPrecision(auth()->check() ? setting('Cifre decimali per importi') : 2);
|
||||
}
|
||||
}
|
|
@ -21,7 +21,6 @@ namespace Util;
|
|||
|
||||
use Auth;
|
||||
use Modules;
|
||||
use Translator;
|
||||
|
||||
/**
|
||||
* Classe per la gestione delle interazione di base per le query dinamiche.
|
||||
|
@ -315,7 +314,7 @@ class Query
|
|||
if (!empty($sums)) {
|
||||
foreach ($sums as $key => $sum) {
|
||||
if (string_contains($key, 'sum_')) {
|
||||
$results[str_replace('sum_', '', $key)] = Translator::numberToLocale($sum);
|
||||
$results[str_replace('sum_', '', $key)] = numberFormat($sum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ if (!empty($impianti)) {
|
|||
echo '
|
||||
<tr>
|
||||
<td colspan="2" class="text-left" >'.tr('Matricola').': <b>'.$impianti[$i]['matricola'].'</b></td>
|
||||
<td colspan="2" class="text-left" >'.tr('Data').': <b>'.Translator::dateToLocale($impianti[$i]['data']).'</b></td>
|
||||
<td colspan="2" class="text-left" >'.tr('Data').': <b>'.dateFormat($impianti[$i]['data']).'</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="text-left" >'.tr('Nome').': <b>'.$impianti[$i]['nome'].'</b></td>
|
||||
|
@ -151,9 +151,9 @@ if (!empty($interventi)) {
|
|||
$intervento = Intervento::find($interventi[$i]['id']);
|
||||
echo '
|
||||
<tr>
|
||||
<td class="text-left">'.tr('Data richiesta').': <b>'.Translator::dateToLocale($intervento->data_richiesta).'</b></td>
|
||||
<td class="text-left" colspan="2" >'.tr('Data scadenza').': <b>'.Translator::dateToLocale($intervento->data_scadenza).'</b></td>
|
||||
<td class="text-left" >'.tr('Data inizio').': <b>'.Translator::dateToLocale($interventi[$i]['inizio']).'</b></td>
|
||||
<td class="text-left">'.tr('Data richiesta').': <b>'.dateFormat($intervento->data_richiesta).'</b></td>
|
||||
<td class="text-left" colspan="2" >'.tr('Data scadenza').': <b>'.dateFormat($intervento->data_scadenza).'</b></td>
|
||||
<td class="text-left" >'.tr('Data inizio').': <b>'.dateFormat($interventi[$i]['inizio']).'</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="text-left" >'.tr('Tipo').': <b>'.$intervento->tipo->descrizione.'</b></td>
|
||||
|
|
|
@ -32,7 +32,7 @@ echo '
|
|||
<br><br>
|
||||
<b>'.tr('Contratto num. _NUM_ del _DATE_', [
|
||||
'_NUM_' => $documento['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($documento['data_bozza']),
|
||||
'_DATE_' => dateFormat($documento['data_bozza']),
|
||||
], ['upper' => true]).'</b>
|
||||
</div>';
|
||||
|
||||
|
@ -152,7 +152,7 @@ foreach ($righe as $riga) {
|
|||
if (!$riga->isDescrizione()) {
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.Translator::numberToLocale(abs($riga->qta), 'qta').' '.$r['um'].'
|
||||
'.numberFormat(abs($riga->qta), 'qta').' '.$r['um'].'
|
||||
</td>';
|
||||
|
||||
if ($options['pricing']) {
|
||||
|
@ -355,8 +355,8 @@ echo '
|
|||
if (!empty($documento['data_accettazione']) && !empty($documento['data_conclusione'])) {
|
||||
echo '
|
||||
'.tr('dal _START_ al _END_', [
|
||||
'_START_' => Translator::dateToLocale($documento['data_accettazione']),
|
||||
'_END_' => Translator::dateToLocale($documento['data_conclusione']),
|
||||
'_START_' => dateFormat($documento['data_accettazione']),
|
||||
'_END_' => dateFormat($documento['data_conclusione']),
|
||||
]);
|
||||
} else {
|
||||
echo '-';
|
||||
|
|
|
@ -74,9 +74,9 @@ if ($pricing || !empty($totale_ore)) {
|
|||
<b>'.tr('Ore residue', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<th colspan="2" class="text-center">
|
||||
<b>'.Translator::numberToLocale($totale_ore - $totale_ore_impiegate).'</b><br>
|
||||
<p>'.tr('Ore erogate').': '.Translator::numberToLocale($totale_ore_impiegate).'</p>
|
||||
<p>'.tr('Ore a contratto').': '.Translator::numberToLocale($totale_ore).'</p>
|
||||
<b>'.numberFormat($totale_ore - $totale_ore_impiegate).'</b><br>
|
||||
<p>'.tr('Ore erogate').': '.numberFormat($totale_ore_impiegate).'</p>
|
||||
<p>'.tr('Ore a contratto').': '.numberFormat($totale_ore).'</p>
|
||||
</th>
|
||||
</tr>';
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ echo '
|
|||
<h4 class="text-bold">'.tr('Consuntivo', [], ['upper' => true]).'</h4>
|
||||
<b>'.tr('Contratto num. _NUM_ del _DATE_', [
|
||||
'_NUM_' => $documento['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($documento['data_bozza']),
|
||||
'_DATE_' => dateFormat($documento['data_bozza']),
|
||||
], ['upper' => true]).'</b>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -135,7 +135,7 @@ foreach ($righe as $riga) {
|
|||
if (!$riga->isDescrizione()) {
|
||||
echo '
|
||||
<td class="text-center" nowrap="nowrap">
|
||||
'.Translator::numberToLocale(abs($riga->qta), 'qta').' '.$r['um'].'
|
||||
'.numberFormat(abs($riga->qta), 'qta').' '.$r['um'].'
|
||||
</td>';
|
||||
|
||||
if ($options['pricing']) {
|
||||
|
@ -165,7 +165,7 @@ foreach ($righe as $riga) {
|
|||
// Iva
|
||||
echo '
|
||||
<td class="text-center" nowrap="nowrap">
|
||||
'.Translator::numberToLocale($riga->aliquota->percentuale, 0).'
|
||||
'.numberFormat($riga->aliquota->percentuale, 0).'
|
||||
</td>';
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -164,7 +164,7 @@ echo '
|
|||
</td>
|
||||
|
||||
<td class="cell-padded">
|
||||
'.Translator::TimestampToLocale($documento['data_ora_trasporto']).'
|
||||
'.timestampFormat($documento['data_ora_trasporto']).'
|
||||
</td>
|
||||
|
||||
<td class="cell-padded">
|
||||
|
@ -196,11 +196,11 @@ echo '
|
|||
|
||||
<tr>
|
||||
<td class="cell-padded">
|
||||
'.(!empty($peso_lordo) ? Translator::numberToLocale($peso_lordo).' KG' : '').'
|
||||
'.(!empty($peso_lordo) ? numberFormat($peso_lordo).' KG' : '').'
|
||||
</td>
|
||||
|
||||
<td class="cell-padded">
|
||||
'.(!empty($volume) ? Translator::numberToLocale($volume).' M<sup>3</sup>' : '').'
|
||||
'.(!empty($volume) ? numberFormat($volume).' M<sup>3</sup>' : '').'
|
||||
</td>
|
||||
|
||||
<td class="cell-padded">
|
||||
|
|
|
@ -83,7 +83,7 @@ if (!empty($documento['idsede_destinazione'])) {
|
|||
$custom = [
|
||||
'tipo_doc' => $tipo_doc,
|
||||
'numero' => $numero,
|
||||
'data' => Translator::dateToLocale($documento['data']),
|
||||
'data' => dateFormat($documento['data']),
|
||||
'pagamento' => $pagamento['descrizione'],
|
||||
'c_destinazione' => $destinazione,
|
||||
'aspettobeni' => $aspetto_beni['descrizione'],
|
||||
|
|
|
@ -21,13 +21,13 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
if ($dir == 'entrata') {
|
||||
$title = tr('Fatturato mensile dal _START_ al _END_', [
|
||||
'_START_' => Translator::dateToLocale($date_start),
|
||||
'_END_' => Translator::dateToLocale($date_end),
|
||||
'_START_' => dateFormat($date_start),
|
||||
'_END_' => dateFormat($date_end),
|
||||
], ['upper' => true]);
|
||||
} else {
|
||||
$title = tr('Acquisti mensili dal _START_ al _END_', [
|
||||
'_START_' => Translator::dateToLocale($date_start),
|
||||
'_END_' => Translator::dateToLocale($date_end),
|
||||
'_START_' => dateFormat($date_start),
|
||||
'_END_' => dateFormat($date_end),
|
||||
], ['upper' => true]);
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ foreach ($righe as $riga) {
|
|||
|
||||
$text = tr('Rif. fattura _NUM_ del _DATE_', [
|
||||
'_NUM_' => $data[0]['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($data[0]['data']),
|
||||
'_DATE_' => dateFormat($data[0]['data']),
|
||||
]);
|
||||
|
||||
echo '
|
||||
|
@ -172,7 +172,7 @@ foreach ($righe as $riga) {
|
|||
if (!$riga->isDescrizione()) {
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.Translator::numberToLocale(abs($riga->qta), 'qta').' '.$r['um'].'
|
||||
'.numberFormat(abs($riga->qta), 'qta').' '.$r['um'].'
|
||||
</td>';
|
||||
|
||||
// Prezzo unitario
|
||||
|
@ -201,7 +201,7 @@ foreach ($righe as $riga) {
|
|||
// Iva
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.Translator::numberToLocale($riga->aliquota->percentuale, 0).'
|
||||
'.numberFormat($riga->aliquota->percentuale, 0).'
|
||||
</td>';
|
||||
} else {
|
||||
echo '
|
||||
|
|
|
@ -76,7 +76,7 @@ if (!empty($rs2)) {
|
|||
echo "
|
||||
<tr>
|
||||
<td style='width:50%;'>
|
||||
<small>".Translator::dateToLocale($rs2[$i]['scadenza'])."</small>
|
||||
<small>".dateFormat($rs2[$i]['scadenza'])."</small>
|
||||
</td>
|
||||
<td style='width:50%;' class='text-right'>
|
||||
<small>".moneyFormat($rs2[$i]['da_pagare'], 2).'</small>
|
||||
|
@ -227,7 +227,7 @@ if ($has_rivalsa) {
|
|||
<tr>
|
||||
<th class="text-center small" colspan="'.$first_colspan.'">
|
||||
'.tr('Rivalsa _PRC_%', [
|
||||
'_PRC_' => Translator::numberToLocale($rs2[0]['percentuale'], 0),
|
||||
'_PRC_' => numberFormat($rs2[0]['percentuale'], 0),
|
||||
], ['upper' => true]).'
|
||||
</th>';
|
||||
|
||||
|
@ -268,10 +268,10 @@ if ($has_ritenuta) {
|
|||
}
|
||||
|
||||
$contributi = (!empty($record['ritenutaacconto']) ? ' - ' : '').tr('contributi: _PRC_%', [
|
||||
'_PRC_' => Translator::numberToLocale($documento->ritenutaContributi->percentuale, 2),
|
||||
'_PRC_' => numberFormat($documento->ritenutaContributi->percentuale, 2),
|
||||
]);
|
||||
$acconto = tr('acconto: _PRC_%', [
|
||||
'_PRC_' => Translator::numberToLocale($rs2[0]['percentuale'], 0),
|
||||
'_PRC_' => numberFormat($rs2[0]['percentuale'], 0),
|
||||
]);
|
||||
$ritenuta_totale = abs($documento->ritenuta_acconto) + abs($documento->totale_ritenuta_contributi);
|
||||
|
||||
|
@ -405,11 +405,11 @@ if ($fattura_accompagnatoria) {
|
|||
|
||||
<tr>
|
||||
<td class="cell-padded">
|
||||
'.(!empty($peso_lordo) ? Translator::numberToLocale($peso_lordo).' KG' : '').'
|
||||
'.(!empty($peso_lordo) ? numberFormat($peso_lordo).' KG' : '').'
|
||||
</td>
|
||||
|
||||
<td class="cell-padded">
|
||||
'.(!empty($volume) ? Translator::numberToLocale($volume).' M<sup>3</sup>' : '').'
|
||||
'.(!empty($volume) ? numberFormat($volume).' M<sup>3</sup>' : '').'
|
||||
</td>
|
||||
|
||||
<td class="cell-padded">
|
||||
|
|
|
@ -100,7 +100,7 @@ $custom = [
|
|||
'tipo_doc' => Stringy\Stringy::create($tipo_doc)->toUpperCase(),
|
||||
'numero' => $numero,
|
||||
'tipo_documento' => $tipo_doc,
|
||||
'data' => Translator::dateToLocale($record['data']),
|
||||
'data' => dateFormat($record['data']),
|
||||
'pagamento' => $record['tipo_pagamento'],
|
||||
'c_destinazione' => $destinazione,
|
||||
'aspettobeni' => $record['aspettobeni'],
|
||||
|
|
|
@ -32,13 +32,13 @@ echo '
|
|||
|
||||
<tr>
|
||||
<td class="text-left" style="width:30%">'.tr('Intervento n.').': <b>'.$documento['codice'].'</b></td>
|
||||
<td class="text-left" colspan="'.(empty($preventivo) && empty($contratto) ? '3' : '1').'" style="width:30%">'.tr('Data richiesta').': <b>'.Translator::dateToLocale($documento['data_richiesta']).'</b></td>';
|
||||
<td class="text-left" colspan="'.(empty($preventivo) && empty($contratto) ? '3' : '1').'" style="width:30%">'.tr('Data richiesta').': <b>'.dateFormat($documento['data_richiesta']).'</b></td>';
|
||||
if (!empty($preventivo)) {
|
||||
echo '
|
||||
<td class="text-left" colspan="2" style="width:20%">'.tr('Preventivo n.').': <b>'.(!empty($preventivo) ? $preventivo['numero'].' del '.Translator::dateToLocale($preventivo['data_bozza']) : '').'</b></td>';
|
||||
<td class="text-left" colspan="2" style="width:20%">'.tr('Preventivo n.').': <b>'.(!empty($preventivo) ? $preventivo['numero'].' del '.dateFormat($preventivo['data_bozza']) : '').'</b></td>';
|
||||
} elseif (!empty($contratto)) {
|
||||
echo '
|
||||
<td class="text-left" colspan="2" style="width:20%">'.tr('Contratto n.').': <b>'.(!empty($contratto) ? $contratto['numero'].' del '.Translator::dateToLocale($contratto['data_bozza']) : '').'</b></td>';
|
||||
<td class="text-left" colspan="2" style="width:20%">'.tr('Contratto n.').': <b>'.(!empty($contratto) ? $contratto['numero'].' del '.dateFormat($contratto['data_bozza']) : '').'</b></td>';
|
||||
}
|
||||
echo '
|
||||
</tr>';
|
||||
|
@ -183,10 +183,10 @@ if (!$righe->isEmpty()) {
|
|||
if ($riga->um == 'ore') {
|
||||
$qta = Translator::numberToHours($riga->qta);
|
||||
} else {
|
||||
$qta = Translator::numberToLocale($riga->qta, 'qta');
|
||||
$qta = numberFormat($riga->qta, 'qta');
|
||||
}
|
||||
} else {
|
||||
$qta = Translator::numberToLocale($riga->qta, 'qta');
|
||||
$qta = numberFormat($riga->qta, 'qta');
|
||||
}
|
||||
// Articolo
|
||||
echo '
|
||||
|
@ -217,7 +217,7 @@ if (!$righe->isEmpty()) {
|
|||
// Quantità
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.$qta.' '.$riga->um.'
|
||||
'.numberFormat($riga->qta, 'qta').' '.$riga->um.'
|
||||
</td>';
|
||||
|
||||
// Prezzo unitario
|
||||
|
@ -238,7 +238,7 @@ if (!$righe->isEmpty()) {
|
|||
// Prezzo totale
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.($options['pricing'] ? Translator::numberToLocale($riga->importo) : '-').'
|
||||
'.($options['pricing'] ? numberFormat($riga->importo) : '-').'
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
|
@ -335,13 +335,13 @@ foreach ($sessioni as $i => $sessione) {
|
|||
if (setting('Formato ore in stampa') == 'Sessantesimi') {
|
||||
$ore_totali = Translator::numberToHours($documento->ore_totali);
|
||||
} else {
|
||||
$ore_totali = Translator::numberToLocale($documento->ore_totali, 2);
|
||||
$ore_totali = numberFormat($documento->ore_totali, 2);
|
||||
}
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<small>'.tr('Ore lavorate').':</small><br/><b>'.$ore_totali.'</b>
|
||||
<small>'.tr('Ore lavorate').':</small><br/><b>'.numberFormat($documento->ore_totali, 2).'</b>
|
||||
</td>';
|
||||
|
||||
// Costo totale manodopera
|
||||
|
@ -376,7 +376,7 @@ echo '
|
|||
echo '
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<small>'.tr('Km percorsi').':</small><br/><b>'.Translator::numberToLocale($documento->km_totali, 2).'</b>
|
||||
<small>'.tr('Km percorsi').':</small><br/><b>'.numberFormat($documento->km_totali, 2).'</b>
|
||||
</td>';
|
||||
|
||||
// Costo trasferta
|
||||
|
|
|
@ -27,6 +27,6 @@
|
|||
*/
|
||||
echo '
|
||||
<h5 style="border-bottom:1px solid #777; display:block;">
|
||||
<div class="col-md-7">STAMPA LIBRO GIORNALE <small>'.Translator::dateToLocale($date_start).' - '.Translator::dateTolocale($date_end).'</small></div>
|
||||
<div class="col-md-7">STAMPA LIBRO GIORNALE <small>'.dateFormat($date_start).' - '.dateFormat($date_end).'</small></div>
|
||||
<div class="col-md-5 text-right">'.$azienda['ragione_sociale'].'</div>
|
||||
</h5>';
|
||||
|
|
|
@ -35,7 +35,7 @@ if ($record['data']!=$last_data && !empty($last_data)) {
|
|||
|
||||
echo '
|
||||
<tr>
|
||||
<td class="text-center">'.Translator::dateToLocale($record['data']).'</td>
|
||||
<td class="text-center">'.dateFormat($record['data']).'</td>
|
||||
<td class="text-center">'.$record['numero2'].'.'.$record['numero'].'</td>
|
||||
<td>'.$record['conto'].'</td>
|
||||
<td>'.$record['descrizione'].'</td>';
|
||||
|
|
|
@ -33,8 +33,8 @@ $esercizio = $year_start == $year_end ? ' - '.tr('Esercizio _YEAR_', [
|
|||
]) : '';
|
||||
|
||||
$titolo = tr('PROSPETTO LIQUIDAZIONE IVA DAL _START_ al _END_', [
|
||||
'_START_' => Translator::dateToLocale($date_start),
|
||||
'_END_' => Translator::dateToLocale($date_end),
|
||||
'_START_' => dateFormat($date_start),
|
||||
'_END_' => dateFormat($date_end),
|
||||
], ['upper' => true]);
|
||||
|
||||
echo '<h6>'.$titolo.'</h6>';
|
||||
|
|
|
@ -71,7 +71,7 @@ $data = Query::executeAndCount($query);
|
|||
|
||||
echo '
|
||||
<h3>'.tr('Inventario al _DATE_', [
|
||||
'_DATE_' => Translator::dateToLocale($period_end),
|
||||
'_DATE_' => dateFormat($period_end),
|
||||
], ['upper' => true]).'</h3>
|
||||
|
||||
<p style="color:#aaa; font-size:10px;" class="text-right">
|
||||
|
@ -107,7 +107,7 @@ foreach ($data['results'] as $r) {
|
|||
<td>'.$r['Categoria'].'</td>
|
||||
<td>'.$r['Descrizione'].'</td>
|
||||
<td class="text-right">'.moneyFormat($r['prezzo_vendita']).'</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($r['qta_totale']).' '.$r['um'].'</td>
|
||||
<td class="text-right">'.numberFormat($r['qta_totale']).' '.$r['um'].'</td>
|
||||
<td class="text-right">'.moneyFormat($r['acquisto']).'</td>
|
||||
<td class="text-right">'.moneyFormat($valore_magazzino).'</td>
|
||||
</tr>';
|
||||
|
@ -124,7 +124,7 @@ echo '
|
|||
<tr>
|
||||
<td colspan="3" class="text-right border-top"><b>'.tr('Totale', [], ['upper' => true]).':</b></td>
|
||||
<td class="border-top"></td>
|
||||
<td class="text-right border-top"><b>'.Translator::numberToLocale($totale_qta).'</b></td>
|
||||
<td class="text-right border-top"><b>'.numberFormat($totale_qta).'</b></td>
|
||||
<td class="border-top"></td>
|
||||
<td class="text-right border-top"><b>'.moneyFormat($totale_acquisto).'</b></td>
|
||||
</tr>
|
||||
|
|
|
@ -163,7 +163,7 @@ foreach ($righe as $riga) {
|
|||
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.Translator::numberToLocale(abs($qta), 'qta').' '.$um.'
|
||||
'.numberFormat(abs($qta), 'qta').' '.$um.'
|
||||
</td>';
|
||||
|
||||
if ($options['pricing']) {
|
||||
|
@ -193,13 +193,13 @@ foreach ($righe as $riga) {
|
|||
// Iva
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.Translator::numberToLocale($riga->aliquota->percentuale, 0).'
|
||||
'.numberFormat($riga->aliquota->percentuale, 0).'
|
||||
</td>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.Translator::dateToLocale($riga->data_evasione).($riga->ora_evasione ? '<br>'.Translator::timeToLocale($riga->ora_evasione).'' : '').'
|
||||
'.dateFormat($riga->data_evasione).($riga->ora_evasione ? '<br>'.timeFormat($riga->ora_evasione).'' : '').'
|
||||
</td>';
|
||||
} else {
|
||||
echo '
|
||||
|
|
|
@ -63,6 +63,6 @@ $pagamento = $dbo->fetchOne('SELECT * FROM co_pagamenti WHERE id = '.prepare($do
|
|||
$custom = [
|
||||
'tipo_doc' => Stringy\Stringy::create($documento->tipo->descrizione)->toUpperCase(),
|
||||
'numero' => $numero,
|
||||
'data' => Translator::dateToLocale($documento['data']),
|
||||
'data' => dateFormat($documento['data']),
|
||||
'pagamento' => $pagamento['descrizione'],
|
||||
];
|
||||
|
|
|
@ -26,7 +26,7 @@ echo '
|
|||
<h4 class="text-bold">'.tr('Consuntivo', [], ['upper' => true]).'</h4>
|
||||
<b>'.tr('Ordine num. _NUM_ del _DATE_', [
|
||||
'_NUM_' => (!empty($documento['numero_esterno']) ? $documento['numero_esterno'] : $documento['numero']),
|
||||
'_DATE_' => Translator::dateToLocale($documento['data']),
|
||||
'_DATE_' => dateFormat($documento['data']),
|
||||
], ['upper' => true]).'</b>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
echo '
|
||||
<h5 style="border-bottom:1px solid #777; display:block;">
|
||||
<div class="col-xs-5">STAMPA MASTRINO <small>'.Translator::dateToLocale($date_start).' - '.Translator::dateTolocale($date_end).'</small></div>
|
||||
<div class="col-xs-5">STAMPA MASTRINO <small>'.dateFormat($date_start).' - '.dateFormat($date_end).'</small></div>
|
||||
<div class="col-xs-7 text-right">'.$azienda['ragione_sociale'].'</div>
|
||||
</h5>
|
||||
'.$conto1['descrizione'].'<br>';
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue