fixing query builder

This commit is contained in:
KhatamNugraha
2024-03-19 16:31:56 +07:00
parent 6d293f42c8
commit 5f78f6938a
2 changed files with 37 additions and 31 deletions

View File

@ -363,7 +363,6 @@
// dd($listAccount);
$GetCustomer = $Account->getCustomer($request['cusNo'])->first();
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore )->get();
$Arrangement = $Account->getPinjaman($request['cusNo'], $dateCore)->get();
foreach ($listAccount as $key1 => $account) {
$DataAccounts[$key1]['ACCOUNT_NUMBER'] = $account->ACCOUNT_NUMBER;
@ -382,21 +381,23 @@
}
$Arrangement = $Account->getPinjaman($request['cusNo'], $dateCore)->get();
foreach ($Arrangement as $key2 => $pinjaman) {
// $MaturityDate = $Account->getMaturityDate($pinjaman->ARRANGEMENT_ID, $startDate )->first();
$maturityDate = $Account->getMaturityDate($pinjaman->ARRANGEMENT_ID, $startDate )->first();
$TermAmount = $Account->getTermAmount($pinjaman->ARRANGEMENT_ID,$startDate)->first();
$FixedRate = $Account->getFixedRate($pinjaman->ARRANGEMENT_ID,$startDate)->first();
$balance = $Account->getSingleAccount($pinjaman->LINKED_APPL_ID,$startDate)->first();
// dd($balance);
$DataPinjaman[$key2]['ARRANGEMENT_ID'] = $pinjaman->ARRANGEMENT_ID;
$DataPinjaman[$key2]['START_DATE'] = $pinjaman->START_DATE;
$DataPinjaman[$key2]['CURRENCY'] = $pinjaman->CURRENCY;
$DataPinjaman[$key2]['PRODUCT'] = $pinjaman->PRODUCT_LINE;
$DataPinjaman[$key2]['WORKING_BALANCE'] = $balance != null ? number_format( $balance->WORKING_BALANCE, 2, ',', '.') : 'NIHIL';
$DataPinjaman[$key2]['TERM'] = $TermAmount ? $TermAmount->TERM : '' ;
$DataPinjaman[$key2]['FIXED_RATE'] = $FixedRate ? $FixedRate->FIXED_RATE : '';
$DataPinjaman[$key2]['MATURITY_DATE'] = $pinjaman->MATURITY_DATE;
$DataPinjaman[$key2]['WORKING_BALANCE'] = number_format($balance->WORKING_BALANCE, 2, ',', '.') ?? '';
$DataPinjaman[$key2]['TERM'] = $TermAmount->TERM ?? '';
$DataPinjaman[$key2]['FIXED_RATE'] = $FixedRate->FIXED_RATE ?? '';
$DataPinjaman[$key2]['MATURITY_DATE'] = $maturityDate->MATURITY_DATE ?? '';
$DataPinjaman[$key2]['ACCOUNT_NUMBER'] = $pinjaman->LINKED_APPL_ID;
}