BUB-5 Creato filtro da pagina report in base alla categoria sui movimenti
This commit is contained in:
parent
717d100dcf
commit
aac58aca6d
21
app/Http/Controllers/CondominioController.php
Normal file
21
app/Http/Controllers/CondominioController.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Barryvdh\DomPDF\Facade\Pdf;
|
||||
|
||||
|
||||
class CondominioController extends Controller
|
||||
{
|
||||
public function testPdf(){
|
||||
$data=DB::table('categories')->get();
|
||||
$pdf = PDF::setOptions(['dpi' => 150, 'defaultFont' => 'Helvetica'])->loadView('conti.categorie.list', ['categorie' => $data->toArray()]);
|
||||
//return $pdf->download('invoice.pdf');
|
||||
/*$pdf = App::make('dompdf.wrapper');
|
||||
$pdf->loadHTML('<h1>Test</h1>');*/
|
||||
return $pdf->stream();
|
||||
}
|
||||
}
|
@ -143,21 +143,21 @@ class MovimentiController extends Controller
|
||||
}
|
||||
|
||||
$reportSpesa = DB::table('movimentis')
|
||||
->selectRaw('ABS(Sum(movimentis.mov_importo)) as resoconto, categories.cat_name')
|
||||
->selectRaw('ABS(Sum(movimentis.mov_importo)) as resoconto, categories.cat_name,categories.id')
|
||||
->join('categories','movimentis.mov_fk_categoria','=','categories.id')
|
||||
->where('mov_importo','<',0)
|
||||
->whereYear('mov_data',$year)
|
||||
->whereMonth('mov_data',$month)
|
||||
->groupBy('cat_name')
|
||||
->groupBy('cat_name','categories.id')
|
||||
->get();
|
||||
|
||||
$reportEntrate = DB::table('movimentis')
|
||||
->selectRaw('ABS(Sum(movimentis.mov_importo)) as resoconto, categories.cat_name')
|
||||
->selectRaw('ABS(Sum(movimentis.mov_importo)) as resoconto, categories.cat_name,categories.id')
|
||||
->join('categories','movimentis.mov_fk_categoria','=','categories.id')
|
||||
->where('mov_importo','>',0)
|
||||
->whereYear('mov_data',$year)
|
||||
->whereMonth('mov_data',$month)
|
||||
->groupBy('cat_name')
|
||||
->groupBy('cat_name','categories.id')
|
||||
->get();
|
||||
|
||||
return view('components.charts',[
|
||||
@ -212,6 +212,20 @@ class MovimentiController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function listMovPerCateg(Request $request)
|
||||
{
|
||||
$mov=DB::table('movimentis')
|
||||
->join('categories','movimentis.mov_fk_categoria','=','categories.id')
|
||||
->join('tags','movimentis.mov_fk_tags','=','tags.id')
|
||||
->where('movimentis.mov_fk_categoria','=',$request['cat'])
|
||||
->whereMonth('mov_data','=',$request['month'])
|
||||
->get();
|
||||
return view('conti.movimenti.list',
|
||||
[
|
||||
'movimenti'=> $mov,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function apiList()
|
||||
{
|
||||
|
11
app/Models/condominio.php
Normal file
11
app/Models/condominio.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class condominio extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
@ -41,6 +41,8 @@ $app->singleton(
|
||||
App\Exceptions\Handler::class
|
||||
);
|
||||
|
||||
// $app->register(\Barryvdh\DomPDF\ServiceProvider::class);
|
||||
// $app->configure('dompdf');
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Return The Application
|
||||
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateCondominiosTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('condominios', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('condominios');
|
||||
}
|
||||
}
|
@ -10,16 +10,16 @@
|
||||
<title>BuBo Family - made with <3 - </title>
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="../css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- MetisMenu CSS -->
|
||||
<link href="../css/metisMenu.min.css" rel="stylesheet">
|
||||
<link href="/css/metisMenu.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link href="../css/startmin.css" rel="stylesheet">
|
||||
<link href="/css/startmin.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom Fonts -->
|
||||
<link href="../css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="/css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
<!-- Latest compiled and minified CSS
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css">
|
||||
-->
|
||||
@ -108,20 +108,20 @@
|
||||
<!-- /#wrapper -->
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="../js/jquery.min.js"></script>
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="../js/bootstrap.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Metis Menu Plugin JavaScript -->
|
||||
<script src="../js/metisMenu.min.js"></script>
|
||||
<script src="/js/metisMenu.min.js"></script>
|
||||
|
||||
<!-- DataTables JavaScript -->
|
||||
<script src="../js/dataTables/jquery.dataTables.min.js"></script>
|
||||
<script src="../js/dataTables/dataTables.bootstrap.min.js"></script>
|
||||
<script src="/js/dataTables/jquery.dataTables.min.js"></script>
|
||||
<script src="/js/dataTables/dataTables.bootstrap.min.js"></script>
|
||||
|
||||
<!-- Custom Theme JavaScript -->
|
||||
<script src="../js/startmin.js"></script>
|
||||
<script src="/js/startmin.js"></script>
|
||||
@section('script')
|
||||
@show
|
||||
</body>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<tbody>
|
||||
@foreach( $dataSpesa as $dato )
|
||||
<tr>
|
||||
<td>{{ $dato->cat_name; }}</td>
|
||||
<td><a href="movimenti/report/movimenti_categoria?cat={{ $dato->id }}&month={{ $_GET['Month'] ?? date('m')}}">{{ $dato->cat_name; }}</a> </td>
|
||||
<td>{{ $dato->resoconto; }}</td>
|
||||
|
||||
</tr>
|
||||
@ -55,7 +55,7 @@
|
||||
<tbody>
|
||||
@foreach( $dataEntrate as $dato )
|
||||
<tr>
|
||||
<td>{{ $dato->cat_name; }}</td>
|
||||
<td><a href="movimenti/report/movimenti_categoria?cat={{ $dato->id }}&month={{ $_GET['Month'] ?? date('m')}}">{{ $dato->cat_name; }}</a> </td>
|
||||
<td>{{ $dato->resoconto; }}</td>
|
||||
|
||||
</tr>
|
||||
|
@ -10,14 +10,14 @@
|
||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="{{ asset('js/app.js') }}" defer></script>
|
||||
<script src="'/js/app.js'" defer></script>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="dns-prefetch" href="//fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
|
||||
|
||||
<!-- Styles -->
|
||||
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
|
||||
<link href="/css/app.css')" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\CategorieController;
|
||||
use App\Http\Controllers\CondominioController;
|
||||
use App\Http\Controllers\ContatoreEnElController;
|
||||
use App\Http\Controllers\ContatoreGasController;
|
||||
use App\Http\Controllers\MovimentiController;
|
||||
@ -36,8 +37,7 @@ Route::get('/', function () {
|
||||
Route::post('movmodify',[MovimentiController::class,'updatePostMovimenti']);
|
||||
Route::get('movdelete',[MovimentiController::class,'deleteMovimenti']);
|
||||
|
||||
Route::get('fullcalender', [FullCalenderController::class, 'index']);
|
||||
Route::post('fullcalenderAjax', [FullCalenderController::class, 'ajax']);
|
||||
|
||||
|
||||
Route::get('categorie', [CategorieController::class,'listCategorie'])->name('categorie');
|
||||
Route::post('categorie', [CategorieController::class,'insCategorie']);
|
||||
@ -55,3 +55,10 @@ Route::get('/', function () {
|
||||
|
||||
Route::get('lettureenel', [ContatoreEnElController::class,'listLettureEnel'])->name('enel');
|
||||
Route::post('lettureenel', [ContatoreEnElController::class,'insLettureEnel']);
|
||||
|
||||
Route::get('movimenti/report/movimenti_categoria', [MovimentiController::class,'listMovPerCateg']);
|
||||
|
||||
/// TEST routes
|
||||
Route::get('fullcalender', [FullCalenderController::class, 'index']);
|
||||
Route::post('fullcalenderAjax', [FullCalenderController::class, 'ajax']);
|
||||
Route::get('condominio',[CondominioController::class,'testPdf']);
|
||||
|
Loading…
Reference in New Issue
Block a user