From 7adf05e50fd06ab510b0f3db23cfc8986c62c841 Mon Sep 17 00:00:00 2001 From: KhatamNugraha Date: Mon, 15 Jul 2024 10:15:15 +0700 Subject: [PATCH] fixing filter cabang --- Http/Controllers/KonfirmasiBankController.php | 19 +++++++++---------- Resources/views/pages/index.blade.php | 10 +++++----- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Http/Controllers/KonfirmasiBankController.php b/Http/Controllers/KonfirmasiBankController.php index 8057af0..7f9236a 100644 --- a/Http/Controllers/KonfirmasiBankController.php +++ b/Http/Controllers/KonfirmasiBankController.php @@ -401,7 +401,7 @@ class KonfirmasiBankController extends Controller $arrAccount = explode(",", $request['accNo']); $dateCoreAccount = Carbon::parse($request['startDate2']); $dateCoreDepo = Carbon::parse($request['startDate2']); - // dd( $dateCore); + $cabang = $request['cabang']; $Account = new Account(); $data = []; $DataAccounts = []; @@ -412,56 +412,56 @@ class KonfirmasiBankController extends Controller $DataDepo = []; $GetCustomer = Nasabah::where('cif',$request['cusNo'])->first(); - // $listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get(); $listAccount = DPK::where('cif',$request['cusNo']) ->whereIn('no_rek', $arrAccount) ->whereDate('period', $dateCoreAccount ) + ->where('nama_cabang','like', '%'.$cabang.'%') ->orderBy('jenis_rekening', 'DESC') ->get(); if ($listAccount->isEmpty()) { $dateCoreDepo = $dateCoreDepo->addDays(1)->format('m/d/Y'); $dateCoreAccount = $dateCoreAccount->subDays(1)->format('m/d/Y'); - // $listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get(); $listAccount = DPK::where('cif',$request['cusNo']) ->whereIn('no_rek', $arrAccount) ->whereDate('period', $dateCoreAccount ) + ->where('nama_cabang','like', '%'.$cabang.'%') ->orderBy('jenis_rekening', 'DESC') ->get(); if($listAccount->isEmpty()){ $dateCoreDepo = carbon::parse($dateCoreDepo)->addDays(2)->format('m/d/Y'); $dateCoreAccount = carbon::parse($dateCoreAccount)->subDays(2)->format('m/d/Y'); - //$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get(); $listAccount = DPK::where('cif',$request['cusNo']) ->whereIn('no_rek', $arrAccount) ->whereDate('period', $dateCoreAccount ) + ->where('nama_cabang','like', '%'.$cabang.'%') ->orderBy('jenis_rekening', 'DESC') ->get(); if ($listAccount->isEmpty()) { $dateCoreDepo = carbon::parse($dateCoreDepo)->addDays(3)->format('m/d/Y'); $dateCoreAccount = carbon::parse($dateCoreAccount)->subDays(3)->format('m/d/Y'); - //$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get(); $listAccount = DPK::where('cif',$request['cusNo']) ->whereIn('no_rek', $arrAccount) ->whereDate('period', $dateCoreAccount ) + ->where('nama_cabang','like', '%'.$cabang.'%') ->orderBy('jenis_rekening', 'DESC') ->get(); if ($listAccount->isEmpty()) { $dateCoreDepo = carbon::parse($dateCoreDepo)->addDays(4)->format('m/d/Y'); $dateCoreAccount = carbon::parse($dateCoreAccount)->subDays(4)->format('m/d/Y'); - // $listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get(); $listAccount = DPK::where('cif',$request['cusNo']) ->whereIn('no_rek', $arrAccount) ->whereDate('period', $dateCoreAccount ) + ->where('nama_cabang','like', '%'.$cabang.'%') ->orderBy('jenis_rekening', 'DESC') ->get(); if ($listAccount->isEmpty()) { $dateCoreDepo = carbon::parse($dateCoreDepo)->addDays(5)->format('m/d/Y'); $dateCoreAccount = carbon::parse($dateCoreAccount)->subDays(5)->format('m/d/Y'); - // $listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get(); $listAccount = DPK::where('cif',$request['cusNo']) ->whereIn('no_rek', $arrAccount) ->whereDate('period', $dateCoreAccount ) + ->where('nama_cabang','like', '%'.$cabang.'%') ->orderBy('jenis_rekening', 'DESC') ->get(); } @@ -508,7 +508,7 @@ class KonfirmasiBankController extends Controller } - $loans = loan::where('sk_nasabah',$request['cusNo'])->whereDate('periode', $dateCoreAccount )->whereNot('outstanding', 0)->get(); + $loans = loan::where('sk_nasabah',$request['cusNo'])->whereDate('periode', $dateCoreAccount )->whereNot('outstanding', 0)->where('nama_cabang','like', '%'.$cabang.'%')->get(); $DataLoan = []; foreach ($loans as $keyLon => $lon) { $DataLoan[$keyLon]['ACCOUNT_NUMBER'] = $lon->no_rek; @@ -523,7 +523,6 @@ class KonfirmasiBankController extends Controller } - // $CekDepo = Dpk::where('cif',$request['cusNo'])->whereDate('period', $dateCoreAccount )->whereNot('jumlah_nominal', 0)->where('jenis_rekening', 'DEPOSITO')->first(); $fasilitas = Fasilitas::where('nomor_cif', $request['cusNo'])->where('status', 1)->get(); foreach ($fasilitas as $key3 => $val3) { $DataFasilitas[$key3]['jenis_fasilitas'] = $val3->jenis_fasilitas; @@ -846,4 +845,4 @@ class KonfirmasiBankController extends Controller } -} \ No newline at end of file +} diff --git a/Resources/views/pages/index.blade.php b/Resources/views/pages/index.blade.php index bef3d1b..a500752 100644 --- a/Resources/views/pages/index.blade.php +++ b/Resources/views/pages/index.blade.php @@ -234,10 +234,10 @@
@csrf - - - - + + + +
@@ -368,7 +368,7 @@ $('.loading1').show(); var actionUrl = $(".form_customer3").attr('action'); var cif = $("input[name=cif]").val(); - var kodecabang = $("input[name=kodecabang]").val(); + var kodecabang = $("select[name='kodecabang']").val(); var periode = $("input[name=periode]").val(); var startDate = $("input[name=startDate]").val(); var endDate = $("input[name=endDate]").val();