Merge branch 'master' into 'booking'

# Conflicts:
#   app/Classes/Modules/Companies/Services/FetchesCompany.php
#   routes/api.php
This commit is contained in:
omair saleh
2020-12-08 07:25:11 +00:00
47 changed files with 1572 additions and 31 deletions
@@ -20,7 +20,7 @@ class CreateCurrenciesTable extends Migration
$table->string('name')->nullable();
$table->string('short_code')->nullable();
$table->string('symbol')->nullable();
$table->float('selling', 20, 5)->nullable();
$table->decimal('selling', 20, 5)->nullable();
$table->timestamps();
$table->softDeletes();
});
@@ -17,7 +17,7 @@ class CreateCurrencyLogsTable extends Migration
$table->id();
$table->bigInteger('currency_id')->unsigned()->nullable();
$table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->float('selling', 20, 5)->nullable();
$table->decimal('selling', 20, 5)->nullable();
$table->bigInteger('created_by')->unsigned()->nullable();
$table->foreign('created_by')->references('id')->on('users')->onDelete('cascade');
$table->timestamps();
@@ -19,7 +19,7 @@ class CreateCompaniesWalletTable extends Migration
$table->bigInteger('company_id')->unsigned();
$table->string('code');
$table->bigInteger('currency_id')->unsigned();
$table->decimal('amount', 14, 5)->default(0.00);
$table->decimal('amount', 20, 5)->default(0.00);
$table->timestamps();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWalletTransactionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('wallet_transaction', function (Blueprint $table) {
$table->id();
$table->bigInteger('wallet_id')->unsigned();
$table->bigInteger('bill_no')->unsigned();
$table->integer('trans_type');
$table->decimal('amount', 14, 5)->default(0.00);
$table->bigInteger('currency_id')->unsigned();
$table->decimal('original_amount', 14, 5)->default(0.00);
$table->bigInteger('original_currency_id')->unsigned();
$table->decimal('currency_rate', 14, 5)->default(0.00);
$table->timestamps();
$table->foreign('wallet_id')->references('id')->on('wallets')->onDelete('cascade');
$table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->foreign('original_currency_id')->references('id')->on('currencies')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('wallet_transaction');
}
}
@@ -0,0 +1,63 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTransactionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transaction', function (Blueprint $table) {
$table->id();
$table->string('trans_type1');
$table->string('trans_type2');
$table->bigInteger('bill_no')->unsigned();
$table->decimal('amount', 14, 5)->default(0.00);
$table->decimal('original_amount', 14, 5)->default(0.00);
$table->bigInteger('currency_id')->unsigned();
$table->bigInteger('original_currency_id')->unsigned();
$table->decimal('currency_rate', 14, 5)->default(0.00);
$table->date('dt_transaction');
$table->integer('status');
$table->bigInteger('booking_id')->unsigned();
$table->bigInteger('company_id')->unsigned();
$table->timestamps();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->foreign('original_currency_id')->references('id')->on('currencies')->onDelete('cascade');
});
Schema::create('transaction_detail', function (Blueprint $table) {
$table->id();
$table->string('trans_type1');
$table->string('trans_type2');
$table->bigInteger('transaction_id')->unsigned();
$table->string('product_code');
$table->string('product_name');
$table->integer('qty')->default(0);
$table->decimal('price', 14, 5)->default(0.00);
$table->decimal('amount', 14, 5)->default(0.00);
$table->timestamps();
$table->foreign('transaction_id')->references('id')->on('transaction')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transaction');
Schema::dropIfExists('transaction_detail');
}
}