diff --git a/Entities/Account.php b/Entities/Account.php index 2a82084..3a16426 100644 --- a/Entities/Account.php +++ b/Entities/Account.php @@ -102,6 +102,7 @@ class Account extends Model public function getAA($cust, $acc, $dataCore) { + //dd($cust, $acc, $dataCore); $timestamp = strtotime($dataCore); // Format the timestamp into a date format $Year = date("Y", $timestamp); @@ -112,8 +113,8 @@ class Account extends Model ->where('ARR_STATUS', '<>', 'CLOSE') ->where('PRODUCT_LINE', 'like', "%" .'DEPOSITS' ."%") ->where('LINKED_APPL_ID', $acc) - ->whereYear('BATCH_DATE', $Year) - ->groupBy('LINKED_APPL_ID', 'CUSTOMER', 'RENEWAL_DATE', 'START_DATE', 'FIXED_RATE', 'BATCH_DATE', 'PRODUCT_LINE', 'ARR_STATUS') + //->whereYear('BATCH_DATE', $Year) + ->groupBy('LINKED_APPL_ID', 'CUSTOMER', 'START_DATE', 'FIXED_RATE', 'BATCH_DATE', 'PRODUCT_LINE', 'ARR_STATUS','RENEWAL_DATE') ->orderBy('BATCH_DATE', 'DESC') ->limit(100); return $data; diff --git a/Http/Controllers/KonfirmasiBankController.php b/Http/Controllers/KonfirmasiBankController.php index 9248b14..c06a5d5 100644 --- a/Http/Controllers/KonfirmasiBankController.php +++ b/Http/Controllers/KonfirmasiBankController.php @@ -358,13 +358,14 @@ class KonfirmasiBankController extends Controller $DataAnjak = []; $GetCustomer = $Account->getCustomer($request['cusNo'])->first(); $listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore)->get(); + // dd( $listAccount); - try { + // try { foreach ($listAccount as $key1 => $account) { $dataAADepo = $Account->getAA($request['cusNo'], $account->ACCOUNT_NUMBER, $dateCore)->first(); + // dd($dataAADepo); if ($account->CATEGORY == '6603' || $account->CATEGORY == '6602') { if ($dataAADepo != null) { - $tenor = ''; $tanggal_1 = date_create($dataAADepo->RENEWAL_DATE); $tanggal_2 = date_create($dataAADepo->START_DATE); @@ -409,6 +410,8 @@ class KonfirmasiBankController extends Controller } + //dd( $DataAccounts); + $Arrangement = $Account->getPinjaman($request['cusNo'], $dateCore)->get(); foreach ($Arrangement as $key2 => $pinjaman) { @@ -429,7 +432,6 @@ class KonfirmasiBankController extends Controller $listAccountRK = $Account->getAccountRK($request['cusNo'], $dateCore)->get(); - foreach ($listAccountRK as $rk => $valRk) { if ($valRk->CATEGORY == '1003') { $rateRK = ""; @@ -544,11 +546,11 @@ class KonfirmasiBankController extends Controller return $pdf->stream($filename); - } catch (Exception $e) { - echo json_encode(['status' => 'error', 'message' => $e->getMessage()]); - } + // } catch (Exception $e) { + // echo json_encode(['status' => 'error', 'message' => $e->getMessage()]); + // } - return false; + // return false; }