pulizia e definizione dei report in base al mese corrente
This commit is contained in:
parent
6c9b014c0f
commit
8f55a70053
@ -26,9 +26,7 @@ class CategorieController extends Controller
|
|||||||
DB::table('categories')
|
DB::table('categories')
|
||||||
->where('id','=', $request['id'])
|
->where('id','=', $request['id'])
|
||||||
->delete();
|
->delete();
|
||||||
|
|
||||||
return redirect(route('categorie'));
|
return redirect(route('categorie'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apiList()
|
public function apiList()
|
||||||
|
@ -18,7 +18,9 @@ class ContatoreGasController extends Controller
|
|||||||
'gas_date'=> $request['gas_date'],
|
'gas_date'=> $request['gas_date'],
|
||||||
'gas_lettura'=> $request['gas_lettura'],
|
'gas_lettura'=> $request['gas_lettura'],
|
||||||
]);
|
]);
|
||||||
$letture=DB::table('contatore_gases')->orderBy('gas_date','desc')->get();
|
$letture=DB::table('contatore_gases')
|
||||||
|
->orderBy('gas_date','asc')
|
||||||
|
->get();
|
||||||
return view('components.chartGas',['lettureGas'=>$letture]);
|
return view('components.chartGas',['lettureGas'=>$letture]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,27 +122,47 @@ class MovimentiController extends Controller
|
|||||||
// return dd($movimenti);
|
// return dd($movimenti);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resocontoMovimenti()
|
public function resocontoMovimenti(Request $request)
|
||||||
{
|
{
|
||||||
// SELECT Sum(movimentis.mov_importo) as resoconto, categories.cat_name FROM movimentis JOIN categories ON movimentis.mov_fk_categoria = categories.id GROUP BY categories.id;
|
// SELECT Sum(movimentis.mov_importo) as resoconto, categories.cat_name FROM movimentis JOIN categories ON movimentis.mov_fk_categoria = categories.id GROUP BY categories.id;
|
||||||
|
// aggiunto per definizione del periodo di resoconto.
|
||||||
|
if(!$request['Year'])
|
||||||
|
{
|
||||||
|
$year=date('Y');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$year=$request['Year'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$request['Month'])
|
||||||
|
{
|
||||||
|
$month=date('m');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$month=$request['Month'];
|
||||||
|
}
|
||||||
|
|
||||||
$reportSpesa = DB::table('movimentis')
|
$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')
|
||||||
->join('categories','movimentis.mov_fk_categoria','=','categories.id')
|
->join('categories','movimentis.mov_fk_categoria','=','categories.id')
|
||||||
->where('mov_importo','<',0)
|
->where('mov_importo','<',0)
|
||||||
->whereYear('mov_data',date('Y'))
|
->whereYear('mov_data',$year)
|
||||||
|
->whereMonth('mov_data',$month)
|
||||||
->groupBy('cat_name')
|
->groupBy('cat_name')
|
||||||
->get();
|
->get();
|
||||||
$reportEntrate = DB::table('movimentis')
|
|
||||||
|
$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')
|
||||||
->join('categories','movimentis.mov_fk_categoria','=','categories.id')
|
->join('categories','movimentis.mov_fk_categoria','=','categories.id')
|
||||||
->where('mov_importo','>',0)
|
->where('mov_importo','>',0)
|
||||||
->whereYear('mov_data',date('Y'))
|
->whereYear('mov_data',date('Y'))
|
||||||
|
->whereMonth('mov_data',date('m'))
|
||||||
->groupBy('cat_name')
|
->groupBy('cat_name')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
return view('components.charts',[
|
return view('components.charts',[
|
||||||
'dataSpesa'=>$reportSpesa,
|
'dataSpesa'=>$reportSpesa,
|
||||||
'dataEntrate'=>$reportEntrate,
|
'dataEntrate'=>$reportEntrate,
|
||||||
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,16 +170,16 @@ class MovimentiController extends Controller
|
|||||||
{
|
{
|
||||||
$id=$request['id'];
|
$id=$request['id'];
|
||||||
$mov=DB::table('movimentis')
|
$mov=DB::table('movimentis')
|
||||||
->join('categories','movimentis.mov_fk_categoria','=','categories.id')
|
->join('categories','movimentis.mov_fk_categoria','=','categories.id')
|
||||||
->join('tags','movimentis.mov_fk_tags','=','tags.id')
|
->join('tags','movimentis.mov_fk_tags','=','tags.id')
|
||||||
->where('movimentis.id','=',$id)
|
->where('movimentis.id','=',$id)
|
||||||
->get();
|
->get();
|
||||||
$categorie=DB::table('categories')
|
$categorie=DB::table('categories')
|
||||||
->orderBy('cat_name')
|
->orderBy('cat_name')
|
||||||
->get();
|
->get();
|
||||||
$tags=DB::table('tags')
|
$tags=DB::table('tags')
|
||||||
->orderBy('tag_name')
|
->orderBy('tag_name')
|
||||||
->get();
|
->get();
|
||||||
return view('conti.movimenti.update',
|
return view('conti.movimenti.update',
|
||||||
[
|
[
|
||||||
'categorie'=> $categorie,
|
'categorie'=> $categorie,
|
||||||
@ -179,7 +199,6 @@ class MovimentiController extends Controller
|
|||||||
'mov_importo'=>$request['mov_importo'],
|
'mov_importo'=>$request['mov_importo'],
|
||||||
'mov_fk_tags'=>$request['mov_fk_tags'],
|
'mov_fk_tags'=>$request['mov_fk_tags'],
|
||||||
'mov_inserito_da'=>$request['userid'],
|
'mov_inserito_da'=>$request['userid'],
|
||||||
|
|
||||||
]);
|
]);
|
||||||
return redirect(route('movimenti'));
|
return redirect(route('movimenti'));
|
||||||
}
|
}
|
||||||
|
135
composer.json
135
composer.json
@ -1,72 +1,67 @@
|
|||||||
{
|
{
|
||||||
"name": "laravel/laravel",
|
"name" : "laravel/laravel",
|
||||||
"type": "project",
|
"type" : "project",
|
||||||
"description": "The Laravel Framework.",
|
"description" : "The Laravel Framework.",
|
||||||
"keywords": ["framework", "laravel"],
|
"keywords" : [
|
||||||
"license": "MIT",
|
"framework",
|
||||||
"require": {
|
"laravel"
|
||||||
"php": "^7.3|^8.0",
|
],
|
||||||
"barryvdh/laravel-dompdf": "^1.0",
|
"license" : "MIT",
|
||||||
"consoletvs/charts": "7.*",
|
"require" : {
|
||||||
"directorytree/ldaprecord": "^2.9",
|
"php": "^7.3|^8.0",
|
||||||
"fruitcake/laravel-cors": "^2.0",
|
"barryvdh/laravel-dompdf": "^1.0",
|
||||||
"guzzlehttp/guzzle": "^7.0.1",
|
"consoletvs/charts": "7.*",
|
||||||
"laravel-notification-channels/telegram": "^1.0",
|
"directorytree/ldaprecord": "^2.9",
|
||||||
"laravel/framework": "^8.75",
|
"fruitcake/laravel-cors": "^2.0",
|
||||||
"laravel/sanctum": "^2.11",
|
"guzzlehttp/guzzle": "^7.0.1",
|
||||||
"laravel/tinker": "^2.5",
|
"laravel-notification-channels/telegram": "^2.0",
|
||||||
"laravel/ui": "^3.4",
|
"laravel/framework": "^8.75",
|
||||||
"laraveldaily/laravel-charts": "^0.1.29",
|
"laravel/sanctum": "^2.11",
|
||||||
"rap2hpoutre/fast-excel": "^3.2",
|
"laravel/tinker": "^2.5",
|
||||||
"secondtruth/startmin": "^1.1",
|
"laravel/ui": "^3.4",
|
||||||
"snapappointments/bootstrap-select": "^1.13",
|
"laraveldaily/laravel-charts": "^0.1.29",
|
||||||
"webklex/laravel-imap": "^2.4"
|
"rap2hpoutre/fast-excel": "^3.2",
|
||||||
},
|
"secondtruth/startmin": "^1.1",
|
||||||
"require-dev": {
|
"snapappointments/bootstrap-select": "^1.13",
|
||||||
"facade/ignition": "^2.5",
|
"webklex/laravel-imap": "^2.4"
|
||||||
"fakerphp/faker": "^1.9.1",
|
},
|
||||||
"laravel/sail": "^1.0.1",
|
"require-dev" : {
|
||||||
"mockery/mockery": "^1.4.4",
|
"facade/ignition" : "^2.5",
|
||||||
"nunomaduro/collision": "^5.10",
|
"fakerphp/faker" : "^1.9.1",
|
||||||
"phpunit/phpunit": "^9.5.10"
|
"laravel/sail" : "^1.0.1",
|
||||||
},
|
"mockery/mockery" : "^1.4.4",
|
||||||
"autoload": {
|
"nunomaduro/collision" : "^5.10",
|
||||||
"psr-4": {
|
"phpunit/phpunit" : "^9.5.10"
|
||||||
"App\\": "app/",
|
},
|
||||||
"Database\\Factories\\": "database/factories/",
|
"autoload" : {
|
||||||
"Database\\Seeders\\": "database/seeders/"
|
"psr-4" : {
|
||||||
}
|
"App\\" : "app/",
|
||||||
},
|
"Database\\Factories\\" : "database/factories/",
|
||||||
"autoload-dev": {
|
"Database\\Seeders\\" : "database/seeders/"
|
||||||
"psr-4": {
|
}
|
||||||
"Tests\\": "tests/"
|
},
|
||||||
}
|
"autoload-dev" : {
|
||||||
},
|
"psr-4" : {
|
||||||
"scripts": {
|
"Tests\\" : "tests/"
|
||||||
"post-autoload-dump": [
|
}
|
||||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
},
|
||||||
"@php artisan package:discover --ansi"
|
"scripts" : {
|
||||||
],
|
"post-autoload-dump" : [
|
||||||
"post-update-cmd": [
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
|
"@php artisan package:discover --ansi"
|
||||||
],
|
],
|
||||||
"post-root-package-install": [
|
"post-update-cmd" : "@php artisan vendor:publish --tag=laravel-assets --ansi --force",
|
||||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
"post-root-package-install" : "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
|
||||||
],
|
"post-create-project-cmd" : "@php artisan key:generate --ansi"
|
||||||
"post-create-project-cmd": [
|
},
|
||||||
"@php artisan key:generate --ansi"
|
"extra" : {
|
||||||
]
|
"laravel" : {}
|
||||||
},
|
},
|
||||||
"extra": {
|
"config" : {
|
||||||
"laravel": {
|
"optimize-autoloader" : true,
|
||||||
"dont-discover": []
|
"preferred-install" : "dist",
|
||||||
}
|
"sort-packages" : true
|
||||||
},
|
},
|
||||||
"config": {
|
"minimum-stability" : "dev",
|
||||||
"optimize-autoloader": true,
|
"prefer-stable" : true
|
||||||
"preferred-install": "dist",
|
|
||||||
"sort-packages": true
|
|
||||||
},
|
|
||||||
"minimum-stability": "dev",
|
|
||||||
"prefer-stable": true
|
|
||||||
}
|
}
|
||||||
|
30
composer.lock
generated
30
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "a669213562786481db52e95cf7c82be2",
|
"content-hash": "a4647119c1cdf9d566876ae0272f6a00",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "barryvdh/laravel-dompdf",
|
"name": "barryvdh/laravel-dompdf",
|
||||||
@ -1362,29 +1362,29 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel-notification-channels/telegram",
|
"name": "laravel-notification-channels/telegram",
|
||||||
"version": "1.0.0",
|
"version": "2.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel-notification-channels/telegram.git",
|
"url": "https://github.com/laravel-notification-channels/telegram.git",
|
||||||
"reference": "bc578efbd9cc08ec24830b64b8011992dfabb073"
|
"reference": "63f6727c3f9953e11ee9a690c29ce0db456d69a1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel-notification-channels/telegram/zipball/bc578efbd9cc08ec24830b64b8011992dfabb073",
|
"url": "https://api.github.com/repos/laravel-notification-channels/telegram/zipball/63f6727c3f9953e11ee9a690c29ce0db456d69a1",
|
||||||
"reference": "bc578efbd9cc08ec24830b64b8011992dfabb073",
|
"reference": "63f6727c3f9953e11ee9a690c29ce0db456d69a1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"guzzlehttp/guzzle": "^6.2 || ^7.0",
|
"guzzlehttp/guzzle": "^7.0",
|
||||||
"illuminate/contracts": "^5.5 || ^6.0 || ^7.0 || ^8.0",
|
"illuminate/contracts": "8.45 - 9",
|
||||||
"illuminate/notifications": "^5.5 || ^6.0 || ^7.0 || ^8.0",
|
"illuminate/notifications": "8.45 - 9",
|
||||||
"illuminate/support": "^5.5 || ^6.0 || ^7.0 || ^8.0",
|
"illuminate/support": "8.45 - 9",
|
||||||
"php": "^7.2 || ^8.0"
|
"php": "^7.4 || ^8.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"mockery/mockery": "^1.3",
|
"mockery/mockery": "^1.4",
|
||||||
"phpunit/phpunit": "^7.0 || ^8.5.21 || ^9.0"
|
"phpunit/phpunit": "^9.0"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
@ -1406,7 +1406,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Irfaq Syed",
|
"name": "Irfaq Syed",
|
||||||
"email": "syed@lukonet.com",
|
"email": "github@lukonet.net",
|
||||||
"homepage": "https://lukonet.com",
|
"homepage": "https://lukonet.com",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
}
|
}
|
||||||
@ -1422,9 +1422,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/laravel-notification-channels/telegram/issues",
|
"issues": "https://github.com/laravel-notification-channels/telegram/issues",
|
||||||
"source": "https://github.com/laravel-notification-channels/telegram/tree/1.0.0"
|
"source": "https://github.com/laravel-notification-channels/telegram/tree/2.0.0"
|
||||||
},
|
},
|
||||||
"time": "2021-12-10T22:33:41+00:00"
|
"time": "2022-02-10T19:29:50+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/framework",
|
"name": "laravel/framework",
|
||||||
|
@ -30,4 +30,7 @@ return [
|
|||||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'telegram-bot-api' => [
|
||||||
|
'token' => env('TELEGRAM_BOT_TOKEN', 'YOUR BOT TOKEN HERE')
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
100
resources/views/components/widget.blade.php
Normal file
100
resources/views/components/widget.blade.php
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
@extends('app')
|
||||||
|
@section('widget')
|
||||||
|
<div class="row">
|
||||||
|
<!-- USCITE WIDGET -->
|
||||||
|
<div class="col-lg-3 col-md-6">
|
||||||
|
<div class="panel panel-red">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-3">
|
||||||
|
<i class="fa fa-comments fa-5x"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-9 text-right">
|
||||||
|
<div class="huge">{{ $summary->uscite }}</div>
|
||||||
|
<div>Uscite</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a href="#">
|
||||||
|
<div class="panel-footer">
|
||||||
|
<span class="pull-left">View Details</span>
|
||||||
|
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||||
|
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ENTRATE WIDGET -->
|
||||||
|
<div class="col-lg-3 col-md-6">
|
||||||
|
<div class="panel panel-green">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-3">
|
||||||
|
<i class="fa fa-tasks fa-5x"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-9 text-right">
|
||||||
|
<div class="huge">{{ $summary->entrate }}</div>
|
||||||
|
<div>Entrate</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a href="#">
|
||||||
|
<div class="panel-footer">
|
||||||
|
<span class="pull-left">View Details</span>
|
||||||
|
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||||
|
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- BILANCIO WIDGET -->
|
||||||
|
<div class="col-lg-3 col-md-6">
|
||||||
|
<div class="panel panel-yellow">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-3">
|
||||||
|
<i class="fa fa-shopping-cart fa-5x"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-9 text-right">
|
||||||
|
<div class="huge">{{ $summary->entrate - $summary->uscite }}</div>
|
||||||
|
<div>Bilancio</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a href="#">
|
||||||
|
<div class="panel-footer">
|
||||||
|
<span class="pull-left">View Details</span>
|
||||||
|
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||||
|
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-3 col-md-6">
|
||||||
|
<div class="panel panel-primary">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-3">
|
||||||
|
<i class="fa fa-support fa-5x"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-9 text-right">
|
||||||
|
<div class="huge">13</div>
|
||||||
|
<div>Support Tickets!</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a href="#">
|
||||||
|
<div class="panel-footer">
|
||||||
|
<span class="pull-left">View Details</span>
|
||||||
|
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||||
|
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
@ -24,7 +24,7 @@
|
|||||||
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
|
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="{{ url('/') }}">
|
<a class="navbar-brand" href="{{ url('/') }}">
|
||||||
{{ config('app.name', 'Laravel') }}
|
{{ config('app.name', 'Gestionale Famigliare') }}
|
||||||
</a>
|
</a>
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
@ -76,6 +76,8 @@
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<main class="py-4">
|
<main class="py-4">
|
||||||
|
@section('widget')
|
||||||
|
@show
|
||||||
@yield('content')
|
@yield('content')
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user