#51 Festschreiben der Points, Gutschriftenmodul

This commit is contained in:
Kevin Adametz 2022-07-29 18:18:05 +02:00
parent dfd049aaa9
commit 3f2fbd6d5b
63 changed files with 4610 additions and 971 deletions

View file

@ -58,7 +58,6 @@ class CreateHomepartyUsersTable extends Migration
$table->text('settings')->nullable();
$table->timestamps();
$table->softDeletes();
$table->timestamp('user_deleted_at')->nullable();

View file

@ -0,0 +1,95 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserBusinessesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_businesses', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedTinyInteger('month')->nullable();
$table->unsignedSmallInteger('year')->nullable();
$table->unsignedInteger('m_level_id')->nullable();
$table->unsignedInteger('m_sponsor_id')->nullable();
$table->text('sponsor')->nullable();
$table->string('m_sponsor_name')->nullable();
$table->string('user_level_name')->nullable();
$table->boolean('active_account')->default(false);
$table->date('payment_account_date')->nullable();
$table->date('active_date')->nullable();
$table->unsignedInteger('m_account')->nullable();
$table->string('email')->nullable();
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->integer('sales_volume_points')->nullable();
$table->integer('sales_volume_points_shop')->nullable();
$table->integer('sales_volume_points_sum')->nullable();
$table->decimal('sales_volume_total', 13, 2)->nullable();
$table->decimal('sales_volume_total_shop', 13, 2)->nullable();
$table->decimal('sales_volume_total_sum', 13, 2)->nullable();
$table->unsignedTinyInteger('margin')->nullable();
$table->unsignedTinyInteger('margin_shop')->nullable();
$table->decimal('commission_shop_sales', 13, 2)->nullable();
$table->unsignedSmallInteger('qual_kp')->nullable();
$table->unsignedInteger('qual_tp')->nullable();
$table->integer('total_tp')->nullable();
$table->integer('total_qual_tp')->nullable();
$table->decimal('commission_lines_total', 13, 2)->nullable();
$table->decimal('commission_shop_sales', 13, 2)->nullable();
$table->text('businessLines')->nullable();
$table->text('userItems')->nullable();
$table->text('qual_user_level')->nullable();
$table->timestamps();
/*$table->foreign('user_id')
->references('id')
->on('users');
$table->foreign('m_level')
->references('id')
->on('user_levels');
$table->foreign('m_sponsor')
->references('id')
->on('users');*/
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_businesses');
}
}

View file

@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserBusinessStructuresTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_business_structures', function (Blueprint $table) {
$table->increments('id');
$table->unsignedTinyInteger('month')->index();
$table->unsignedSmallInteger('year')->index();
$table->mediumText('structure')->nullable();
$table->text('parentless')->nullable();
$table->text('users')->nullable();
$table->boolean('completed')->default(false);
$table->unsignedTinyInteger('status')->index()->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_business_structures');
}
}

View file

@ -0,0 +1,98 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserBusinessesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_businesses', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id')->index();
$table->unsignedTinyInteger('month')->index();
$table->unsignedSmallInteger('year')->index();
$table->unsignedInteger('b_structure_id')->nullable();
$table->unsignedInteger('m_level_id')->nullable();
$table->unsignedInteger('m_sponsor_id')->nullable();
$table->text('sponsor')->nullable();
$table->string('m_sponsor_name')->nullable();
$table->string('user_level_name')->nullable();
$table->boolean('active_account')->default(false);
$table->date('payment_account_date')->nullable();
$table->date('active_date')->nullable();
$table->unsignedInteger('m_account')->nullable();
$table->string('email')->nullable();
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->integer('sales_volume_points')->nullable();
$table->integer('sales_volume_points_shop')->nullable();
$table->integer('sales_volume_points_sum')->nullable();
$table->decimal('sales_volume_total', 13, 2)->nullable();
$table->decimal('sales_volume_total_shop', 13, 2)->nullable();
$table->decimal('sales_volume_total_sum', 13, 2)->nullable();
$table->unsignedTinyInteger('margin')->nullable();
$table->unsignedTinyInteger('margin_shop')->nullable();
$table->unsignedSmallInteger('qual_kp')->nullable();
$table->unsignedInteger('qual_tp')->nullable();
$table->integer('total_tp')->nullable();
$table->integer('total_qual_tp')->nullable();
$table->decimal('commission_lines_total', 13, 2)->nullable();
$table->decimal('commission_shop_sales', 13, 2)->nullable();
$table->decimal('commission_team_total', 13, 2)->nullable();
$table->text('business_lines')->nullable();
$table->text('user_items')->nullable();
$table->text('qual_user_level')->nullable();
$table->timestamps();
$table->foreign('b_structure_id')
->references('id')
->on('user_business_structures');
/*$table->foreign('user_id')
->references('id')
->on('users');
$table->foreign('m_level')
->references('id')
->on('user_levels');
$table->foreign('m_sponsor')
->references('id')
->on('users');*/
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_businesses');
}
}

View file

@ -0,0 +1,68 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserCreditsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_credits', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedTinyInteger('month')->nullable();
$table->unsignedSmallInteger('year')->nullable();
$table->date('date')->nullable();
$table->string('full_number', 255)->nullable();
$table->unsignedInteger('number')->nullable();
$table->decimal('net', 13, 2)->nullable();
$table->decimal('tax_rate', 8, 2)->nullable();
$table->decimal('tax', 8, 2)->nullable();
$table->decimal('total', 13, 2)->nullable();
$table->boolean('taxable')->default(false);
$table->string('filename', 255)->nullable();
$table->string('dir', 100)->nullable();
$table->string('disk', 10)->nullable();
$table->text('infos')->nullable();
$table->boolean('paid_out')->default(false);
$table->date('paid_out_date')->nullable();
$table->boolean('cancellation')->default(false);
$table->unsignedInteger('cancellation_id')->nullable();
$table->date('cancellation_date')->nullable();
$table->unsignedTinyInteger('status')->index()->default(0);
$table->timestamps();
$table->softDeletes();
$table->foreign('user_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_credits');
}
}

View file

@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserCreditItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_credit_items', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedInteger('user_credit_id')->nullable();;
$table->decimal('credit', 13, 2)->nullable();
$table->text('message')->nullable();
$table->unsignedTinyInteger('status')->index()->default(0);
$table->boolean('paid')->default(false);
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users');
$table->foreign('user_credit_id')
->references('id')
->on('user_credits');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_credit_items');
}
}