From 2fe8499fbbf9631ae4c52e41a817c2b8af313ea5 Mon Sep 17 00:00:00 2001 From: KhatamNugraha Date: Mon, 4 Sep 2023 13:24:29 +0700 Subject: [PATCH] perbaikan hasil sit --- ...30_062806_update_table_signer_30082023.php | 32 +++++ ...63245_update_table_signer_300820231232.php | 32 +++++ ...63906_update_table_signer_300820231339.php | 32 +++++ Http/Controllers/KonfirmasiBankController.php | 58 +++++--- Resources/views/pages/index.blade.php | 125 ++++++++++++++++-- .../views/pages/index_fasilitas.blade.php | 66 ++++----- Resources/views/pages/index_signer.blade.php | 24 +++- .../{_system.blade.php => _root.blade.php} | 0 Routes/web.php | 7 +- 9 files changed, 310 insertions(+), 66 deletions(-) create mode 100644 Database/Migrations/2023_08_30_062806_update_table_signer_30082023.php create mode 100644 Database/Migrations/2023_08_30_063245_update_table_signer_300820231232.php create mode 100644 Database/Migrations/2023_08_30_063906_update_table_signer_300820231339.php rename Resources/views/partials/menu/{_system.blade.php => _root.blade.php} (100%) diff --git a/Database/Migrations/2023_08_30_062806_update_table_signer_30082023.php b/Database/Migrations/2023_08_30_062806_update_table_signer_30082023.php new file mode 100644 index 0000000..34451f4 --- /dev/null +++ b/Database/Migrations/2023_08_30_062806_update_table_signer_30082023.php @@ -0,0 +1,32 @@ +string('nomor_cif')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('signers', function (Blueprint $table) { + + }); + } +}; \ No newline at end of file diff --git a/Database/Migrations/2023_08_30_063245_update_table_signer_300820231232.php b/Database/Migrations/2023_08_30_063245_update_table_signer_300820231232.php new file mode 100644 index 0000000..a0a9ec8 --- /dev/null +++ b/Database/Migrations/2023_08_30_063245_update_table_signer_300820231232.php @@ -0,0 +1,32 @@ +string('keterangan')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('signers', function (Blueprint $table) { + + }); + } +}; \ No newline at end of file diff --git a/Database/Migrations/2023_08_30_063906_update_table_signer_300820231339.php b/Database/Migrations/2023_08_30_063906_update_table_signer_300820231339.php new file mode 100644 index 0000000..7bdd509 --- /dev/null +++ b/Database/Migrations/2023_08_30_063906_update_table_signer_300820231339.php @@ -0,0 +1,32 @@ +string('signer_type')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('signers', function (Blueprint $table) { + + }); + } +}; \ No newline at end of file diff --git a/Http/Controllers/KonfirmasiBankController.php b/Http/Controllers/KonfirmasiBankController.php index 758a83c..510868a 100644 --- a/Http/Controllers/KonfirmasiBankController.php +++ b/Http/Controllers/KonfirmasiBankController.php @@ -36,25 +36,25 @@ public function index(Request $request) { - // dd($request); - $data = []; - // Tanggal awal - // Contoh tanggal saat ini - $today = Carbon::now(); + // dd($request); + $data = []; + // Tanggal awal + // Contoh tanggal saat ini + $today = Carbon::now(); - // Menambahkan 1 tahun ke tanggal saat ini - $currentYear = $today->format("Y"); + // Menambahkan 1 tahun ke tanggal saat ini + $currentYear = $today->format("Y"); - // Menambahkan 5 tahun ke tanggal saat ini - $pastYear = $today->subYear(3)->format('Y'); - $signer = Signer::all(); + // Menambahkan 5 tahun ke tanggal saat ini + $pastYear = $today->subYear(3)->format('Y'); + $signer = Signer::all(); - $data['currentYear'] = $currentYear; - $data['pastYear'] = $pastYear; - $data['signer'] = $signer; - // dd($data); + $data['currentYear'] = $currentYear; + $data['pastYear'] = $pastYear; + $data['signer'] = $signer; + // dd($data); - return view('konfirmasibank::pages.index',compact('data')); + return view('konfirmasibank::pages.index',compact('data')); } @@ -84,6 +84,10 @@ return json_encode($data); } + public function postExp(Request $request){ + dd($request); + } + /* ----- export pdf ----- @@ -100,6 +104,7 @@ $DataAccounts = []; $DataPinjaman = []; $DataLimit = []; + $ListAccount = $ViewAccount->getAccount($request['cus_no'],$account,$request['kode_cabang'],$request['periode']); foreach ($ListAccount as $key1 => $account) { @@ -179,8 +184,16 @@ // $limitArr[$key4]['BATCH_DATE'] = $item->OPENING_DATE; // } + $fasilitas = Fasilitas::where('nomor_cif',$request['cus_no'] )->where('status',1)->get(); - $signer = Signer::where('id',$fasilitas[0]['signer_id'])->get(); + $signerId = ''; + + if($request['signer'] ){ + $signerId = $request['signer']; + }else{ + $signerId = $fasilitas[0]['signer_id']; + } + $signer = Signer::where('id', $signerId)->get(); $currentDate = Carbon::now(); $tanggalIndonesia = $currentDate->locale('id')->isoFormat('dddd, D MMMM YYYY'); @@ -207,6 +220,8 @@ // Keluarkan file PDF ke browser $pdf->stream('"Konfirmasi_bank_"'.$ListPinjaman[0]->SHORT_NAME.'"'. $currentDate.'".pdf"'); + return response()->download($pdf); + } public function signer(Request $request){ @@ -230,10 +245,12 @@ abort(403, 'Sorry !! You are Unauthorized to create any konfirmasibank.create !'); } + $currentDate = Carbon::now(); $validated = $request->validate([ 'deputy_director' => 'required|string', - 'executive_officer' => 'required|string' + 'executive_officer' => 'required|string', + 'signer_type' => 'required|string' ]); if ($validated) { @@ -242,6 +259,7 @@ $signer = new Signer(); $signer->deputy_director_name = $request->deputy_director; $signer->executive_officer_name = $request->executive_officer; + $signer->signer_type = $request->signer_type; $signer->created_at = $currentDate; $signer->status = 1; $signer->save(); @@ -318,7 +336,8 @@ $validator = Validator::make($request->all(), [ 'deputy_director' => 'required|string', - 'executive_officer' => 'required|string' + 'executive_officer' => 'required|string', + 'signer_type' => 'required|string' ]); if ($validator->fails()) { @@ -331,6 +350,7 @@ $signer = Signer::findOrFail($request->id); $signer->deputy_director_name = $request->deputy_director; $signer->executive_officer_name = $request->executive_officer; + $signer->signer_type = $request->signer_type; $signer->updated_at = $today; $signer->save(); @@ -541,4 +561,4 @@ } - } + } \ No newline at end of file diff --git a/Resources/views/pages/index.blade.php b/Resources/views/pages/index.blade.php index 6d6ffe5..daa77ca 100644 --- a/Resources/views/pages/index.blade.php +++ b/Resources/views/pages/index.blade.php @@ -17,7 +17,7 @@
- +
@@ -29,7 +29,7 @@
- +
@@ -41,17 +41,17 @@
-
+ @csrf
- - - - + {{-- --}} + + {{-- + --}}
-
+
+ + +
+ + @push('customscript') diff --git a/Resources/views/pages/index_signer.blade.php b/Resources/views/pages/index_signer.blade.php index b7e5298..617c51d 100644 --- a/Resources/views/pages/index_signer.blade.php +++ b/Resources/views/pages/index_signer.blade.php @@ -63,6 +63,12 @@
+
+
+ +
+ +
+
+ +
+ +