diff --git a/Entities/Account.php b/Entities/Account.php index c261206..4e4e5d8 100644 --- a/Entities/Account.php +++ b/Entities/Account.php @@ -169,38 +169,49 @@ class Account extends Model // return $data; // } - public function getDepo($cust, $acc, $dataCore) - { + // public function getDepo($cust, $acc, $dataCore) + // { - //DD($cust, $acc, $dataCore); + // //DD($cust, $acc, $dataCore); + // $timestamp = strtotime($dataCore); + // // Format the timestamp into a date format + // $date = date("m/d/Y", $timestamp); + // // dd( $date); + // $matYear = date("Y", $timestamp); + + // $data = DB::connection("db2")->table("MIS.FACT_DPK AS DPK") + // ->selectRaw('DPK.NO_REK, + // DPK.SUKU_BUNGA, + // DPK.JUMLAH_NOMINAL, + // DPK.KODE_SUB_PRODUK, + // PER.DATE AS PERIOD, + // MAT.DATE AS JATUH_TEMPO, + // CUR.KODE_MATA_UANG, + // DPK.SK_STATUS_DEPOSITO') + // ->join('MIS.DIM_PERIOD AS PER', 'DPK.SK_PERIOD', '=', 'PER.SK_PERIOD') + // ->join('MIS.DIM_PERIOD AS MAT', 'DPK.SK_JATUH_TEMPO', '=', 'MAT.SK_PERIOD') + // ->join('MIS.DIM_MATA_UANG AS CUR', 'DPK.SK_MATA_UANG', '=', 'CUR.SK_MATA_UANG') + // // ->where('CUSTOMER_NO', $cif) + // // ->where('LIMIT_REF', null) + // ->where('PER.DATE', $date) + // //->whereYear('MAT.DATE', '>', $matYear) + // ->whereIn('DPK.NO_REK', $acc) + // //->whereIn('DPK.NO_REK', '<>',$arrExp) + // // ->groupBy('CUSTOMER_NO', 'ACCOUNT_NUMBER', 'SHORT_TITLE', 'SHORT_NAME', 'COMPANY_NAME', 'CATEGORY', 'LIMIT_REF') + // // ->orderBy('CATEGORY', 'ASC') + // ->limit(100); + // return $data; + // } + + public function getDepo($cust, $acc, $dataCore){ $timestamp = strtotime($dataCore); - // Format the timestamp into a date format $date = date("m/d/Y", $timestamp); - // dd( $date); - $matYear = date("Y", $timestamp); - - $data = DB::connection("db2")->table("MIS.FACT_DPK AS DPK") - ->selectRaw('DPK.NO_REK, - DPK.SUKU_BUNGA, - DPK.JUMLAH_NOMINAL, - DPK.KODE_SUB_PRODUK, - PER.DATE AS PERIOD, - MAT.DATE AS JATUH_TEMPO, - CUR.KODE_MATA_UANG, - DPK.SK_STATUS_DEPOSITO') - ->join('MIS.DIM_PERIOD AS PER', 'DPK.SK_PERIOD', '=', 'PER.SK_PERIOD') - ->join('MIS.DIM_PERIOD AS MAT', 'DPK.SK_JATUH_TEMPO', '=', 'MAT.SK_PERIOD') - ->join('MIS.DIM_MATA_UANG AS CUR', 'DPK.SK_MATA_UANG', '=', 'CUR.SK_MATA_UANG') - // ->where('CUSTOMER_NO', $cif) - // ->where('LIMIT_REF', null) - ->where('PER.DATE', $date) - //->whereYear('MAT.DATE', '>', $matYear) - ->whereIn('DPK.NO_REK', $acc) - //->whereIn('DPK.NO_REK', '<>',$arrExp) - // ->groupBy('CUSTOMER_NO', 'ACCOUNT_NUMBER', 'SHORT_TITLE', 'SHORT_NAME', 'COMPANY_NAME', 'CATEGORY', 'LIMIT_REF') - // ->orderBy('CATEGORY', 'ASC') - ->limit(100); + $data = []; + $data = DB::connection("db2")->table("MIS.VW_AA_DEPO")->select('*') + ->whereIn('NO_REK', $acc) + ->where('PERIOD', $date) + ->limit(100); return $data; } diff --git a/Http/Controllers/KonfirmasiBankController.php b/Http/Controllers/KonfirmasiBankController.php index c7ebda5..4dee52a 100644 --- a/Http/Controllers/KonfirmasiBankController.php +++ b/Http/Controllers/KonfirmasiBankController.php @@ -55,7 +55,7 @@ class KonfirmasiBankController extends Controller if (is_null($this->user) || !$this->user->can('konfirmasibank.create')) { abort(403, 'Sorry !! You are Unauthorized to view any master data !'); } - // dd($request); + $data = []; $no_req_surat = ''; // Contoh tanggal saat ini @@ -448,6 +448,7 @@ class KonfirmasiBankController extends Controller $DataDepo = []; $Deposito = $Account->getDepo($request['cusNo'], $arrAccount, $dateCoreDepo)->get(); + foreach ($Deposito as $keyDep => $depo) { $DataDepo[$keyDep]['ACCOUNT_NUMBER'] = $depo->NO_REK;