mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-17 03:51:06 +01:00
Compare commits
4 Commits
248edcbe1e
...
331c21fb2c
Author | SHA1 | Date | |
---|---|---|---|
|
331c21fb2c | ||
|
653fee6b46 | ||
|
23111cd54e | ||
|
885ec40e03 |
@ -93,14 +93,17 @@ echo '
|
||||
</div>
|
||||
</div>
|
||||
<!-- RIGA 2 -->
|
||||
<div class="row">';
|
||||
<div class="row">
|
||||
<div class="col-md-3">';
|
||||
if ($record['idagente'] != 0) {
|
||||
echo Modules::link('Anagrafiche', $record['idagente'], null, null, 'class="pull-right"');
|
||||
echo Modules::link('Anagrafiche', $record['idagente'], null, null, 'class="pull-right"');
|
||||
}
|
||||
echo '
|
||||
<div class="col-md-3">
|
||||
|
||||
{[ "type": "select", "label": "'.tr('Agente').'", "name": "idagente", "ajax-source": "agenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idagente$" ]}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">';
|
||||
echo !empty($record['idpagamento']) ? Modules::link('Pagamenti', $record['idpagamento'], null, null, 'class="pull-right"') : '';
|
||||
echo '
|
||||
|
@ -56,7 +56,7 @@ class Pagamento extends Model
|
||||
|
||||
public function calcola($importo, $data, $id_anagrafica)
|
||||
{
|
||||
$rate = PagamentoLang::where('title', '=', $this->getTranslation('title'))->get()->sortBy('num_giorni')->pluck('id')->toArray();
|
||||
$rate = Pagamento::where('name', '=', $this->name)->get()->sortBy('num_giorni')->pluck('id')->toArray();
|
||||
$number = count($rate);
|
||||
|
||||
$totale = 0.0;
|
||||
|
@ -72,7 +72,7 @@ if (Services::isEnabled()) {
|
||||
$servizi_scaduti = Services::getServiziScaduti();
|
||||
if (!$servizi_in_scadenza->isEmpty() || !$servizi_scaduti->isEmpty()) {
|
||||
// TODO: Il tasto deve preparare correttamente il carrello con servizi e le risorse in scadenza, considerando anche eventuali ampliamenti (es. spazio FE esaurito o in esaurimento)
|
||||
echo ' </tbody>
|
||||
echo ' </tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
@ -116,16 +116,16 @@ if (Services::isEnabled()) {
|
||||
if (!$risorse_in_scadenza->isEmpty() || !$risorse_scadute->isEmpty()) {
|
||||
if (!$risorse_scadute->isEmpty()) {
|
||||
echo '
|
||||
<div class="alert alert-danger" role="alert"> <i class="fa fa-exclamation-triangle"></i> '.tr('Attenzione, alcune risorse sono scadute o hanno esaurito i crediti:', [
|
||||
'_NUM_' => $risorse_scadute->count(),
|
||||
<div class="alert alert-danger" role="alert"> <i class="fa fa-exclamation-triangle"></i> '.tr('Attenzione, alcune risorse sono scadute o hanno esaurito i crediti:', [
|
||||
'_NUM_' => $risorse_scadute->count(),
|
||||
]).'</div>';
|
||||
}
|
||||
|
||||
if (!$risorse_in_scadenza->isEmpty()) {
|
||||
echo '
|
||||
<div class="alert alert-warning" role="alert"> <i class="fa fa-clock-o"></i> '.tr('Attenzione, alcune risorse sono in scadenza o stanno per esaurire i crediti:', [
|
||||
'_NUM_' => $risorse_in_scadenza->count(),
|
||||
]).'</div>';
|
||||
<div class="alert alert-warning" role="alert"> <i class="fa fa-clock-o"></i> '.tr('Attenzione, alcune risorse sono in scadenza o stanno per esaurire i crediti:', [
|
||||
'_NUM_' => $risorse_in_scadenza->count(),
|
||||
]).'</div>';
|
||||
}
|
||||
} else {
|
||||
/*echo '
|
||||
@ -135,117 +135,110 @@ if (Services::isEnabled()) {
|
||||
}
|
||||
|
||||
echo '
|
||||
<table class="card-body table table-striped table-hover table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="50%">'.tr('Nome').'</th>
|
||||
<th>'.tr('Crediti').'</th>
|
||||
<th width="30%">'.tr('Scadenza').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>';
|
||||
<table class="card-body table table-striped table-hover table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="50%">'.tr('Nome').'</th>
|
||||
<th>'.tr('Crediti').'</th>
|
||||
<th width="30%">'.tr('Scadenza').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>';
|
||||
|
||||
foreach ($risorse_attive as $servizio) {
|
||||
$scadenza = Carbon::parse($servizio['expiration_at']);
|
||||
echo '
|
||||
<tr class="'.($scadenza->lessThan(Carbon::now()) ? 'danger' : ($scadenza->lessThan($limite_scadenze) ? 'warning' : '')).'">
|
||||
<td>'.$servizio['name'].'</td>
|
||||
<td>'.(($servizio['credits'] < 100 && $servizio['credits'] !== null) ? '<b><i class="fa fa-warning text-warning" ></i> ' : '').($servizio['credits'] ?? '-').(($servizio['credits'] < 100 && $servizio['credits'] !== null) ? '</b>' : '').'</td>
|
||||
<td>'.((Carbon::now()->diffInDays($scadenza, false) < $days && $scadenza) ? '<b><i class="fa fa-warning text-warning" ></i> ' : '').dateFormat($scadenza).' ('.$scadenza->diffForHumans().')'.((Carbon::now()->diffInDays($scadenza, false) < $days && $scadenza) ? '</b>' : '').'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
foreach ($risorse_attive as $servizio) {
|
||||
$scadenza = Carbon::parse($servizio['expiration_at']);
|
||||
echo '
|
||||
<tr class="'.($scadenza->lessThan(Carbon::now()) ? 'danger' : ($scadenza->lessThan($limite_scadenze) ? 'warning' : '')).'">
|
||||
<td>'.$servizio['name'].'</td>
|
||||
<td>'.(($servizio['credits'] < 100 && $servizio['credits'] !== null) ? '<b><i class="fa fa-warning text-warning" ></i> ' : '').($servizio['credits'] ?? '-').(($servizio['credits'] < 100 && $servizio['credits'] !== null) ? '</b>' : '').'</td>
|
||||
<td>'.((Carbon::now()->diffInDays($scadenza, false) < $days && $scadenza) ? '<b><i class="fa fa-warning text-warning" ></i> ' : '').dateFormat($scadenza).' ('.$scadenza->diffForHumans().')'.((Carbon::now()->diffInDays($scadenza, false) < $days && $scadenza) ? '</b>' : '').'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table></div></div>';
|
||||
</tbody>
|
||||
</table>
|
||||
</div>';
|
||||
|
||||
// Il servizio Fatturazione Elettronica deve essere presente per visualizzare le Statistiche su Fatture Elettroniche
|
||||
if (Services::getRisorseAttive()->where('name', 'Fatturazione Elettronica')->count()) {
|
||||
echo '
|
||||
|
||||
<div class="card card-primary">
|
||||
<div class="card-header" > <i class="fa fa-bar-chart"></i> '.tr('Statistiche su Fatture Elettroniche').'</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="alert hidden" role="alert" id="spazio-fe">
|
||||
<i id="spazio-fe-icon" class=""></i> <span>'.tr('Attenzione, spazio per fatture elettroniche _TEXT_: _NUM_ utilizzati su _TOT_ disponibili', [
|
||||
'_TEXT_' => '<span id="spazio-fe-text"></span>',
|
||||
'_NUM_' => '<span id="spazio-fe-occupato"></span>',
|
||||
'_TOT_' => '<span id="spazio-fe-totale"></span>',
|
||||
]).'.<br>'.tr("Contattare l'assistenza per risolvere il problema").'</span>.
|
||||
</div>
|
||||
|
||||
|
||||
<div class="alert hidden" role="alert" id="numero-fe">
|
||||
<i id="numero-fe-icon" class=""></i> <span>'.tr('Attenzione, numero di fatture elettroniche per l\'annualità _TEXT_: _NUM_ documenti transitati su _TOT_ disponibili', [
|
||||
'_TEXT_' => '<span id="numero-fe-text"></span>',
|
||||
'_NUM_' => '<span id="numero-fe-occupato"></span>',
|
||||
'_TOT_' => '<span id="numero-fe-totale"></span>',
|
||||
]).'.<br>'.tr("Contattare l'assistenza per risolvere il problema").'</span>.
|
||||
</div>
|
||||
|
||||
|
||||
<table class="card-body table table-striped table-hover table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Anno').'</th>
|
||||
<th>
|
||||
'.tr('N. documenti archiviati').'
|
||||
<span class="tip" title="'.tr('Fatture attive e relative ricevute, fatture passive').'.">
|
||||
<i class="fa fa-question-circle-o"></i>
|
||||
</span>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
'.tr('Spazio utilizzato').'
|
||||
<span class="tip" title="'.tr('Fatture attive con eventuali allegati e ricevute, fatture passive con eventuali allegati').'.">
|
||||
<i class="fa fa-question-circle-o"></i>
|
||||
</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot id="elenco-fe">
|
||||
<tr style="background-color:#CCCCCC;" >
|
||||
<td>'.tr('Totale').'</td>
|
||||
<td id="fe_numero"></td>
|
||||
<td id="fe_spazio"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card card-primary">
|
||||
<div class="card-header" > <i class="fa fa-bar-chart"></i> '.tr('Statistiche su Fatture Elettroniche').'
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function (){
|
||||
aggiornaStatisticheFE();
|
||||
});
|
||||
</script>';
|
||||
|
||||
<div class="card-body">
|
||||
<div class="alert hidden" role="alert" id="spazio-fe">
|
||||
<i id="spazio-fe-icon" class=""></i> <span>'.tr('Attenzione, spazio per fatture elettroniche _TEXT_: _NUM_ utilizzati su _TOT_ disponibili', [
|
||||
'_TEXT_' => '<span id="spazio-fe-text"></span>',
|
||||
'_NUM_' => '<span id="spazio-fe-occupato"></span>',
|
||||
'_TOT_' => '<span id="spazio-fe-totale"></span>',
|
||||
]).'.<br>'.tr("Contattare l'assistenza per risolvere il problema").'</span>.
|
||||
</div>
|
||||
|
||||
|
||||
<div class="alert hidden" role="alert" id="numero-fe">
|
||||
<i id="numero-fe-icon" class=""></i> <span>'.tr('Attenzione, numero di fatture elettroniche per l\'annualità _TEXT_: _NUM_ documenti transitati su _TOT_ disponibili', [
|
||||
'_TEXT_' => '<span id="numero-fe-text"></span>',
|
||||
'_NUM_' => '<span id="numero-fe-occupato"></span>',
|
||||
'_TOT_' => '<span id="numero-fe-totale"></span>',
|
||||
]).'.<br>'.tr("Contattare l'assistenza per risolvere il problema").'</span>.
|
||||
</div>
|
||||
|
||||
|
||||
<table class="card-body table table-striped table-hover table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Anno').'</th>
|
||||
<th>
|
||||
'.tr('N. documenti archiviati').'
|
||||
<span class="tip" title="'.tr('Fatture attive e relative ricevute, fatture passive').'.">
|
||||
<i class="fa fa-question-circle-o"></i>
|
||||
</span>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
'.tr('Spazio utilizzato').'
|
||||
<span class="tip" title="'.tr('Fatture attive con eventuali allegati e ricevute, fatture passive con eventuali allegati').'.">
|
||||
<i class="fa fa-question-circle-o"></i>
|
||||
</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot id="elenco-fe">
|
||||
<tr style="background-color:#CCCCCC;" >
|
||||
<td>'.tr('Totale').'</td>
|
||||
<td id="fe_numero"></td>
|
||||
<td id="fe_spazio"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function (){
|
||||
aggiornaStatisticheFE();
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
} else {
|
||||
echo '
|
||||
<div class="alert alert-info" role="alert">
|
||||
<i class="fa fa-info"></i> '.tr('Nessuna risorsa Services abilitata').'.
|
||||
</div>';
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</div>';
|
||||
} else {
|
||||
/*
|
||||
echo '
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<i class="fa fa-warning"></i> '.tr("Configurazione per l'accesso Services non completata correttamente").'. '.tr('Per abilitare i servizi, compilare l\'impostazione "OSMCloud Services API Token"').'.
|
||||
</div>
|
||||
</div>';
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="card card-info">
|
||||
|
@ -473,7 +473,7 @@ if ($has_sconto_finale) {
|
||||
<td class="cell-padded text-center" colspan="'.$first_colspan.'">
|
||||
'.moneyFormat($sconto_finale, 2).'
|
||||
</td>
|
||||
<td class="cell-padded text-center" colspan="'.$second_colspan.'" style="background-color: #FFFFCC;">
|
||||
<td class="cell-padded text-center" colspan="'.$second_colspan.'">
|
||||
'.moneyFormat($totale, 2).'
|
||||
</td>
|
||||
</tr>';
|
||||
|
Loading…
x
Reference in New Issue
Block a user