fixing account datetime
This commit is contained in:
@ -129,7 +129,6 @@ class KonfirmasiBankController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach ($Accounts as $key => $value) {
|
||||
$cekProductAccount = $Account->getCekProduct($value->CUSTOMER_NO,$value->ACCOUNT_NUMBER, $value->BATCH_DATE)->first();
|
||||
if (!$cekProductAccount) {
|
||||
@ -378,7 +377,8 @@ class KonfirmasiBankController extends Controller
|
||||
$arrAccount = explode(",", $request['accNo']);
|
||||
// $startDate = Carbon::parse($request['startDate2']);
|
||||
// dd($tanggal1 );
|
||||
$dateCore = Carbon::parse($request['startDate2']);;
|
||||
$dateCoreAccount = Carbon::parse($request['startDate2']);
|
||||
$dateCoreDepo = Carbon::parse($request['startDate2']);
|
||||
// dd( $dateCore);
|
||||
$Account = new Account();
|
||||
$data = [];
|
||||
@ -389,31 +389,35 @@ class KonfirmasiBankController extends Controller
|
||||
$rekEscrow = [];
|
||||
$DataAnjak = [];
|
||||
$GetCustomer = $Account->getCustomer($request['cusNo'])->first();
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore->format('m/d/Y'))->get();
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount->format('m/d/Y'))->get();
|
||||
|
||||
|
||||
if ($listAccount->isEmpty()) {
|
||||
$dateCore = $dateCore->addDays(1)->format('m/d/Y');
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore)->get();
|
||||
|
||||
$dateCoreDepo = $dateCoreDepo->addDays(1)->format('m/d/Y');
|
||||
$dateCoreAccount = $dateCoreAccount->subDays(1)->format('m/d/Y');
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get();
|
||||
if($listAccount->isEmpty()){
|
||||
$dateCore = $dateCore->addDays(2)->format('m/d/Y');
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore)->get();
|
||||
$dateCoreDepo = $dateCoreDepo->addDays(2)->format('m/d/Y');
|
||||
$dateCoreAccount = $dateCoreAccount->subDays(2)->format('m/d/Y');
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get();
|
||||
if ($listAccount->isEmpty()) {
|
||||
$dateCore = $dateCore->addDays(3)->format('m/d/Y');
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore)->get();
|
||||
$dateCoreDepo = $dateCoreDepo->addDays(3)->format('m/d/Y');
|
||||
$dateCoreAccount = $dateCoreAccount->subDays(3)->format('m/d/Y');
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get();
|
||||
if ($listAccount->isEmpty()) {
|
||||
$dateCore = $dateCore->addDays(4)->format('m/d/Y');
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore)->get();
|
||||
$dateCoreDepo = $dateCoreDepo->addDays(4)->format('m/d/Y');
|
||||
$dateCoreAccount = $dateCoreAccount->subDays(4)->format('m/d/Y');
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get();
|
||||
if ($listAccount->isEmpty()) {
|
||||
$dateCore = $dateCore->addDays(5)->format('m/d/Y');
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore)->get();
|
||||
$dateCoreDepo = $dateCoreDepo->addDays(5)->format('m/d/Y');
|
||||
$dateCoreAccount = $dateCoreAccount->subDays(5)->format('m/d/Y');
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCoreAccount)->get();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DD( $listAccount);
|
||||
|
||||
// try {
|
||||
foreach ($listAccount as $key1 => $account) {
|
||||
@ -442,7 +446,7 @@ class KonfirmasiBankController extends Controller
|
||||
}
|
||||
|
||||
$DataDepo = [];
|
||||
$Deposito = $Account->getDepo($request['cusNo'], $arrAccount, $dateCore)->get();
|
||||
$Deposito = $Account->getDepo($request['cusNo'], $arrAccount, $dateCoreDepo)->get();
|
||||
|
||||
foreach ($Deposito as $keyDep => $depo) {
|
||||
|
||||
@ -458,7 +462,7 @@ class KonfirmasiBankController extends Controller
|
||||
}
|
||||
|
||||
|
||||
$Arrangement = $Account->getPinjaman($request['cusNo'], $dateCore)->get();
|
||||
$Arrangement = $Account->getPinjaman($request['cusNo'], $dateCoreAccount)->get();
|
||||
|
||||
foreach ($Arrangement as $key2 => $pinjaman) {
|
||||
$limtiCheck = $Account->getLimitCheck($pinjaman->LINKED_APPL_ID, $startDate)->first();
|
||||
@ -475,7 +479,7 @@ class KonfirmasiBankController extends Controller
|
||||
|
||||
}
|
||||
|
||||
$listAccountRK = $Account->getAccountRK($arrAccount, $dateCore)->get();
|
||||
$listAccountRK = $Account->getAccountRK($arrAccount, $dateCoreAccount)->get();
|
||||
|
||||
|
||||
foreach ($listAccountRK as $rk => $valRk) {
|
||||
@ -536,7 +540,7 @@ class KonfirmasiBankController extends Controller
|
||||
}
|
||||
|
||||
//Get DatA Anjak
|
||||
$ListAnjak = $Account->getAccountAnjak($rekEscrow, $dateCore)->get();
|
||||
$ListAnjak = $Account->getAccountAnjak($rekEscrow, $dateCoreAccount)->get();
|
||||
$totalOutstanding = $ListAnjak->sum('OUTSTANDING') != null ? number_format(abs($ListAnjak->sum('OUTSTANDING')), 2, ',', '.') : 'NIHIL';
|
||||
|
||||
|
||||
@ -849,4 +853,4 @@ class KonfirmasiBankController extends Controller
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user