DONE: request online modal from pc to operasi, operasi can edit amount; WIP: customer detail confirmation form, retest pembiayaan online, notification if required
This commit is contained in:
committed by
ISMAIL MASSERAN
parent
ac96050ed0
commit
adab98701f
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CreateModalOnlineTable extends Migration
|
||||
{
|
||||
public function getActiveDB()
|
||||
{
|
||||
$config_db = array_keys(config('database.connections'));
|
||||
|
||||
return array_filter($config_db, function ($connection) {
|
||||
try {
|
||||
if ($connection === 'mysql7') {
|
||||
return false;
|
||||
}
|
||||
DB::connection($connection)->getPdo();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
foreach ($this->getActiveDB() as $dbase) {
|
||||
if (!Schema::connection($dbase)->hasTable('modal_online')) {
|
||||
Schema::connection($dbase)->create('modal_online', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->date('tarikh');
|
||||
$table->string('kodcaw', 20);
|
||||
$table->decimal('had', 12, 2)->default(100000.00);
|
||||
$table->decimal('digunakan', 12, 2)->default(0.00);
|
||||
$table->decimal('baki', 12, 2)->default(100000.00);
|
||||
$table->decimal('tambah', 12, 2)->default(0.00);
|
||||
$table->decimal('kurang', 12, 2)->default(0.00);
|
||||
$table->timestamps();
|
||||
$table->unique(['tarikh', 'kodcaw']);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
foreach ($this->getActiveDB() as $dbase) {
|
||||
Schema::connection($dbase)->dropIfExists('modal_online');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CreateBatchPembiayaanOnlineTable extends Migration
|
||||
{
|
||||
public function getActiveDB()
|
||||
{
|
||||
$config_db = array_keys(config('database.connections'));
|
||||
|
||||
return array_filter($config_db, function ($connection) {
|
||||
try {
|
||||
if ($connection === 'mysql7') {
|
||||
return false;
|
||||
}
|
||||
DB::connection($connection)->getPdo();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
foreach ($this->getActiveDB() as $dbase) {
|
||||
if (!Schema::connection($dbase)->hasTable('batch_pembiayaan_online')) {
|
||||
Schema::connection($dbase)->create('batch_pembiayaan_online', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('batch_no', 50);
|
||||
$table->string('kodcaw', 20);
|
||||
$table->date('tarikh');
|
||||
$table->string('slot', 20)->nullable()->comment('BATCH1 / BATCH2');
|
||||
$table->integer('bilangan')->default(0);
|
||||
$table->decimal('jumlah_keseluruhan', 12, 2)->default(0.00);
|
||||
$table->string('status', 30)->default('DRAFT');
|
||||
$table->string('pc_submitted_by', 100)->nullable();
|
||||
$table->timestamp('submitted_at')->nullable();
|
||||
$table->timestamps();
|
||||
$table->index(['kodcaw', 'tarikh', 'status']);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
foreach ($this->getActiveDB() as $dbase) {
|
||||
Schema::connection($dbase)->dropIfExists('batch_pembiayaan_online');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CreatePembiayaanOnlineTable extends Migration
|
||||
{
|
||||
public function getActiveDB()
|
||||
{
|
||||
$config_db = array_keys(config('database.connections'));
|
||||
|
||||
return array_filter($config_db, function ($connection) {
|
||||
try {
|
||||
if ($connection === 'mysql7') {
|
||||
return false;
|
||||
}
|
||||
DB::connection($connection)->getPdo();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
foreach ($this->getActiveDB() as $dbase) {
|
||||
if (!Schema::connection($dbase)->hasTable('pembiayaan_online')) {
|
||||
Schema::connection($dbase)->create('pembiayaan_online', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('norujukan', 50);
|
||||
$table->string('nokp', 20);
|
||||
$table->string('nopelanggan', 50)->nullable();
|
||||
$table->string('nama_pelanggan', 150)->nullable();
|
||||
$table->string('kodcaw', 20);
|
||||
$table->decimal('pinjaman', 12, 2);
|
||||
$table->string('kodbank', 20)->nullable();
|
||||
$table->string('nama_bank', 100)->nullable();
|
||||
$table->string('noakaun', 50)->nullable();
|
||||
$table->string('nama_akaun', 150)->nullable();
|
||||
$table->unsignedBigInteger('bukti_akaun_file_id')->nullable();
|
||||
$table->unsignedBigInteger('borang_file_id')->nullable();
|
||||
$table->string('status', 30)->default('PENDING_PC');
|
||||
$table->text('reject_reason')->nullable();
|
||||
$table->string('rejected_by', 100)->nullable();
|
||||
$table->timestamp('rejected_at')->nullable();
|
||||
$table->unsignedBigInteger('batch_id')->nullable();
|
||||
$table->unsignedBigInteger('bukti_file_id')->nullable();
|
||||
$table->string('no_rujukan_bayaran', 100)->nullable();
|
||||
$table->date('tarikh_bayaran')->nullable();
|
||||
$table->timestamp('paid_at')->nullable();
|
||||
$table->string('created_by', 100)->nullable();
|
||||
$table->string('pc_submitted_by', 100)->nullable();
|
||||
$table->string('ops_by', 100)->nullable();
|
||||
$table->text('nota')->nullable();
|
||||
$table->tinyInteger('blast_sent')->default(0);
|
||||
$table->timestamps();
|
||||
$table->index(['kodcaw', 'status']);
|
||||
$table->index('norujukan');
|
||||
$table->index('batch_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
foreach ($this->getActiveDB() as $dbase) {
|
||||
Schema::connection($dbase)->dropIfExists('pembiayaan_online');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AddCaraTerimaToGadaiTable extends Migration
|
||||
{
|
||||
public function getActiveDB()
|
||||
{
|
||||
$config_db = array_keys(config('database.connections'));
|
||||
|
||||
return array_filter($config_db, function ($connection) {
|
||||
try {
|
||||
if ($connection === 'mysql7') {
|
||||
return false;
|
||||
}
|
||||
DB::connection($connection)->getPdo();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
foreach ($this->getActiveDB() as $dbase) {
|
||||
if (
|
||||
Schema::connection($dbase)->hasTable('gadai')
|
||||
&& !Schema::connection($dbase)->hasColumn('gadai', 'cara_terima')
|
||||
) {
|
||||
Schema::connection($dbase)->table('gadai', function (Blueprint $table) {
|
||||
$table->string('cara_terima', 20)->nullable()->after('pinjaman');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
foreach ($this->getActiveDB() as $dbase) {
|
||||
if (
|
||||
Schema::connection($dbase)->hasTable('gadai')
|
||||
&& Schema::connection($dbase)->hasColumn('gadai', 'cara_terima')
|
||||
) {
|
||||
Schema::connection($dbase)->table('gadai', function (Blueprint $table) {
|
||||
$table->dropColumn('cara_terima');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateRequestModalOnlineTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::connection('mysql7')->hasTable('request_modal_online')) {
|
||||
Schema::connection('mysql7')->create('request_modal_online', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('kodcaw', 20);
|
||||
$table->date('tarikh');
|
||||
$table->decimal('amaun', 12, 2);
|
||||
$table->string('dimohon_oleh', 100)->nullable();
|
||||
$table->string('status', 20)->default('PENDING');
|
||||
$table->string('diluluskan_oleh', 100)->nullable();
|
||||
$table->text('nota')->nullable();
|
||||
$table->timestamps();
|
||||
$table->index(['kodcaw', 'tarikh', 'status']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('mysql7')->dropIfExists('request_modal_online');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateArrahnFilesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Master DB (mysql7) — shared file store for CIT / permohonan / bukti pembiayaan online.
|
||||
* Matches App\ARFiles usage: data (base64), filename, type, tarikhmasa; id used as file reference.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::connection('mysql7')->hasTable('arrahn_files')) {
|
||||
Schema::connection('mysql7')->create('arrahn_files', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('files_id')->nullable()->index();
|
||||
$table->longText('data')->nullable();
|
||||
$table->string('filename', 255)->nullable();
|
||||
$table->string('type', 100)->nullable();
|
||||
$table->string('tarikhmasa', 50)->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('mysql7')->dropIfExists('arrahn_files');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddEodCloseColumnsToModalOnlineTable extends Migration
|
||||
{
|
||||
public function getActiveDB()
|
||||
{
|
||||
return array_filter(
|
||||
array_keys(config('database.connections')),
|
||||
function ($connection) {
|
||||
try {
|
||||
if ($connection === 'mysql7') {
|
||||
return false;
|
||||
}
|
||||
|
||||
DB::connection($connection)->getPdo();
|
||||
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
foreach ($this->getActiveDB() as $dbase) {
|
||||
Schema::connection($dbase)->table('modal_online', function (Blueprint $table) {
|
||||
$table->tinyInteger('ditutup')
|
||||
->default(0)
|
||||
->after('kurang');
|
||||
|
||||
$table->string('ditutup_oleh', 100)
|
||||
->nullable()
|
||||
->after('ditutup');
|
||||
|
||||
$table->timestamp('ditutup_at')
|
||||
->nullable()
|
||||
->after('ditutup_oleh');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
foreach ($this->getActiveDB() as $dbase) {
|
||||
Schema::connection($dbase)->table('modal_online', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'ditutup',
|
||||
'ditutup_oleh',
|
||||
'ditutup_at',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user