|
|
@@ -0,0 +1,38 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+use Illuminate\Database\Migrations\Migration;
|
|
|
+use Illuminate\Database\Schema\Blueprint;
|
|
|
+use Illuminate\Support\Facades\Schema;
|
|
|
+
|
|
|
+return new class extends Migration
|
|
|
+{
|
|
|
+ public function up(): void
|
|
|
+ {
|
|
|
+ Schema::create('franchisee_account_receives', function (Blueprint $table) {
|
|
|
+ $table->id();
|
|
|
+ $table->foreignId('unit_id')->constrained('units');
|
|
|
+ $table->foreignId('tbr_calculation_id')->constrained('tbr_calculations');
|
|
|
+ $table->unsignedInteger('order')->nullable();
|
|
|
+ $table->string('history', 255);
|
|
|
+ $table->decimal('value', 10, 2);
|
|
|
+ $table->decimal('paid_value', 10, 2)->default(0);
|
|
|
+ $table->date('due_date');
|
|
|
+ $table->decimal('discount', 10, 2)->default(0);
|
|
|
+ $table->decimal('fees', 10, 2)->default(0);
|
|
|
+ $table->string('obs', 255)->nullable();
|
|
|
+ $table->string('asaas_id', 100)->nullable();
|
|
|
+ $table->string('status', 30)->default('pending');
|
|
|
+ $table->timestamps();
|
|
|
+ $table->softDeletes();
|
|
|
+
|
|
|
+ $table->index('unit_id');
|
|
|
+ $table->index('tbr_calculation_id');
|
|
|
+ $table->index('due_date');
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ public function down(): void
|
|
|
+ {
|
|
|
+ Schema::dropIfExists('franchisee_account_receives');
|
|
|
+ }
|
|
|
+};
|