Aggiunto colonna totali a report movimenti annui

This commit is contained in:
Amministratore 2022-03-21 15:34:48 +01:00
parent 3a07259e5a
commit b268536727
2 changed files with 19 additions and 7 deletions

View File

@ -285,15 +285,22 @@ class MovimentiController extends Controller
->sum('mov_importo');
$coll[] = ['totale' => $movrow];
$coll[]=$movrow;
$collx[]=$movrow;
//$coll[] = ['totale' => $movrow];
// $coll[]=array_push(array_sum($coll['totale']));
// $coll[]=array_push($coll,$totale);
}
$totale[]=array_sum($collx);
unset($collx);
}
return view('conti.report.catanno',[
/*dd($totale);*/
return view('conti.report.catanno',[
'categorie'=>$categorie,
'mesi'=>$mesi,
'matrice'=>array_chunk($coll, 12),
'totale'=>$totale,
'anno'=>$anno
]);
}
@ -322,8 +329,9 @@ class MovimentiController extends Controller
//$coll[] = str_replace(".",",",$movrow);
$coll[] = $movrow;
}
$row[]=array_combine($intestazione,array_merge(array($ncategoria),$coll));
unset($coll);
}

View File

@ -25,6 +25,7 @@
@foreach($mesi as $mese)
<td>{{ $mese }}</td>
@endforeach
<td><b>Totale</b></td>
</tr>
</thead>
<tbody>
@ -42,13 +43,16 @@
{
@endphp
<td>{{ $matrice[$cat][$index]['totale'] }}</td>
<td>{{ $matrice[$cat][$index] }}</td>
@php
$index++;
}
$cat++;
@endphp
<td align="right"><b>{{ number_format($totale[$cat],2,'.','') }}</b></td>
@php
$cat++;
@endphp
</tr>
@endforeach