User Order all Margins / Checkout

This commit is contained in:
Kevin Adametz 2021-01-22 15:54:51 +01:00
parent a96d7d5c77
commit 224bf9e951
92 changed files with 3551 additions and 561 deletions

View file

@ -21,6 +21,8 @@ class CreateUserLevelsTable extends Migration
$table->text('content')->nullable();
$table->text('trans_content')->nullable();
$table->boolean('partner_provision')->default(false);
$table->tinyInteger('pos')->unsigned()->nullable();
$table->boolean('active')->default(false);

View file

@ -61,7 +61,12 @@ class CreateProductsTable extends Migration
$table->tinyInteger('show_at')->unsigned()->nullable()->default(0);
$table->boolean('shipping_addon')->default(false);
$table->tinyInteger('amount_commission')->unsigned()->nullable()->default(0);
$table->boolean('single_commission')->default(false);
$table->decimal('value_commission', 5, 2)->nullable();
$table->decimal('partner_commission', 5, 2)->nullable();
$table->string('identifier', 20)->nullable();
$table->string('action')->nullable();

View file

@ -19,6 +19,8 @@ class CreatePaymentMethodsTable extends Migration
$table->string('short', 10);
$table->unsignedTinyInteger('show_at')->nullable()->default(0);
$table->unsignedTinyInteger('pos')->nullable()->default(0);
$table->decimal('max_price', 8, 2)->nullable();
$table->boolean('active')->default(false);
$table->boolean('default')->default(false);

View file

@ -26,13 +26,19 @@ class CreateShoppingOrdersTable extends Migration
$table->unsignedTinyInteger('payment_for')->nullable();
$table->decimal('total', 13, 2)->nullable();
$table->decimal('subtotal_full', 13, 2)->nullable();
$table->decimal('discount', 13, 2)->nullable();
$table->decimal('subtotal', 13, 2)->nullable();
$table->decimal('shipping', 8, 2)->nullable();
$table->decimal('shipping_net', 8, 2)->nullable();
$table->decimal('subtotal_ws', 13, 2)->nullable();
$table->decimal('subtotal_shipping', 13, 2)->nullable();
$table->decimal('tax', 8, 2)->nullable();
$table->decimal('total_without_credit', 13, 2)->nullable();
$table->decimal('payment_credit', 13, 2)->nullable();
$table->decimal('total_shipping', 13, 2)->nullable();
$table->unsignedInteger('points')->nullable();
@ -47,7 +53,6 @@ class CreateShoppingOrdersTable extends Migration
$table->unsignedTinyInteger('shipped')->default(0);
$table->string('tracking', 255)->nullable();
$table->char('mode', 4)->nullable();
$table->timestamps();

View file

@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserLevelMarginsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_level_margins', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('user_level_id');
$table->decimal('price_from', 8, 2)->nullable();
//$table->decimal('price_to', 8, 2)->nullable();
$table->decimal('trading_margin', 5, 2)->nullable();
$table->decimal('commission', 5, 2)->nullable();
$table->timestamps();
$table->foreign('user_level_id')
->references('id')
->on('user_levels')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_level_margins');
}
}

View file

@ -0,0 +1,64 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateShoppingOrderMarginsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shopping_order_margins', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('shopping_order_id');
$table->unsignedInteger('user_id');
$table->decimal('net_price', 13, 2)->nullable();
$table->decimal('net_discount', 13, 2)->nullable();
$table->decimal('net_amount', 13, 2)->nullable();
$table->decimal('from_payment_credit', 13, 2)->nullable();
$table->unsignedInteger('m_sponsor_id')->nullable();
$table->decimal('net_partner_commission', 13, 2)->nullable();
$table->date('from')->nullable();
$table->boolean('paid')->default(false);
$table->boolean('cancellation')->default(false);
$table->unsignedTinyInteger('status')->index()->default(0);
$table->text('content')->nullable();
$table->timestamps();
$table->foreign('shopping_order_id')
->references('id')
->on('shopping_orders');
$table->foreign('user_id')
->references('id')
->on('users');
$table->foreign('m_sponsor_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shopping_order_margins');
}
}