This commit is contained in:
Azfar Arsyad
2021-12-16 16:52:18 +08:00
parent 7fb6ef3f63
commit 7fa0621b06
32 changed files with 1423 additions and 64 deletions
@@ -0,0 +1,148 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSimulasisTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('simulasi', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('tarikh_lelong');
$table->time('masatamat_lelong')->nullable();
$table->string('kali')->nullable();
$table->string('harga_emas_asas');
$table->string('jbg');
$table->integer('cajlelong');
$table->timestamps();
});
Schema::create('cawangan_simulasi', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('simulasi_id')->unsigned();
$table->unsignedBigInteger('caw_id')->unsigned();
$table->string('online');
$table->string('export_data_sts')->nullable();
$table->string('import_data_sts')->nullable();
$table->date('export_data_stsdate')->nullable();
$table->date('import_data_sts_date')->nullable();
$table->string('lokasi');
$table->timestamps();
$table->foreign('caw_id')
->references('id')->on('cawangan')
->onDelete('cascade');
$table->foreign('simulasi_id')
->references('id')->on('simulasi')
->onDelete('cascade');
});
Schema::create('simulasibid', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('caw_id')->unsigned();
$table->string('kodcaw');
$table->string('norujukan');
$table->date('t_lelong');
$table->decimal('hargaasas', $precision = 9, $scale = 2);
$table->decimal('hargajual', $precision = 9, $scale = 2);
$table->date('t_jual');
$table->integer('nopembeli');
$table->decimal('jbg', $precision = 7, $scale = 2);
$table->decimal('kadarupah', $precision = 5, $scale = 2);
$table->decimal('upahsimpan', $precision = 11, $scale = 2);
$table->decimal('ansuran', $precision = 11, $scale = 2);
$table->decimal('nilaimarhun', $precision = 9, $scale = 2);
$table->decimal('pinjaman', $precision = 9, $scale = 2);
$table->decimal('bakiupah', $precision = 7, $scale = 2);
$table->decimal('cajlain', $precision = 7, $scale = 2);
$table->decimal('cajlelong', $precision = 7, $scale = 2);
$table->decimal('baki', $precision = 9, $scale = 2);
$table->decimal('berat', $precision = 7, $scale = 2);
$table->string('marhun');
$table->decimal('gst_hj', $precision = 7, $scale = 2);
$table->decimal('gst_cl', $precision = 7, $scale = 2);
$table->decimal('percent', $precision = 7, $scale = 2);
$table->integer('status_jual');
$table->integer('status_payment');
$table->integer('mora_upah');
$table->timestamps();
$table->foreign('caw_id')
->references('id')->on('cawangan')
->onDelete('cascade');
});
Schema::create('simulasibidmarhun', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('simulasibid_id')->unsigned();
$table->decimal('bil', $precision = 3, $scale = 0);
$table->string('marhun');
$table->string('nota');
$table->string('karat');
$table->decimal('berat', $precision = 7, $scale = 2);
$table->decimal('harga', $precision = 5, $scale = 2);
$table->decimal('n_marhun', $precision = 9, $scale = 2);
$table->decimal('hargaasas', $precision = 11, $scale = 2);
$table->timestamps();
$table->foreign('simulasibid_id')
->references('id')->on('simulasibid')
->onDelete('cascade');
});
Schema::create('simkarat', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('simulasi_id')->unsigned();
$table->string('karat');
$table->string('keterangan');
$table->decimal('harga', $precision = 5, $scale = 2)->nullable();
$table->decimal('harga2', $precision = 5, $scale = 2)->nullable();
$table->timestamps();
$table->foreign('simulasi_id')
->references('id')->on('simulasi')
->onDelete('cascade');
});
Schema::create('simkarat_temp', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('simulasi_id')->unsigned();
$table->string('karat');
$table->string('keterangan');
$table->decimal('harga', $precision = 5, $scale = 2);
$table->decimal('harga2', $precision = 5, $scale = 2);
$table->timestamps();
$table->foreign('simulasi_id')
->references('id')->on('simulasi')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('simulasi');
Schema::dropIfExists('cawangan_simulasi');
Schema::dropIfExists('simulasibid');
Schema::dropIfExists('simulasibidmarhun');
Schema::dropIfExists('simkarat');
Schema::dropIfExists('simkarat_temp');
}
}
@@ -0,0 +1,144 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLelongsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('lelong', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('tarikh_lelong');
$table->time('masatamat_lelong')->nullable();
$table->string('kali')->nullable();
$table->string('harga_emas_asas');
$table->string('jbg');
$table->integer('cajlelong');
$table->timestamps();
});
Schema::create('cawangan_lelong', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->unsignedBigInteger('caw_id')->unsigned();
$table->string('online');
$table->string('export_data_sts')->nullable();
$table->string('import_data_sts')->nullable();
$table->date('export_data_stsdate')->nullable();
$table->date('import_data_sts_date')->nullable();
$table->string('lokasi');
$table->timestamps();
$table->foreign('caw_id')
->references('id')->on('cawangan')
->onDelete('cascade');
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
});
Schema::create('lelongbid', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('caw_id')->unsigned();
$table->string('kodcaw');
$table->string('norujukan');
$table->date('t_lelong');
$table->decimal('hargaasas', $precision = 9, $scale = 2);
$table->decimal('hargajual', $precision = 9, $scale = 2);
$table->date('t_jual');
$table->integer('nopembeli');
$table->decimal('jbg', $precision = 7, $scale = 2);
$table->decimal('kadarupah', $precision = 5, $scale = 2);
$table->decimal('upahsimpan', $precision = 11, $scale = 2);
$table->decimal('ansuran', $precision = 11, $scale = 2);
$table->decimal('nilaimarhun', $precision = 9, $scale = 2);
$table->decimal('pinjaman', $precision = 9, $scale = 2);
$table->decimal('bakiupah', $precision = 7, $scale = 2);
$table->decimal('cajlain', $precision = 7, $scale = 2);
$table->decimal('cajlelong', $precision = 7, $scale = 2);
$table->decimal('baki', $precision = 9, $scale = 2);
$table->decimal('berat', $precision = 7, $scale = 2);
$table->string('marhun');
$table->decimal('gst_hj', $precision = 7, $scale = 2);
$table->decimal('gst_cl', $precision = 7, $scale = 2);
$table->decimal('percent', $precision = 7, $scale = 2);
$table->string('status_jual');
$table->string('status_payment');
$table->string('mora_upah');
$table->timestamps();
$table->foreign('caw_id')
->references('id')->on('cawangan')
->onDelete('cascade');
});
Schema::create('lelongbidmarhun', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('lelongbid_id')->unsigned();
$table->decimal('bil', $precision = 3, $scale = 0);
$table->string('marhun');
$table->string('nota');
$table->string('karat');
$table->decimal('berat', $precision = 7, $scale = 2);
$table->decimal('harga', $precision = 5, $scale = 2);
$table->decimal('n_marhun', $precision = 9, $scale = 2);
$table->decimal('hargaasas', $precision = 11, $scale = 2);
$table->timestamps();
$table->foreign('lelongbid_id')
->references('id')->on('lelongbid')
->onDelete('cascade');
});
Schema::create('lelkarat', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->string('karat');
$table->string('keterangan');
$table->decimal('harga', $precision = 5, $scale = 2)->nullable();
$table->decimal('harga2', $precision = 5, $scale = 2)->nullable();
$table->timestamps();
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
});
Schema::create('lelkarat_temp', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->string('karat');
$table->string('keterangan');
$table->decimal('harga', $precision = 5, $scale = 2);
$table->decimal('harga2', $precision = 5, $scale = 2);
$table->timestamps();
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('lelong');
Schema::dropIfExists('cawangan_lelong');
Schema::dropIfExists('lelongbid');
Schema::dropIfExists('lelongbidmarhun');
Schema::dropIfExists('lelkarat');
Schema::dropIfExists('lelkarat_temp');
}
}
@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateJenisEmasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jenisemas', function (Blueprint $table) {
$table->id();
$table->string('marhun');
$table->string('descpt');
$table->integer('ordernum');
$table->timestamps();
});
Schema::create('jeniskarat', function (Blueprint $table) {
$table->id();
$table->string('karat');
$table->string('keterangan');
$table->decimal('dariharga916', $precision = 5, $scale = 2);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jenisemas');
Schema::dropIfExists('jeniskarat');
}
}
+2
View File
@@ -14,5 +14,7 @@ class DatabaseSeeder extends Seeder
public function run()
{
$this->call(RolesSeeder::class);
$this->call(JenisEmasSeeder::class);
$this->call(KaratSeeder::class);
}
}
+103
View File
@@ -0,0 +1,103 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\JenisEmas;
class JenisEmasSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
JenisEmas::create([
'marhun' => 'G/T',
'descpt' => 'Gelang Tangan',
'ordernum' => 1,
]);
JenisEmas::create([
'marhun' => 'R/T',
'descpt' => 'Rantai Tangan',
'ordernum' => 2,
]);
JenisEmas::create([
'marhun' => 'R/L',
'descpt' => 'Rantai Leher',
'ordernum' => 3,
]);
JenisEmas::create([
'marhun' => 'R/K',
'descpt' => 'Rantai Kaki',
'ordernum' => 4,
]);
JenisEmas::create([
'marhun' => 'CIN',
'descpt' => 'Cincin',
'ordernum' => 5,
]);
JenisEmas::create([
'marhun' => 'SBG',
'descpt' => 'Subang',
'ordernum' => 6,
]);
JenisEmas::create([
'marhun' => 'L/L',
'descpt' => 'Lain-lain',
'ordernum' => 7,
]);
JenisEmas::create([
'marhun' => 'LKT',
'descpt' => 'Loket',
'ordernum' => 8,
]);
JenisEmas::create([
'marhun' => 'K/B',
'descpt' => 'Kacing Baju',
'ordernum' => 9,
]);
JenisEmas::create([
'marhun' => 'DNR',
'descpt' => 'Dinar',
'ordernum' => 10,
]);
JenisEmas::create([
'marhun' => 'SYE',
'descpt' => 'Syiling Emas',
'ordernum' => 11,
]);
JenisEmas::create([
'marhun' => 'WFR',
'descpt' => 'Wafer Emas',
'ordernum' => 12,
]);
JenisEmas::create([
'marhun' => 'G/B',
'descpt' => 'Gold Bar',
'ordernum' => 13,
]);
JenisEmas::create([
'marhun' => 'SPE',
'descpt' => 'Serpihan Emas',
'ordernum' => 14,
]);
}
}
+86
View File
@@ -0,0 +1,86 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\JenisKarat;
class KaratSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
JenisKarat::create([
'karat' => '24.0Kgb',
'keterangan' => '999.00 Gold Bar',
'dariharga916' => 35
]);
JenisKarat::create([
'karat' => '24.0K',
'keterangan' => '999.00',
'dariharga916' => 30
]);
JenisKarat::create([
'karat' => '23.0K',
'keterangan' => '950.00',
'dariharga916' => 3
]);
JenisKarat::create([
'karat' => '22.0K',
'keterangan' => '916.00',
'dariharga916' => 0
]);
JenisKarat::create([
'karat' => '21.0K',
'keterangan' => '900.00',
'dariharga916' => -25
]);
JenisKarat::create([
'karat' => '20.0K',
'keterangan' => '835.00',
'dariharga916' => -60
]);
JenisKarat::create([
'karat' => '18.0Kp',
'keterangan' => '750.00 putih',
'dariharga916' => -125
]);
JenisKarat::create([
'karat' => '18.0K',
'keterangan' => '750.00',
'dariharga916' => -125
]);
JenisKarat::create([
'karat' => '14.0Kp',
'keterangan' => '585.00 putih',
'dariharga916' => -252
]);
JenisKarat::create([
'karat' => '14.0K',
'keterangan' => '585.00',
'dariharga916' => -252
]);
JenisKarat::create([
'karat' => '9.0K',
'keterangan' => '375.00',
'dariharga916' => -380
]);
}
}
+1
View File
@@ -141,6 +141,7 @@ class RolesSeeder extends Seeder
$role5->givePermissionTo('pendaftaranbatch');
$role6->givePermissionTo('report');
$role6->givePermissionTo('tangguhan');
$role6->givePermissionTo('analisa');
$role7 = Role::create(['name' => 'account']);
$role7->givePermissionTo('pengesahanbayaran');