Fix payment migration

This commit is contained in:
Amir
2022-11-04 22:16:46 +08:00
parent 5501cf1338
commit 3d614dd677
6 changed files with 66 additions and 49 deletions
@@ -13,18 +13,69 @@ class CreatePaymentTable extends Migration
*/
public function up()
{
Schema::create('invoice', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->string('invoice_no')->nullable();
$table->decimal('total_invoice', $precision = 11, $scale = 2);
$table->string('invoice_type'); // 1 = fee , 2 = bid
$table->string('status')->nullable(); //status => 1 = paid , 2 = pending
$table->string('opencash')->nullable()->default(0);
$table->timestamp('paid_at')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
});
Schema::create('resit', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->string('reference_no')->nullable();
$table->unsignedBigInteger('invoice_id')->unsigned();
$table->string('invoice_no')->nullable();
$table->string('billplz_id');
$table->decimal('total_payment', $precision = 11, $scale = 2);
$table->string('resit_type'); // 1 = fee , 2 = bid
$table->string('status')->nullable(); //status => 1 = paid , 2 = pending
$table->timestamp('paid_at')->nullable();
$table->timestamps();
$table->foreign('invoice_id')
->references('id')->on('invoice')
->onDelete('cascade');
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
});
Schema::create('payment', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->unsignedBigInteger('lelongbid_id')->unsigned();
$table->unsignedBigInteger('resit_id')->unsigned();
$table->string('kodcaw')->nullable();
$table->integer('invoice_id')->nullable();
$table->string('norujukan')->nullable();
$table->string('back_acc_pembeli')->nullable();
$table->string('bank_acc_no_pembeli')->nullable();
$table->string('nama_bank_acc_caw')->nullable();
$table->string('bank_no_acc_caw')->nullable();
$table->integer('status_payment_opt')->nullable(); //1=kaunter,2=online,3=CDM
$table->integer('resit_id');
$table->integer('status'); //1 = fee RM10 , 2 = paybidifwin
$table->string('remark');
$table->integer('1sen')->nullable();
@@ -45,6 +96,10 @@ class CreatePaymentTable extends Migration
$table->integer('diminta_oleh')->nullable();
$table->timestamps();
$table->foreign('resit_id')
->references('id')->on('resit')
->onDelete('cascade');
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
@@ -52,6 +107,10 @@ class CreatePaymentTable extends Migration
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
$table->foreign('lelongbid_id')
->references('id')->on('lelongbid')
->onDelete('cascade');
});
Schema::create('paydenokaunter', function (Blueprint $table) {
@@ -90,50 +149,6 @@ class CreatePaymentTable extends Migration
->onDelete('cascade');
});
Schema::create('resit', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->string('reference_no')->nullable();
$table->integer('invoice_id')->nullable();
$table->string('invoice_no')->nullable();
$table->string('billplz_id');
$table->decimal('total_payment', $precision = 11, $scale = 2);
$table->string('resit_type'); // 1 = fee , 2 = bid
$table->string('status')->nullable(); //status => 1 = paid , 2 = pending
$table->timestamp('paid_at')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
});
Schema::create('invoice', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->string('invoice_no')->nullable();
$table->decimal('total_invoice', $precision = 11, $scale = 2);
$table->string('invoice_type'); // 1 = fee , 2 = bid
$table->string('status')->nullable(); //status => 1 = paid , 2 = pending
$table->string('opencash')->nullable()->default(0);
$table->timestamp('paid_at')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
});
}
/**