From 7fa0621b0610de808cc5058d38c8bbef1a799fd8 Mon Sep 17 00:00:00 2001 From: Azfar Arsyad <45238748+Arpax17@users.noreply.github.com> Date: Thu, 16 Dec 2021 16:52:18 +0800 Subject: [PATCH] latest --- app/Http/Controllers/SimulasiController.php | 223 ++++++++++++++++++ app/Models/CawanganLelong.php | 24 ++ app/Models/CawanganSimulasi.php | 25 ++ app/Models/JenisEmas.php | 19 ++ app/Models/JenisKarat.php | 19 ++ app/Models/LelKarat.php | 21 ++ app/Models/LelKarat_temp.php | 23 ++ app/Models/Lelong.php | 22 ++ app/Models/LelongBid.php | 41 ++++ app/Models/LelongBidMarhun.php | 25 ++ app/Models/SimKarat.php | 21 ++ app/Models/SimKarat_temp.php | 22 ++ app/Models/Simulasi.php | 22 ++ app/Models/SimulasiBid.php | 41 ++++ app/Models/SimulasiBidMarhun.php | 25 ++ config/database.php | 20 ++ ...21_12_14_041545_create_simulasis_table.php | 148 ++++++++++++ ...2021_12_14_041557_create_lelongs_table.php | 144 +++++++++++ ...1_12_15_020747_create_jenis_emas_table.php | 43 ++++ database/seeders/DatabaseSeeder.php | 2 + database/seeders/JenisEmasSeeder.php | 103 ++++++++ database/seeders/KaratSeeder.php | 86 +++++++ database/seeders/RolesSeeder.php | 1 + resources/views/includes/sidebar.blade.php | 7 +- .../pengurusandatabase/senaraidb.blade.php | 16 +- .../views/pengurusanpengguna/index.blade.php | 16 +- .../views/pengurusanpengguna/roles.blade.php | 17 +- .../views/pengurusanpengguna/taraf.blade.php | 19 +- .../views/simulasi/janasimulasi.blade.php | 25 +- .../views/simulasi/senaraisimulasi.blade.php | 125 ++++++++++ .../views/simulasi/showsimulasi.blade.php | 130 ++++++++++ routes/web.php | 12 +- 32 files changed, 1423 insertions(+), 64 deletions(-) create mode 100644 app/Models/CawanganLelong.php create mode 100644 app/Models/CawanganSimulasi.php create mode 100644 app/Models/JenisEmas.php create mode 100644 app/Models/JenisKarat.php create mode 100644 app/Models/LelKarat.php create mode 100644 app/Models/LelKarat_temp.php create mode 100644 app/Models/Lelong.php create mode 100644 app/Models/LelongBid.php create mode 100644 app/Models/LelongBidMarhun.php create mode 100644 app/Models/SimKarat.php create mode 100644 app/Models/SimKarat_temp.php create mode 100644 app/Models/Simulasi.php create mode 100644 app/Models/SimulasiBid.php create mode 100644 app/Models/SimulasiBidMarhun.php create mode 100644 database/migrations/2021_12_14_041545_create_simulasis_table.php create mode 100644 database/migrations/2021_12_14_041557_create_lelongs_table.php create mode 100644 database/migrations/2021_12_15_020747_create_jenis_emas_table.php create mode 100644 database/seeders/JenisEmasSeeder.php create mode 100644 database/seeders/KaratSeeder.php create mode 100644 resources/views/simulasi/senaraisimulasi.blade.php create mode 100644 resources/views/simulasi/showsimulasi.blade.php diff --git a/app/Http/Controllers/SimulasiController.php b/app/Http/Controllers/SimulasiController.php index 5b28d276..e236bcc3 100644 --- a/app/Http/Controllers/SimulasiController.php +++ b/app/Http/Controllers/SimulasiController.php @@ -9,6 +9,14 @@ use Illuminate\Support\Facades\Auth; use App\Models\User; use PDF; use App\Models\Cawangan; +use App\Models\Simulasi; +use App\Models\SimulasiBid; +use App\Models\SimulasiBidMarhun; +use App\Models\SimKarat; +use App\Models\SimKarat_temp; +use App\Models\CawanganSimulasi; +use App\Models\JenisEmas; +use App\Models\JenisKarat; class SimulasiController extends Controller { @@ -32,6 +40,221 @@ class SimulasiController extends Controller $caw = Cawangan::all(); return view('simulasi.janasimulasi',compact('caw')); } + + public function janadata(Request $request) + { + + $cawangan = Cawangan::all(); + + //create simulasi + $simulasi = new Simulasi; + $simulasi->tarikh_lelong = $request->tarikh_lelong; + $simulasi->harga_emas_asas = $request->hargaasas; + $simulasi->jbg = $request->jbg; + $simulasi->cajlelong = $request->cajlelong; + $simulasi->save(); + + //create harga asas berdasarkan input harga asas + $karat = JenisKarat::all(); + $hargaasas = $request->hargaasas; //rial + foreach($karat as $item) + { + $simkarat = new SimKarat; + $simkarat->simulasi_id = $simulasi->id; + $simkarat->karat = $item->karat; + $simkarat->keterangan = $item->keterangan; + $simkarat->harga = ($hargaasas + ($item->dariharga916))/2.72; //gram + $simkarat->harga2 = $hargaasas + ($item->dariharga916); //rial + $simkarat->save(); + } + + + // join cawangan yang terlibat dengan simulasi + if($request->caw && $request->caw == 'all') + { + foreach($cawangan as $key=>$caw) + { + + $caw_simulasi = new CawanganSimulasi; + $caw_simulasi->simulasi_id = $simulasi->id; + $caw_simulasi->caw_id = $caw->id; + $caw_simulasi->online = 'Online'; + $caw_simulasi->lokasi = $caw->lokasi; + $caw_simulasi->save(); + + $simulasibid = SimulasiBid::where('caw_id','=',$caw->id)->get(); + foreach($simulasibid as $data) + { + + $sumhargaasas = 0; + $berat = 0; + $simulasibidmarhun = SimulasiBidMarhun::where('simulasibid_id','=',$data->id)->get(); + foreach($simulasibidmarhun as $marhun) + { + $simkarat = SimKarat::where('simulasi_id','=',$simulasi->id)->get(); + // dd($simkarat); + foreach($simkarat as $karat) + { + + if($karat->karat == $marhun->karat) + { + // dd($karat); + $val = round($marhun->berat * $karat->harga); + $sumhargaasas = $sumhargaasas + $val; + $berat = $berat + $marhun->berat; + + $marhun->harga = $karat->harga; + $marhun->n_marhun = $marhun->berat * $karat->harga; + $marhun->hargaasas = floatval(number_format($val,2)); + $marhun->save(); + } + } + + + } + + $calcaj = ($request->cajlelong/100)*$sumhargaasas; + $data->hargaasas = $sumhargaasas; + $data->cajlelong = $calcaj; + $data->baki = $sumhargaasas-$data->pinjaman - $data->bakiupah - $calcaj; + $data->berat = $berat; + $data->save(); + } + } + } + elseif($request->caw && $request->caw != 'all') + { + $caw_simulasi = new CawanganSimulasi; + $caw_simulasi->simulasi_id = $simulasi->id; + $caw_simulasi->caw_id = $request->caw; + $caw_simulasi->online = 'Online'; + $caw_simulasi->lokasi = $caw->lokasi; + $caw_simulasi->save(); + + $simulasibid = SimulasiBid::where('caw_id','=',$request->caw)->get(); + foreach($simulasibid as $data) + { + + $sumhargaasas = 0; + $berat = 0; + $simulasibidmarhun = SimulasiBidMarhun::where('simulasibid_id','=',$data->id)->get(); + foreach($simulasibidmarhun as $marhun) + { + $simkarat = SimKarat::where('simulasi_id','=',$simulasi->id)->get(); + // dd($simkarat); + foreach($simkarat as $karat) + { + + if($karat->karat == $marhun->karat) + { + // dd($karat); + $val = round($marhun->berat * $karat->harga); + $sumhargaasas = $sumhargaasas + $val; + $berat = $berat + $marhun->berat; + + $marhun->harga = $karat->harga; + $marhun->n_marhun = $marhun->berat * $karat->harga; + $marhun->hargaasas = floatval(number_format($val,2)); + $marhun->save(); + } + } + + + } + + $calcaj = ($request->cajlelong/100)*$sumhargaasas; + $data->hargaasas = $sumhargaasas; + $data->cajlelong = $calcaj; + $data->baki = $sumhargaasas-$data->pinjaman - $data->bakiupah - $calcaj; + $data->berat = $berat; + $data->save(); + } + } + else + { + dd('error'); + } + + + + return redirect()->route('analisa.showsimulasi',$simulasi->id); + } + + public function senaraisimulasi() + { + $simulasi = Simulasi::all(); + + return view('simulasi.senaraisimulasi',compact('simulasi')); + } + + public function showsimulasi($id) + { + $simulasi = Simulasi::where('id','=',$id)->first(); + $cawangansim = CawanganSimulasi::where('simulasi_id','=',$id)->get(); + + $arraydata = []; + $arraycaw = []; + foreach($cawangansim as $cawsim) + { + $cawangan = Cawangan::where('id','=',$cawsim->caw_id)->first(); + $databid = SimulasiBid::where('caw_id','=',$cawsim->caw_id)->get(); + + $packet = 0; + $berat = 0; + $nilai_marhun = 0; + $pinjaman =0; + $upah = 0; + $hargaasas = 0; + $cajlelong = 0; + $rugilelong = 0; + $bakilelong = 0; + + foreach($databid as $bid) + { + $marhun = SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)->get(); + $packet = $packet + count($marhun); + $berat = $berat + $bid->berat; + $nilai_marhun = $nilai_marhun + ($marhun->sum('n_marhun')); + $pinjaman =$pinjaman + $bid->pinjaman; + // $upah = $upah + $bid->upah; + $hargaasas = $hargaasas + $bid->hargaasas; + $cajlelong = $cajlelong + $bid->cajlelong; + // $rugilelong = $berat + $bid->berat; + $bakilelong = $bakilelong + $bid->baki; + } + + + array_push($arraycaw,[ + 'cawangan'=>$cawangan->caw_name, + 't_lelong'=>$simulasi->tarikh_lelong, + 'bil_marhun'=>$packet, + 'berat'=>$berat, + 'n_marhun'=>$nilai_marhun, + 'pinjaman'=>$pinjaman, + 'upah'=>0, + 'hargaasas'=>$hargaasas, + 'cajlelong'=>$cajlelong, + 'rugilelong'=>0, + 'bakilelong'=>$bakilelong, + ]); + // dd($arraycaw); + // array_push($arraydata, $arraycaw); + } + + // dd($arraycaw); + // ->where('id','=',$id)- + + return view('simulasi.showsimulasi',compact('arraycaw')); + } + + public function deletesim($id) + { + $role = Simulasi::where('id','=',$id)->first(); + // dd($role); + $role->delete(); + return redirect()->route('analisa.senaraisimulasi') + ->with('success','Padam Simulasi Berjaya'); + } } \ No newline at end of file diff --git a/app/Models/CawanganLelong.php b/app/Models/CawanganLelong.php new file mode 100644 index 00000000..d7f8edfa --- /dev/null +++ b/app/Models/CawanganLelong.php @@ -0,0 +1,24 @@ + [ + 'driver' => 'mysql', + 'url' => env('DATABASE_URL'), + 'host' => '127.0.0.1', + 'port' => '3306', + 'database' => 'name', + 'username' => 'username', + 'password' => "password", + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + 'pgsql' => [ 'driver' => 'pgsql', 'url' => env('DATABASE_URL'), diff --git a/database/migrations/2021_12_14_041545_create_simulasis_table.php b/database/migrations/2021_12_14_041545_create_simulasis_table.php new file mode 100644 index 00000000..f3de9a9f --- /dev/null +++ b/database/migrations/2021_12_14_041545_create_simulasis_table.php @@ -0,0 +1,148 @@ +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'); + } +} diff --git a/database/migrations/2021_12_14_041557_create_lelongs_table.php b/database/migrations/2021_12_14_041557_create_lelongs_table.php new file mode 100644 index 00000000..8a31b48c --- /dev/null +++ b/database/migrations/2021_12_14_041557_create_lelongs_table.php @@ -0,0 +1,144 @@ +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'); + } +} diff --git a/database/migrations/2021_12_15_020747_create_jenis_emas_table.php b/database/migrations/2021_12_15_020747_create_jenis_emas_table.php new file mode 100644 index 00000000..76a93b40 --- /dev/null +++ b/database/migrations/2021_12_15_020747_create_jenis_emas_table.php @@ -0,0 +1,43 @@ +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'); + } +} diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 58bc190d..81e890b4 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -14,5 +14,7 @@ class DatabaseSeeder extends Seeder public function run() { $this->call(RolesSeeder::class); + $this->call(JenisEmasSeeder::class); + $this->call(KaratSeeder::class); } } diff --git a/database/seeders/JenisEmasSeeder.php b/database/seeders/JenisEmasSeeder.php new file mode 100644 index 00000000..6b84aa58 --- /dev/null +++ b/database/seeders/JenisEmasSeeder.php @@ -0,0 +1,103 @@ + '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, + ]); + + + } +} diff --git a/database/seeders/KaratSeeder.php b/database/seeders/KaratSeeder.php new file mode 100644 index 00000000..ce150d70 --- /dev/null +++ b/database/seeders/KaratSeeder.php @@ -0,0 +1,86 @@ + '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 + ]); + + + + } +} diff --git a/database/seeders/RolesSeeder.php b/database/seeders/RolesSeeder.php index a9284cc1..495f009d 100644 --- a/database/seeders/RolesSeeder.php +++ b/database/seeders/RolesSeeder.php @@ -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'); diff --git a/resources/views/includes/sidebar.blade.php b/resources/views/includes/sidebar.blade.php index eb57eb1e..c364e6d8 100644 --- a/resources/views/includes/sidebar.blade.php +++ b/resources/views/includes/sidebar.blade.php @@ -63,10 +63,13 @@ @endhasrole @hasrole('operasi')