mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-28 17:03:59 +00:00
63 lines
2.3 KiB
PHP
63 lines
2.3 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateReceiptTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('receipt', 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('receipt_detail', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('trans_type1');
|
|
$table->string('trans_type2');
|
|
$table->bigInteger('receipt_id')->unsigned();
|
|
$table->bigInteger('transaction_id')->unsigned();
|
|
$table->decimal('price', 14, 5)->default(0.00);
|
|
$table->decimal('amount', 14, 5)->default(0.00);
|
|
$table->timestamps();
|
|
$table->foreign('receipt_id')->references('id')->on('receipt')->onDelete('cascade');
|
|
$table->foreign('transaction_id')->references('id')->on('transaction')->onDelete('cascade');
|
|
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('receipt');
|
|
Schema::dropIfExists('receipt_detail');
|
|
}
|
|
}
|