diff --git a/app/Http/Controllers/ContrattiController.php b/app/Http/Controllers/ContrattiController.php new file mode 100644 index 0000000..7e357bf --- /dev/null +++ b/app/Http/Controllers/ContrattiController.php @@ -0,0 +1,15 @@ +Contratti::all()]); + } +} diff --git a/app/Http/Controllers/DocumentiController.php b/app/Http/Controllers/DocumentiController.php index b1f47f0..88cfadc 100644 --- a/app/Http/Controllers/DocumentiController.php +++ b/app/Http/Controllers/DocumentiController.php @@ -28,4 +28,21 @@ class DocumentiController extends Controller 'documenti'=>$documenti ]); } + + /* + // {issue #5} Proposta cambiamento per generalizzazione documenti + // NB: cambiare anche in routes/admin.php il riferimento alla funzione da richiamare + public function fileMovimentiForm(Request $request){ + $documenti = Documenti::getList($request->input('id'),'Movimenti'); + return view('conti.documenti.insert', [ + 'id'=>$request['id']), + 'documenti'=>$documenti + ]); + } + */ + + public function listaDocumenti() + { + return view('documenti.lista',['data'=>Documenti::all()]); + } } diff --git a/app/Models/Contratti.php b/app/Models/Contratti.php new file mode 100644 index 0000000..070af1b --- /dev/null +++ b/app/Models/Contratti.php @@ -0,0 +1,11 @@ +count(); return $quanti; } + + // Proposta modifica {issue #5} gitea (generalizzazione del documento) + /* + public static function countDocument($id,$entity) + { + return self::where('entita','=',$entity)->where('entita_id','=',$id)->count(); + } + */ public static function store($req) { $movimento_id=$req->input('id'); @@ -27,6 +35,20 @@ class Documenti extends Model 'filename'=>$filename, ]); } + + // Proposta modifica {issue #5} gitea (generalizzazione del documento) + /* + public static function store($req) { + $movimento_id=$req->input('id'); + $filename=$req->file('filename')->store('Documenti'); + self::create([ + 'entità'=>$req['entita'], // aggiunto per determinare il tipo di entità a cui si riferisce il documento + 'entita_id'=>$req['entita_id'], // aggiunto per identificare il record al quale associare il documento (al posto di id_movimento) + 'descrizione'=>$req['descrizione'], + 'filename'=>$filename + ]); + } + */ public static function getList($id) { @@ -35,4 +57,11 @@ class Documenti extends Model ->get(); } + // Proposta modifica issue {#5 gitea} (generalizzazione del documento) + /* + public static function getList($id,$entity) + { + self::where('entita','=',$entity)->where('entita_id','=',$id)->get(); + } + */ } diff --git a/app/Models/Movimenti.php b/app/Models/Movimenti.php index a58637f..f1b3e62 100644 --- a/app/Models/Movimenti.php +++ b/app/Models/Movimenti.php @@ -158,7 +158,7 @@ class Movimenti extends Model if($line['Data valuta']) { self::insEntrata([ - 'mov_data'=>self::dateFormat(0,$line['Data valuta']), + 'mov_data'=>$line['Data valuta'], 'mov_fk_categoria'=>1, 'mov_descrizione'=>$line['Descrizione operazione'], 'mov_importo'=>trim(str_replace(',','.',(str_replace('.','',str_replace('€', '', $line['Importo']))))), @@ -217,7 +217,7 @@ class Movimenti extends Model private static function dateFormat($type,$string) { - + // $string=(string)$string; if($type) { // $string=$string->format('Y-m-d'); diff --git a/config/app.php b/config/app.php index 271e31a..3b60c09 100644 --- a/config/app.php +++ b/config/app.php @@ -80,7 +80,7 @@ return [ | */ - 'locale' => 'en', + 'locale' => 'it', /* |-------------------------------------------------------------------------- @@ -106,7 +106,7 @@ return [ | */ - 'faker_locale' => 'en_US', + 'faker_locale' => 'it_IT', /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2022_03_14_151214_create_documentis_table.php b/database/migrations/2022_03_14_151214_create_documentis_table.php index e0b72ce..a738800 100644 --- a/database/migrations/2022_03_14_151214_create_documentis_table.php +++ b/database/migrations/2022_03_14_151214_create_documentis_table.php @@ -20,6 +20,18 @@ class CreateDocumentisTable extends Migration $table->string('descrizione'); $table->string('filename'); }); + + /* + {issue #5} GITEA - proposta modifica + Schema::create('documentis', function (Blueprint $table) { + $table->id(); + $table->timestamps(); + $table->string('entita'); + $table->bigInteger('entita_id'); + $table->string('descrizione'); + $table->string('filename'); + }); + */ } /** diff --git a/database/migrations/2023_07_27_083822_create_contrattis_table.php b/database/migrations/2023_07_27_083822_create_contrattis_table.php new file mode 100644 index 0000000..c4901c7 --- /dev/null +++ b/database/migrations/2023_07_27_083822_create_contrattis_table.php @@ -0,0 +1,42 @@ +id(); + $table->timestamps(); + $table->string('numero', 100)->nullable(); + $table->string('nome', 100); + $table->date('datainizio'); + $table->date('datatermine'); + $table->string('fornitore', 100)->default('text'); + $table->string('tipo', 100)->default('utenze'); + $table->decimal('importo', 5, 2); + $table->date('scadenzapagamento'); + $table->string('stato', 100)->default('attivo'); + $table->longText('note')->nullable(); + $table->string('filename',255)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('contrattis'); + } +} diff --git a/public/js/app/contratti.js b/public/js/app/contratti.js new file mode 100644 index 0000000..8c8feb8 --- /dev/null +++ b/public/js/app/contratti.js @@ -0,0 +1,10 @@ +$('#contratti').DataTable({ + responsive: true, + fields: [ + { + label:"Data", + type: "datetime" + } + ] +}); +$(".draggable").draggable(); \ No newline at end of file diff --git a/public/js/app/dashboard.js b/public/js/app/dashboard.js index a016277..f979658 100644 --- a/public/js/app/dashboard.js +++ b/public/js/app/dashboard.js @@ -1,16 +1,8 @@ $(document).ready(function() { - $('#categorie').DataTable({ - responsive: true - }); - // Reload del div - /* - $.ajaxSetup({ cache: false }); - setInterval(function() { - $('#mieitask').load('/admin'); - }, 8000); - */ -}); +}); +// Rende spostabili le varie finestre +$(".draggable").draggable(); diff --git a/public/js/app/movimenti.js b/public/js/app/movimenti.js index 3364fc8..b5e5461 100644 --- a/public/js/app/movimenti.js +++ b/public/js/app/movimenti.js @@ -11,6 +11,8 @@ $(document).ready(function() { }); }); +$(".draggable").draggable(); + var d = new Date(); var month = d.getMonth()+1; diff --git a/public/js/app/task.js b/public/js/app/task.js index 5219114..7efb0c7 100644 --- a/public/js/app/task.js +++ b/public/js/app/task.js @@ -10,7 +10,7 @@ $(document).ready(function() { "order": [[0, "desc"]] }); }); - +$(".draggable").draggable(); var d = new Date(); var month = d.getMonth()+1; diff --git a/resources/views/admin.blade.php b/resources/views/admin.blade.php index c962c1d..85f6d1a 100644 --- a/resources/views/admin.blade.php +++ b/resources/views/admin.blade.php @@ -95,20 +95,21 @@ - - + + - + + - + @section('script') diff --git a/resources/views/components/menu.blade.php b/resources/views/components/menu.blade.php index 1c6dccd..231dab8 100644 --- a/resources/views/components/menu.blade.php +++ b/resources/views/components/menu.blade.php @@ -21,7 +21,13 @@ -@endcan @can('consumi') +@endcan +@can('contratti') +
  • + Contratti +
  • +@endcan +@can('consumi')
  • Consumi @@ -31,7 +37,8 @@
  • Energia Elettrica
  • - + + @endcan @can('automobili')
  • Automobili
  • diff --git a/resources/views/conti/documenti/insert.blade.php b/resources/views/conti/documenti/insert.blade.php index c1a39a3..8dc7f8a 100644 --- a/resources/views/conti/documenti/insert.blade.php +++ b/resources/views/conti/documenti/insert.blade.php @@ -21,6 +21,10 @@
    +
    diff --git a/resources/views/conti/movimenti/list.blade.php b/resources/views/conti/movimenti/list.blade.php index e4dc930..dc7f7d9 100644 --- a/resources/views/conti/movimenti/list.blade.php +++ b/resources/views/conti/movimenti/list.blade.php @@ -59,9 +59,9 @@ -