mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
9ed67e74e2
- Supplier (AP) - PO - DO - INV - Customer (AR) - PO - DO - INV
64 lines
2.3 KiB
PHP
64 lines
2.3 KiB
PHP
<?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');
|
|
}
|
|
}
|