FabioFratini преди 9 месеца
родител
ревизия
4eb3e79bb4

+ 0 - 46
database/migrations/2025_04_08_000000_add_fields_to_receipts_rows_table.php

@@ -1,46 +0,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-return new class extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::table('receipts_rows', function (Blueprint $table) {
-            $table->decimal('aliquota_iva', 8, 2)->nullable()->after('amount');
-            $table->decimal('imponibile', 8, 2)->nullable()->after('aliquota_iva');
-            $table->decimal('imposta', 8, 2)->nullable()->after('imponibile');
-            $table->string('divisa', 10)->nullable()->after('imposta');
-            $table->integer('numero_linea')->nullable()->after('divisa');
-            $table->decimal('prezzo_unitario', 10, 2)->nullable()->after('numero_linea');
-            $table->decimal('quantita', 10, 2)->nullable()->after('prezzo_unitario');
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::table('receipts_rows', function (Blueprint $table) {
-            $table->dropColumn([
-                'aliquota_iva',
-                'imponibile',
-                'imposta',
-                'divisa',
-                'numero_linea',
-                'prezzo_unitario',
-                'quantita'
-            ]);
-        });
-    }
-};

+ 0 - 55
database/migrations/2025_04_08_000001_add_fields_and_foreign_key_to_receipts_table.php

@@ -1,55 +0,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-return new class extends Migration{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::table('receipts', function (Blueprint $table) {
-            $table->date('data_documento')->nullable()->after('date');
-            $table->string('numero_fattura')->nullable()->after('number');
-            $table->string('tipo_documento')->nullable()->after('type');
-            $table->string('BIC')->nullable()->after('tipo_documento');
-            $table->string('IBAN')->nullable()->after('BIC');
-            $table->date('data_scadenza')->nullable()->after('IBAN');
-            $table->unsignedBigInteger('bank_id')->nullable()->after('data_scadenza');
-            $table->string('condizioni_pagamento')->nullable()->after('bank_id');
-            $table->boolean('is_ricevuta')->default(false)->after('parent');
-            $table->foreign('bank_id')
-                  ->references('id')
-                  ->on('banks')
-                  ->onDelete('set null')
-                  ->onUpdate('cascade');
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::table('receipts', function (Blueprint $table) {
-            $table->dropForeign(['bank_id']);
-
-            $table->dropColumn([
-                'data_documento',
-                'numero_fattura',
-                'tipo_documento',
-                'BIC',
-                'IBAN',
-                'data_scadenza',
-                'bank_id',
-                'condizioni_pagamento'
-            ]);
-        });
-    }
-};

+ 0 - 32
database/migrations/2025_04_09_000002_fix_fields_on_receipts_table.php

@@ -1,32 +0,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-return new class extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::table('receipts', function (Blueprint $table) {
-            $table->renameColumn('data_documento', 'data_pagamento');
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::table('receipts', function (Blueprint $table) {
-            $table->renameColumn('data_pagamento', 'data_documento');
-        });
-    }
-};