CHNAGE: PD_INIIATED _DATE_ADDED_IN_CET_PUSH,

CHNAGE: PD_VISIT_DATE_UPDATE_FROM_ADDRESS_SECTION
This commit is contained in:
Venba 2024-02-16 06:54:28 +00:00
parent b684b92c81
commit fb930beca9

View File

@ -441,7 +441,8 @@ class SMC_Credit_PD_Controller extends REST_Controller {
'completed_date'=>$mater_details[0]['completed_on'],
'start_location'=>$mater_details[0]['start_location'],
'lender_applicant_id'=>$mater_details[0]['lender_applicant_id'],
'name'=>$applicant_details[0]['applicant_name']);
'name'=>$applicant_details[0]['applicant_name'],
'pd_date_of_initiation'=>$mater_details[0]['pd_date_of_initiation']);
// foreach ($pd_section_data as $key => $value) {
// if (isset($value['json']) && $value['json'] != '') {
// $filter_form_id[$key] = $value['fk_form_id'];
@ -1263,6 +1264,28 @@ class SMC_Credit_PD_Controller extends REST_Controller {
//de active old entries
$is_updated = $this->SMC_Credit_PD_Model->updateRecords(array('isactive' => 0),SMC_CREDIT_PD_SECTION_DATA,array('fk_pd_id' => $records['fk_pd_id'],'fk_form_id' => $records['fk_form_id']));
if($records['fk_form_id'] == 2) //address section then get pd visit date from section and update it to master table
{
// echo 'address section';
$pd_visit_date = $records['json']['pd_visit_date'];
if($pd_visit_date != '' && $pd_visit_date != null)
{
// echo $pd_visit_date;
// Create a DateTime object from the UTC datetime string
$dateTime = new DateTime($pd_visit_date, new DateTimeZone('UTC'));
// Set the timezone to GMT+5:30
$dateTime->setTimezone(new DateTimeZone('Asia/Kolkata'));
// Get the GMT+5:30 datetime string
$gmt_pd_visit_date = $dateTime->format('Y-m-d');
//update pd visit date to master
$is_updated = $this->SMC_Credit_PD_Model->updateRecords(array('pd_visit_date' => $gmt_pd_visit_date),PDTRIGGER,array('pd_id' => $records['fk_pd_id']));
// echo $gmt_pd_visit_date;
}
//die();
}
$records['json'] = json_encode($records['json']);
//make new entry