Google Sheet Rview Completed : ps

This commit is contained in:
VE10-Sanjeev 2022-04-21 23:11:12 +05:30
parent d2217ee019
commit d29d5af565

View File

@ -148,11 +148,11 @@ class Data_Dump_Controller extends REST_Controller {
$pd_details['fk_lender_id']=$fk_lender_id;
$pd_details['sub_entity_id']=$fk_lender_id;
log_message('ERROR',"G-Sheet For PD Step 2.1 (lender/casebookedin) GSheet data : ".$GSdata["LenderName"]." PD :".$pd_details['fk_lender_id']." ".$pd_details['sub_entity_id']);
$lender_contact_persons = $this->PD_Model->getLenderContactPersons($fk_lender_id,null);
if(!empty($lender_contact_persons)){
$pd_details['lender_credit_person'] = $lender_contact_persons[0]['role_type'] == "CREDIT" ? $lender_contact_persons[0]['userid'] : null;
$pd_details['lender_sales_person'] = $lender_contact_persons[0]['role_type'] == "SALES" ? $lender_contact_persons[0]['userid'] : null;
}
// $lender_contact_persons = $this->PD_Model->getLenderContactPersons($fk_lender_id,null);
// if(!empty($lender_contact_persons)){
// $pd_details['lender_credit_person'] = $lender_contact_persons[0]['role_type'] == "CREDIT" ? $lender_contact_persons[0]['userid'] : null;
// $pd_details['lender_sales_person'] = $lender_contact_persons[0]['role_type'] == "SALES" ? $lender_contact_persons[0]['userid'] : null;
// }
}
if(isset($GSdata["LAN"]) && $GSdata["LAN"] != ""){
$LAN = trim(str_replace(" ", "", $GSdata["LAN"]));
@ -195,12 +195,22 @@ class Data_Dump_Controller extends REST_Controller {
$pd_applicant_details[0]['applicant_name'] = $applicatantParts[0];
}
$pd_applicant_details[0]['company_name'] = isset($GSdata["CompanyName"]) ? $GSdata["CompanyName"] : null ;
$pd_applicant_details[0]['mobile_no'] = isset($GSdata['ContactNumber']) ? $GSdata['ContactNumber'] : null;
$pd_applicant_details[0]['company_name'] = (isset($GSdata["CompanyName"]) && $GSdata["CompanyName"] != "") ? $GSdata["CompanyName"] : null ;
$pd_applicant_details[0]['applicant_type'] = 1;
log_message('ERROR',"G-Sheet For PD Step 2.3 (applicant details) GSheet data : ".json_encode($pd_applicant_details));
log_message('ERROR',"G-Sheet For PD Step 2.4 (mobile number) GSheet data : ".$GSdata['ContactNumber']);
log_message('ERROR',"G-Sheet For PD Step 2.5 (company) GSheet data : ".$GSdata["CompanyName"]);
log_message('ERROR',"G-Sheet For PD Step 2.4 (company) GSheet data : ".$GSdata["CompanyName"]);
}
if(isset($GSdata["ContactNumber"]) && $GSdata["ContactNumber"] != ""){
$ContactNumber = explode(',',$GSdata["ContactNumber"]);
if(count($ContactNumber)>1){
for($j=0;$j<count($ContactNumber);$j++){
$pd_applicant_details[$j]['mobile_no'] = $ContactNumber[$j];
}
}else{
$pd_applicant_details[0]['mobile_no'] = $ContactNumber[0];
}
log_message('ERROR',"G-Sheet For PD Step 2.5 (mobile number) GSheet data : ".$GSdata['ContactNumber']);
}
//address section.
@ -231,7 +241,7 @@ class Data_Dump_Controller extends REST_Controller {
log_message('ERROR',"G-Sheet For PD Step 2.6 (address) GSheet data : ".$GSdata["PDLocation"]);
}
if(isset($GSdata["PersonDoing"]) && $GSdata["PersonDoing"] != ""){
$pd_details['fk_createdby'] = $this->Data_Dump_Model->getId(8,$GSdata["PersonDoing"]);
// $pd_details['fk_createdby'] = $this->Data_Dump_Model->getId(8,$GSdata["PersonDoing"]);
log_message('ERROR',"G-Sheet For PD Step 2.7 (Allocated Person) GSheet data : ".$GSdata["PersonDoing"]);
}
if(isset($GSdata["LoanAmount"]) && ($GSdata["LoanAmount"] != "" || $GSdata["LoanAmount"] != 0)){
@ -292,9 +302,16 @@ class Data_Dump_Controller extends REST_Controller {
// }
if(isset($GSdata["AdditionalRequirements"]) && $GSdata["AdditionalRequirements"] != ""){
// $pd_details['remarks'] = "`Remarks on Current Status` : ".$GSdata["RemarksonCurrentStatus"];
$pd_addtional_requirements = explode(',',$GSdata["AdditionalRequirements"]);
log_message('ERROR',"G-Sheet For PD Step 2.13 ( additional requirements) GSheet data : ".$GSdata["AdditionalRequirements"]." PD details :".json_encode($pd_addtional_requirements));
$requirements = explode(',',$GSdata["AdditionalRequirements"]);
if(count($requirements)>1){
for($j=0;$j<count($requirements);$j++){
$addi_requirements[$j]['add_requirement'] = $requirements[$j];
}
}else{
$addi_requirements[0]['add_requirement'] = $requirements[0];
}
log_message('ERROR',"G-Sheet For PD Step 2.13 ( additional requirements) GSheet data : ".$GSdata["AdditionalRequirements"]." PD details :".json_encode($addi_requirements));
}
if(isset($GSdata["Remarks"]) && $GSdata["Remarks"] != ""){
// $pd_details['remarks'] = $pd_details['remarks']."\r\n `Previous Remarks` : ".$GSdata["PreviousRemarks"];
@ -311,6 +328,7 @@ class Data_Dump_Controller extends REST_Controller {
## Default Status section;
$pd_details['pd_status'] = TRIGGERED;
$pd_details['pd_date_of_initiation'] = date('Y-m-d H-i-s');
$pd_details['fk_createdby'] = 379; // default user created for admin.
## Template ID Section.
$fields = array('fk_template_id');
$where_condition_array = array('fk_lender_id'=>$fk_lender_id ,'fk_product_id'=> $fk_product_id,'fk_customer_segment'=> $fk_customer_segment,'isactive' => 1);
@ -361,7 +379,7 @@ class Data_Dump_Controller extends REST_Controller {
log_message('ERROR',"G-Sheet For PD Step 4 (PDID gotten) ERR : ".$e->getMessage());
// var_dump($e->getMessage());
}
// $pd_id = 3073;
// $pd_id = 3149;
if($pd_id != null || $pd_id != '')
@ -374,7 +392,7 @@ class Data_Dump_Controller extends REST_Controller {
{
$pd_applicant_detail['fk_pd_id'] = $pd_id;
$pd_applicant_detail['applicant_name'] = trim(MYUTIL::applicantNameCamelCaseConvertion($pd_applicant_detail['applicant_name']));
if($pd_applicant_detail['company_name']){ $pd_applicant_detail['company_name'] = trim(MYUTIL::applicantNameCamelCaseConvertion($pd_applicant_detail['company_name'])); }
if(isset($pd_applicant_detail['company_name'])){ $pd_applicant_detail['company_name'] = trim(MYUTIL::applicantNameCamelCaseConvertion($pd_applicant_detail['company_name'])); }
try {
$co_applicant_id = $this->Data_Dump_Model->saveRecords($pd_applicant_detail,PDAPPLICANTSDETAILS);
log_message('ERROR',"G-Sheet For PD Step 5.1 (applicant pkid) Applicant-ID : ".$co_applicant_id);
@ -393,12 +411,13 @@ class Data_Dump_Controller extends REST_Controller {
}
## Credit Managers Specific Queries
if($pd_id != ""){
if($pd_addtional_requirements != "" || $pd_addtional_requirements != null)
if($addi_requirements != "" || $addi_requirements != null)
{
log_message('ERROR',"G-Sheet For PD Step 6 (credit manager queries)");
foreach($pd_addtional_requirements as $pd_addtional_requirement)
foreach($addi_requirements as $pd_addtional_requirement)
{
try {
$pd_addtional_requirement['isactive'] = 1;
$pd_addtional_requirement['fk_pd_id'] = $pd_id;
$requirement_id = $this->Data_Dump_Model->saveRecords($pd_addtional_requirement,PDADDTIONALREQUIREMENTS);
log_message('ERROR',"G-Sheet For PD Step 6.1 (credit manager queries/additional requirements pkid) REQUIREMENTS-ID : ".$requirement_id);