fixing list data deposito

This commit is contained in:
KhatamNugraha
2024-05-13 09:56:59 +07:00
parent 52527296a7
commit 48873a503e
2 changed files with 12 additions and 9 deletions

View File

@ -102,6 +102,7 @@ class Account extends Model
public function getAA($cust, $acc, $dataCore) public function getAA($cust, $acc, $dataCore)
{ {
//dd($cust, $acc, $dataCore);
$timestamp = strtotime($dataCore); $timestamp = strtotime($dataCore);
// Format the timestamp into a date format // Format the timestamp into a date format
$Year = date("Y", $timestamp); $Year = date("Y", $timestamp);
@ -112,8 +113,8 @@ class Account extends Model
->where('ARR_STATUS', '<>', 'CLOSE') ->where('ARR_STATUS', '<>', 'CLOSE')
->where('PRODUCT_LINE', 'like', "%" .'DEPOSITS' ."%") ->where('PRODUCT_LINE', 'like', "%" .'DEPOSITS' ."%")
->where('LINKED_APPL_ID', $acc) ->where('LINKED_APPL_ID', $acc)
->whereYear('BATCH_DATE', $Year) //->whereYear('BATCH_DATE', $Year)
->groupBy('LINKED_APPL_ID', 'CUSTOMER', 'RENEWAL_DATE', 'START_DATE', 'FIXED_RATE', 'BATCH_DATE', 'PRODUCT_LINE', 'ARR_STATUS') ->groupBy('LINKED_APPL_ID', 'CUSTOMER', 'START_DATE', 'FIXED_RATE', 'BATCH_DATE', 'PRODUCT_LINE', 'ARR_STATUS','RENEWAL_DATE')
->orderBy('BATCH_DATE', 'DESC') ->orderBy('BATCH_DATE', 'DESC')
->limit(100); ->limit(100);
return $data; return $data;

View File

@ -358,13 +358,14 @@ class KonfirmasiBankController extends Controller
$DataAnjak = []; $DataAnjak = [];
$GetCustomer = $Account->getCustomer($request['cusNo'])->first(); $GetCustomer = $Account->getCustomer($request['cusNo'])->first();
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore)->get(); $listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore)->get();
// dd( $listAccount);
try { // try {
foreach ($listAccount as $key1 => $account) { foreach ($listAccount as $key1 => $account) {
$dataAADepo = $Account->getAA($request['cusNo'], $account->ACCOUNT_NUMBER, $dateCore)->first(); $dataAADepo = $Account->getAA($request['cusNo'], $account->ACCOUNT_NUMBER, $dateCore)->first();
// dd($dataAADepo);
if ($account->CATEGORY == '6603' || $account->CATEGORY == '6602') { if ($account->CATEGORY == '6603' || $account->CATEGORY == '6602') {
if ($dataAADepo != null) { if ($dataAADepo != null) {
$tenor = ''; $tenor = '';
$tanggal_1 = date_create($dataAADepo->RENEWAL_DATE); $tanggal_1 = date_create($dataAADepo->RENEWAL_DATE);
$tanggal_2 = date_create($dataAADepo->START_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(); $Arrangement = $Account->getPinjaman($request['cusNo'], $dateCore)->get();
foreach ($Arrangement as $key2 => $pinjaman) { foreach ($Arrangement as $key2 => $pinjaman) {
@ -429,7 +432,6 @@ class KonfirmasiBankController extends Controller
$listAccountRK = $Account->getAccountRK($request['cusNo'], $dateCore)->get(); $listAccountRK = $Account->getAccountRK($request['cusNo'], $dateCore)->get();
foreach ($listAccountRK as $rk => $valRk) { foreach ($listAccountRK as $rk => $valRk) {
if ($valRk->CATEGORY == '1003') { if ($valRk->CATEGORY == '1003') {
$rateRK = ""; $rateRK = "";
@ -544,11 +546,11 @@ class KonfirmasiBankController extends Controller
return $pdf->stream($filename); return $pdf->stream($filename);
} catch (Exception $e) { // } catch (Exception $e) {
echo json_encode(['status' => 'error', 'message' => $e->getMessage()]); // echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
} // }
return false; // return false;
} }