mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Controllo per impedire l'aggiunta di note interne vuote
Migliorie minori
This commit is contained in:
@@ -207,31 +207,35 @@ if (!empty($interventi)) {
|
|||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
// Totali per stato
|
|
||||||
echo '
|
|
||||||
<tr>
|
|
||||||
<td colspan="6">
|
|
||||||
<br><b>'.tr('Totale interventi per stato', [], ['upper' => true]).'</b>
|
|
||||||
</td>
|
|
||||||
</tr>';
|
|
||||||
|
|
||||||
$stati = $interventi->groupBy('idstatointervento');
|
$stati = $interventi->groupBy('idstatointervento');
|
||||||
foreach ($stati as $interventi_collegati) {
|
if (count($stati)>0){
|
||||||
$stato = $interventi_collegati->first()->stato;
|
|
||||||
$totale_stato = sum(array_column($interventi_collegati->toArray(), 'totale_imponibile'));
|
|
||||||
|
|
||||||
|
// Totali per stato
|
||||||
echo '
|
echo '
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3"></td>
|
<td colspan="6">
|
||||||
|
<br><b>'.tr('Totale interventi per stato', [], ['upper' => true]).'</b>
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
<td class="text-right" colspan="2" style="background:'.$stato->colore.';">
|
foreach ($stati as $interventi_collegati) {
|
||||||
<big><b>'.$stato->descrizione.':</b></big>
|
$stato = $interventi_collegati->first()->stato;
|
||||||
</td>
|
$totale_stato = sum(array_column($interventi_collegati->toArray(), 'totale_imponibile'));
|
||||||
|
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td colspan="3"></td>
|
||||||
|
|
||||||
|
<td class="text-right" colspan="2" style="background:'.$stato->colore.';">
|
||||||
|
<big><b>'.$stato->descrizione.':</b></big>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="text-right">
|
||||||
|
<big><b>'.moneyFormat($totale_stato).'</b></big>
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
<td class="text-right">
|
|
||||||
<big><b>'.moneyFormat($totale_stato).'</b></big>
|
|
||||||
</td>
|
|
||||||
</tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
@@ -269,16 +273,16 @@ if (!empty($totale_ore_contratto)) {
|
|||||||
echo '
|
echo '
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<big class="col-md-4 col-md-offset-4 text-center">
|
<big class="col-md-4 col-md-offset-4 text-center">
|
||||||
<table class="table text-left">
|
<table class="table text-left table-striped table-bordered">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">'.tr('Ore in contratto').':</td>
|
<td>'.tr('Ore a contratto').':</td>
|
||||||
<td colspan="2" class="text-right">'.Translator::numberToLocale($totale_ore_contratto).'</td>
|
<td class="text-right">'.Translator::numberToLocale($totale_ore_contratto).'</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>'.tr('Ore erogate totali').':</td>
|
<td>'.tr('Ore erogate totali').':</td>
|
||||||
<td class="text-right">'.Translator::numberToLocale($totale_ore).'</td>
|
<td class="text-right">'.Translator::numberToLocale($totale_ore).'</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td>'.tr('Ore residue totali').':</td>
|
<td>'.tr('Ore residue totali').':</td>
|
||||||
<td class="text-right">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore)).'</td>
|
<td class="text-right">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore)).'</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -286,8 +290,9 @@ if (!empty($totale_ore_contratto)) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td>'.tr('Ore erogate concluse').':</td>
|
<td>'.tr('Ore erogate concluse').':</td>
|
||||||
<td class="text-right">'.Translator::numberToLocale($totale_ore_completate).'</td>
|
<td class="text-right">'.Translator::numberToLocale($totale_ore_completate).'</td>
|
||||||
|
</tr>
|
||||||
<td>'.tr('Ore residue').':</td>
|
<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">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore_completate)).'</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@@ -170,16 +170,16 @@ switch (get('op')) {
|
|||||||
foreach ($rsp as $r) {
|
foreach ($rsp as $r) {
|
||||||
if ($r['mese'] == $mese) {
|
if ($r['mese'] == $mese) {
|
||||||
if (date('Ymd', strtotime($r['data_richiesta'])) < date('Ymd')) {
|
if (date('Ymd', strtotime($r['data_richiesta'])) < date('Ymd')) {
|
||||||
$class = 'fc-event-danger';
|
$class = 'danger';
|
||||||
} else {
|
} else {
|
||||||
$class = 'fc-event-primary';
|
$class = 'primary';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<div class="fc-event '.$class.'" data-id="'.$r['id'].'" data-idcontratto="'.$r['idcontratto'].'" data-ref="'.$r['ref'].'">'.(($r['ref'] == 'intervento') ? '<i class=\'fa fa-wrench pull-right\'></i>' : '<i class=\'fa fa-file-text-o pull-right\'></i>').'
|
<div class="fc-event fc-event-'.$class.'" data-id="'.$r['id'].'" data-idcontratto="'.$r['idcontratto'].'" data-ref="'.$r['ref'].'">'.(($r['ref'] == 'intervento') ? '<i class=\'fa fa-wrench pull-right\'></i>' : '<i class=\'fa fa-file-text-o pull-right\'></i>').'
|
||||||
<b>'.$r['ragione_sociale'].'</b><br>'.Translator::dateToLocale($r['data_richiesta']).' ('.$r['tipointervento'].')<div class="request" >'.(!empty($r['richiesta']) ? ' - '.$r['richiesta'] : '').'</div>'.(!empty($r['nomecontratto']) ? '<br><b>Contratto:</b> '.$r['nomecontratto'] : '').
|
<b>'.$r['ragione_sociale'].'</b><br>'.Translator::dateToLocale($r['data_richiesta']).' ('.$r['tipointervento'].')<div class="request" >'.(!empty($r['richiesta']) ? ' - '.$r['richiesta'] : '').'</div>'.(!empty($r['nomecontratto']) ? '<br><b>Contratto:</b> '.$r['nomecontratto'] : '').
|
||||||
(!empty($r['data_scadenza'] and $r['data_scadenza'] != '0000-00-00 00:00:00') ? '<br><small>'.tr('entro il: ').Translator::dateToLocale($r['data_scadenza']).'</small>' : '').
|
(!empty($r['data_scadenza'] and $r['data_scadenza'] != '0000-00-00 00:00:00') ? '<br><small>'.tr('entro il: ').Translator::dateToLocale($r['data_scadenza']).'</small>' : '').
|
||||||
(($r['ref'] == 'intervento') ? (Modules::link('Interventi', $r['id'], '<i class="fa fa-eye"></i>', null, 'title="'.tr('Visualizza scheda').'" class="btn btn-primary btn-xs pull-right"')).'<br>' : (Modules::link('Contratti', $r['idcontratto'], '<i class="fa fa-eye"></i>', null, 'title="'.tr('Visualizza scheda').'" class="btn btn-primary btn-xs pull-right"')).'<br>').
|
(($r['ref'] == 'intervento') ? (Modules::link('Interventi', $r['id'], '<i class="fa fa-eye"></i>', null, 'title="'.tr('Visualizza scheda').'" class="btn btn-'.$class.' btn-xs pull-right"')).'<br>' : (Modules::link('Contratti', $r['idcontratto'], '<i class="fa fa-eye"></i>', null, 'title="'.tr('Visualizza scheda').'" class="btn btn-'.$class.' btn-xs pull-right"')).'<br>').
|
||||||
'</div>';
|
'</div>';
|
||||||
}
|
}
|
||||||
} ?>
|
} ?>
|
||||||
|
@@ -206,31 +206,35 @@ if (!empty($interventi)) {
|
|||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
// Totali per stato
|
|
||||||
echo '
|
|
||||||
<tr>
|
|
||||||
<td colspan="6">
|
|
||||||
<br><b>'.tr('Totale interventi per stato', [], ['upper' => true]).'</b>
|
|
||||||
</td>
|
|
||||||
</tr>';
|
|
||||||
|
|
||||||
$stati = $interventi->groupBy('idstatointervento');
|
$stati = $interventi->groupBy('idstatointervento');
|
||||||
foreach ($stati as $interventi_collegati) {
|
if (count($stati)>0){
|
||||||
$stato = $interventi_collegati->first()->stato;
|
|
||||||
$totale_stato = sum(array_column($interventi_collegati->toArray(), 'totale_imponibile'));
|
|
||||||
|
|
||||||
|
// Totali per stato
|
||||||
echo '
|
echo '
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3"></td>
|
<td colspan="6">
|
||||||
|
<br><b>'.tr('Totale interventi per stato', [], ['upper' => true]).'</b>
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
<td class="text-right" colspan="2" style="background:'.$stato->colore.';">
|
foreach ($stati as $interventi_collegati) {
|
||||||
<big><b>'.$stato->descrizione.':</b></big>
|
$stato = $interventi_collegati->first()->stato;
|
||||||
</td>
|
$totale_stato = sum(array_column($interventi_collegati->toArray(), 'totale_imponibile'));
|
||||||
|
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td colspan="3"></td>
|
||||||
|
|
||||||
|
<td class="text-right" colspan="2" style="background:'.$stato->colore.';">
|
||||||
|
<big><b>'.$stato->descrizione.':</b></big>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="text-right">
|
||||||
|
<big><b>'.moneyFormat($totale_stato).'</b></big>
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
<td class="text-right">
|
|
||||||
<big><b>'.moneyFormat($totale_stato).'</b></big>
|
|
||||||
</td>
|
|
||||||
</tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
|
@@ -87,10 +87,25 @@ if ($structure->permission == 'rw') {
|
|||||||
<!-- PULSANTI -->
|
<!-- PULSANTI -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12 text-right">
|
<div class="col-md-12 text-right">
|
||||||
<button type="sumbit" class="btn btn-primary">
|
<button type="submit" class="btn btn-primary" disabled id="aggiungi_nota" >
|
||||||
<i class="fa fa-plus"></i> '.tr('Aggiungi').'
|
<i class="fa fa-plus"></i> '.tr('Aggiungi').'
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>';
|
</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
echo '
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
CKEDITOR.instances["contenuto"].on("key", function() {
|
||||||
|
setTimeout(function(){
|
||||||
|
if(CKEDITOR.instances["contenuto"].getData() == ""){
|
||||||
|
$("#aggiungi_nota").prop("disabled", true);
|
||||||
|
}
|
||||||
|
else $("#aggiungi_nota").prop("disabled", false);
|
||||||
|
}, 10);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
@@ -59,7 +59,7 @@ if ($pricing || !empty($totale_ore)) {
|
|||||||
<th colspan="2" class="text-center">
|
<th colspan="2" class="text-center">
|
||||||
<b>'.Translator::numberToLocale($totale_ore - $totale_ore_impiegate).'</b><br>
|
<b>'.Translator::numberToLocale($totale_ore - $totale_ore_impiegate).'</b><br>
|
||||||
<p>'.tr('Ore erogate').': '.Translator::numberToLocale($totale_ore_impiegate).'</p>
|
<p>'.tr('Ore erogate').': '.Translator::numberToLocale($totale_ore_impiegate).'</p>
|
||||||
<p>'.tr('Ore in contratto').': '.Translator::numberToLocale($totale_ore).'</p>
|
<p>'.tr('Ore a contratto').': '.Translator::numberToLocale($totale_ore).'</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>';
|
</tr>';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user