Effettuato modifiche al report annuale e alla lista movimenti per problema ISSUE#3
This commit is contained in:
@@ -34,13 +34,15 @@ class MovimentiController extends Controller
|
||||
public static function listMovimenti(){
|
||||
$categorie=Categorie::list();
|
||||
$tags=tag::getList();
|
||||
$contos=Conto::all();
|
||||
/* Query per visualizzare anche il totale dei documenti presenti per il record */
|
||||
$movimenti=Movimenti::getList();
|
||||
|
||||
|
||||
//dd($movimenti);
|
||||
return view('conti.movimenti.list',[
|
||||
'categorie'=>$categorie,
|
||||
'movimenti'=>$movimenti,
|
||||
'contos'=>$contos,
|
||||
'tags'=>$tags
|
||||
]);
|
||||
}
|
||||
@@ -227,14 +229,32 @@ class MovimentiController extends Controller
|
||||
$ncategoria=$categoria->cat_name;
|
||||
for ($i=1;$i<=12;$i++)
|
||||
{
|
||||
$movrow=DB::table('movimentis')
|
||||
->whereMonth('mov_data','=',$i)
|
||||
->whereYear('mov_data','=',$anno)
|
||||
->where('mov_fk_categoria','=',$id)
|
||||
->sum('mov_importo');
|
||||
$importo_dare = DB::table('movimentis')
|
||||
->whereMonth('mov_data', '=', $i)
|
||||
->whereYear('mov_data', '=', $anno)
|
||||
->where('mov_fk_categoria', '=', $id)
|
||||
->sum('mov_importo_dare');
|
||||
|
||||
$importo_avere = DB::table('movimentis')
|
||||
->whereMonth('mov_data', '=', $i)
|
||||
->whereYear('mov_data', '=', $anno)
|
||||
->where('mov_fk_categoria', '=', $id)
|
||||
->sum('mov_importo_avere');
|
||||
|
||||
// $movrow=DB::table('movimentis')
|
||||
// ->whereMonth('mov_data','=',$i)
|
||||
// ->whereYear('mov_data','=',$anno)
|
||||
// ->where('mov_fk_categoria','=',$id)
|
||||
// ->sum('mov_importo_dare')
|
||||
// ->sum('mov_importo_avere');
|
||||
$movrow = $importo_avere - $importo_dare;
|
||||
|
||||
$coll[]=$movrow;
|
||||
$collx[]=$movrow;
|
||||
}
|
||||
//TEST
|
||||
// dd($movrow);
|
||||
// /TEST
|
||||
$totale[]=array_sum($collx);
|
||||
unset($collx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user