aggiunto selezione anno per il report per categorie
Per riuscire a vedere il report degli anni anche passati
This commit is contained in:
parent
25c1050e4a
commit
bac43417da
@ -200,12 +200,15 @@ class MovimentiController extends Controller
|
|||||||
unset($collx);
|
unset($collx);
|
||||||
}
|
}
|
||||||
/*dd($totale);*/
|
/*dd($totale);*/
|
||||||
|
$anni=Movimenti::getYearsFromMovimenti();
|
||||||
|
// dd($anni);
|
||||||
return view('conti.report.catanno',[
|
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,
|
'totale'=>$totale,
|
||||||
'anno'=>$anno
|
'anno'=>$anno,
|
||||||
|
'sel_anni'=>$anni,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,5 +311,14 @@ class MovimentiController extends Controller
|
|||||||
return view('conti.importCR');
|
return view('conti.importCR');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test()
|
||||||
|
{
|
||||||
|
Movimenti::getYearsFromMovimenti();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function manageRedirect(Request $request)
|
||||||
|
{
|
||||||
|
return redirect('/admin/reportbudget/'.$request['anno']);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -203,6 +203,14 @@ class Movimenti extends Model
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getYearsFromMovimenti()
|
||||||
|
{
|
||||||
|
$anni=DB::table('movimentis')->select(DB::raw('DISTINCT YEAR(mov_data) as anno'))->get();
|
||||||
|
// dd($anni); // for test purposes
|
||||||
|
return $anni;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static function dateFormat($type,$string)
|
private static function dateFormat($type,$string)
|
||||||
{
|
{
|
||||||
if($type)
|
if($type)
|
||||||
|
@ -18,6 +18,17 @@
|
|||||||
Rapporto spese per categoria nell'arco dell'anno {{ $anno ?? '' }}
|
Rapporto spese per categoria nell'arco dell'anno {{ $anno ?? '' }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
<div class="row">
|
||||||
|
<form action="" method="POST">
|
||||||
|
@csrf
|
||||||
|
<select name="anno">
|
||||||
|
@foreach($sel_anni as $sel)
|
||||||
|
<option value="{{ $sel->anno }}">{{ $sel->anno }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<input type="submit" name="Seleziona">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
<table class="table table-striped table-bordered table-hover" id="listrapporto">
|
<table class="table table-striped table-bordered table-hover" id="listrapporto">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -40,9 +40,10 @@ Route::get('/', [MovimentiController::class,'dashboard']);
|
|||||||
Route::get('movmodify',[MovimentiController::class,'updateMovimenti']);
|
Route::get('movmodify',[MovimentiController::class,'updateMovimenti']);
|
||||||
Route::post('movmodify',[MovimentiController::class,'updatePostMovimenti']);
|
Route::post('movmodify',[MovimentiController::class,'updatePostMovimenti']);
|
||||||
Route::get('movdelete',[MovimentiController::class,'deleteMovimenti']);
|
Route::get('movdelete',[MovimentiController::class,'deleteMovimenti']);
|
||||||
Route::get('reportbudget',[MovimentiController::class,'reportCategorieAnno'])->name('budget');
|
Route::get('reportbudget/{anno?}',[MovimentiController::class,'reportCategorieAnno'])->name('budget');
|
||||||
|
Route::post('reportbudget/{anno?}',[MovimentiController::class,'manageRedirect']);
|
||||||
Route::get('reportbudgetxls',[MovimentiController::class,'reportCategorieAnnoXLS'])->name('budgetxls');
|
Route::get('reportbudgetxls',[MovimentiController::class,'reportCategorieAnnoXLS'])->name('budgetxls');
|
||||||
|
Route::get('movimenti/test', [MovimentiController::class,'test']);
|
||||||
|
|
||||||
Route::get('categorie', [CategorieController::class,'listCategorie'])->name('categorie');
|
Route::get('categorie', [CategorieController::class,'listCategorie'])->name('categorie');
|
||||||
Route::post('categorie', [CategorieController::class,'insCategorie']);
|
Route::post('categorie', [CategorieController::class,'insCategorie']);
|
||||||
|
Loading…
Reference in New Issue
Block a user