Live Fixes : ps

This commit is contained in:
sanjeev.p 2021-08-31 13:20:58 +05:30
parent 7c3460bd52
commit 5d6923e31b
2 changed files with 56 additions and 26 deletions

View File

@ -5007,7 +5007,11 @@ public function getPDFormDetailsJSON_post()
$pd_type = $data['pd_master_details'][0]['fk_pd_type'] == 3 ? 3 : 1; $pd_type = $data['pd_master_details'][0]['fk_pd_type'] == 3 ? 3 : 1;
$data['lender_disclaimer'] = $this->PD_Model->selectRecords(ENTITYDISCLAIMER,array('fk_entity_id' => ($data['pd_master_details'][0]['sub_entity_id'] ? $data['pd_master_details'][0]['sub_entity_id'] : $data['pd_master_details'][0]['fk_lender_id']),'fk_pd_type' => $pd_type)); $data['lender_disclaimer'] = $this->PD_Model->selectRecords(ENTITYDISCLAIMER,array('fk_entity_id' => ($data['pd_master_details'][0]['sub_entity_id'] ? $data['pd_master_details'][0]['sub_entity_id'] : $data['pd_master_details'][0]['fk_lender_id']),'fk_pd_type' => $pd_type));
//} //}
if($data['pd_master_details'][0]['lender_short_name'] == 'CSLFL'){
$entity_geo_location = $this->PD_Model->getEntityAddr($data['pd_master_details'][0]['fk_lender_id']);
$pd_location = $data['pd_master_details'][0]['start_location'];
$data['distances'] = satellite_image::getdistancematrix($entity_geo_location,$pd_location);
}
//$data['lender_disclaimer'] = $this->PD_Model->selectRecords(ENTITYDISCLAIMER,array('fk_entity_id' => $data['pd_master_details'][0]['fk_lender_id'])); //$data['lender_disclaimer'] = $this->PD_Model->selectRecords(ENTITYDISCLAIMER,array('fk_entity_id' => $data['pd_master_details'][0]['fk_lender_id']));
$data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid); $data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid);
$data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid); $data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);

View File

@ -1380,6 +1380,7 @@ public function filterSalesPDList_post() {
// $filename = 'C:\Users\Venba\Downloads\Test Demo17_dev.xlsx'; // $filename = 'C:\Users\Venba\Downloads\Test Demo17_dev.xlsx';
// echo $filename;die(); // echo $filename;die();
// $filename = '/home/venba/Downloads/Sample_CET_Upload4.xls'; // $filename = '/home/venba/Downloads/Sample_CET_Upload4.xls';
if(is_file($filename)){
if(!file_exists($filename)) if(!file_exists($filename))
{ {
@ -1393,6 +1394,9 @@ public function filterSalesPDList_post() {
//echo '*'.$sucess; //echo '*'.$sucess;
} }
return $cur_section_data = readexceldata::getExcelSectionData($filename,$form_id,$pd_master_data[0]['pd_id']); return $cur_section_data = readexceldata::getExcelSectionData($filename,$form_id,$pd_master_data[0]['pd_id']);
}else{
return [];
}
} }
@ -1728,10 +1732,10 @@ public function filterSalesPDList_post() {
{ {
$records = $this->post('records'); $records = $this->post('records');
$pd_master_data = $this->PD_Model->getPDMasterDetails($records['pd_id'],$records['random_string']); $pd_master_data = $this->PD_Model->getPDMasterDetails($records['pd_id'],$records['random_string']);
// $filename = ($pd_master_data[0]['re_uploaded'] ? XLPATH.'/tmp/'.$pd_master_data[0]['re_uploaded_file_name'] : XLPATH.'/tmp/'.$pd_master_data[0]['modified_fname']);
$filename = ($pd_master_data[0]['re_uploaded'] ? XLPATH.'/tmp/'.$pd_master_data[0]['re_uploaded_file_name'] : XLPATH.'/tmp/'.$pd_master_data[0]['modified_fname']);
// $filename = '/home/VenbaLap08/Downloads/Test Demo17_dev.xlsx'; // $filename = '/home/VenbaLap08/Downloads/Test Demo17_dev.xlsx';
$filename = '/home/venba/Downloads/Sample_CET_Upload4.xls';
if(is_file($filename)){
if(!file_exists($filename)) if(!file_exists($filename))
{ {
$bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_data[0]['fk_lender_id']; $bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_data[0]['fk_lender_id'];
@ -1741,7 +1745,29 @@ public function filterSalesPDList_post() {
$sucess = file_put_contents($filename, file_get_contents($singed_uri)); $sucess = file_put_contents($filename, file_get_contents($singed_uri));
} }
$cur_section_data = readexceldata::getCompanyListForSMCList($filename,$pd_master_data[0]['pd_id']); $cur_section_data = readexceldata::getCompanyListForSMCList($filename,$pd_master_data[0]['pd_id']);
}
else{
$arr = $this->PD_Model->getApplicantsDetails($pd_master_data[0]['pd_id']);
$new_arr = array_filter($arr, function ($var) {
return ($var['applicant_type'] != 0);
});
if(!empty($new_arr)){
for($i=0;$i<count($new_arr);$i++){
$cur_section_data[$i]['b-orrower_type'] = $new_arr[$i]['applicant_type'] == 1 ? "Main Applicant" : "Company";
$cur_section_data[$i]['borrower_name'] = $new_arr[$i]['company_name'];
$cur_section_data[$i]['entity_type'] = "Non Individual";
$cur_section_data[$i]['designation'] = "";
$cur_section_data[$i]['relationship_to'] = "";
$cur_section_data[$i]['relationship'] = "";
$cur_section_data[$i]['borrower_age'] = "";
$cur_section_data[$i]['numbers_of_years_business_running'] = "";
$cur_section_data[$i]['company_id'] = $new_arr[$i]['pd_co_applicant_id'];
}
}
else{
$cur_section_data = [];
}
}
if(count($cur_section_data)) if(count($cur_section_data))
{ {
$data['dataStatus'] = true; $data['dataStatus'] = true;