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'); ->sum('mov_importo');
$coll[]=$movrow;
$collx[]=$movrow;
//$coll[] = ['totale' => $movrow];
// $coll[]=array_push(array_sum($coll['totale']));
$coll[] = ['totale' => $movrow]; // $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, 'categorie'=>$categorie,
'mesi'=>$mesi, 'mesi'=>$mesi,
'matrice'=>array_chunk($coll, 12), 'matrice'=>array_chunk($coll, 12),
'totale'=>$totale,
'anno'=>$anno 'anno'=>$anno
]); ]);
} }
@ -322,6 +329,7 @@ class MovimentiController extends Controller
//$coll[] = str_replace(".",",",$movrow); //$coll[] = str_replace(".",",",$movrow);
$coll[] = $movrow; $coll[] = $movrow;
} }
$row[]=array_combine($intestazione,array_merge(array($ncategoria),$coll)); $row[]=array_combine($intestazione,array_merge(array($ncategoria),$coll));

View File

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