From db0e43d33f7daeb17d80152e6f5ffa2080d01060 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Sat, 29 Oct 2022 21:12:48 +0530 Subject: [PATCH] Testing FIREPORT feedback : ps --- api/application/controllers/PD_Controller.php | 14 +- .../helpers/getprocessedjson_helper.php | 44 ++++ api/application/models/PD_Model.php | 19 +- .../JSONTOREPORT_FI_OV_DI.php | 175 +++------------ .../JSONTOREPORT_FI_OV_SAL.php | 204 ++++-------------- .../report_templates/JSONTOREPORT_FI_RV.php | 168 ++------------- 6 files changed, 156 insertions(+), 468 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index a62d7078..eb781206 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -2722,17 +2722,7 @@ class PD_Controller extends REST_Controller unset($processed_json['docs_to_be_sighted']); case 27: - foreach ($records as $key => $value){ - if(isset($value['Designation_of_Person_met']) && $value['Designation_of_Person_met'] != "") - { - $cr = $this->PD_Model->selectCustomRecords(array('*'),array('company_relationship_id' =>$value['Designation_of_Person_met'] ),COMPANYRELATIONSHIPS); - if($cr) - { - $records[$key]['designation_person_met_master'] = $cr[0]['name']; - } - } - } - $processed_json = $records; + $processed_json = GETPROCESSEDJSON::convertFIGeneralDetailsForm($records, $formid); break; case 28: $processed_json = GETPROCESSEDJSON::convertFIAddressForm($records, $formid); @@ -8513,7 +8503,7 @@ class PD_Controller extends REST_Controller $img_array['Name'] = $main_applicant_name[0]['applicant_name']; $current_doc_title = $main_applicant_name[0]['applicant_name']; - if ($pd_master_details[0]['fk_pd_type'] == 2) // if smard pd + if ($pd_master_details[0]['fk_pd_type'] == 2 || $pd_master_details[0]['fk_pd_type'] == 4) // if smard pd and fi pd { $this->PD_Model->updateRecords(array('start_location' => $records['link']), PDTRIGGER, array('pd_id' => $records['fk_pd_id'])); satellite_image::getSatelliteImage($records['fk_pd_id']); diff --git a/api/application/helpers/getprocessedjson_helper.php b/api/application/helpers/getprocessedjson_helper.php index 40ec6731..0119236f 100644 --- a/api/application/helpers/getprocessedjson_helper.php +++ b/api/application/helpers/getprocessedjson_helper.php @@ -2713,6 +2713,50 @@ class GETPROCESSEDJSON return $records; } /************************########### END OF EMPLOYMENT FORM #################****************************/ + + /*****************########## START FI-GENERAL FORM DETAILS ##########**************/ + public static function convertFIGeneralDetailsForm($raw_json,$formid) + { + + + $CI =& get_instance(); + if(!empty($raw_json)) + { + foreach ($raw_json as $key => $value){ + if(isset($value['Designation_of_Person_met']) && $value['Designation_of_Person_met'] != "") + { + $cr = $CI->PD_Model->selectCustomRecords(array('*'),array('company_relationship_id' =>$value['Designation_of_Person_met'] ),COMPANYRELATIONSHIPS); + if($cr) + { + $raw_json[$key]['designation_person_met_master'] = $cr[0]['name']; + } + } + + if(isset($value['Name_of_the_Person_met']) && $value['Name_of_the_Person_met'] != "") + { + $CI->db->SELECT('applicant_name'); + $CI->db->FROM(PDAPPLICANTSDETAILS); + //$CI->db->WHERE('isactive',1); + $CI->db->WHERE( 'pd_co_applicant_id' ,$value['Name_of_the_Person_met']); + $name= $CI->db->GET()->result_array(); + //print_r($CI->db->last_query()); + //print_r($name); + if(count($name)) + { + $raw_json[$key]['Name_of_the_Person_met_master'] = $name[0]['applicant_name']; + } + + } + } + + + + } + return $raw_json; + //print_r($raw_json); + } + /*****************########## END FI-GENERAL FORM DETAILS ##########**************/ + /*****************########## FI-ADDRESS FORM DETAILS ##########********************/ public static function convertFIAddressForm($raw_json,$formid) diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 52e5eacf..403dded1 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -2610,14 +2610,19 @@ class PD_Model extends SPARQ_Model { if(count($template_forms) > 0){ if((int)$pd_master_detials[0]['fk_pd_type'] == 4){ if(!empty($pd_additional_requirements)){ - array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '31','pd_form_order' => '5','pd_form_level_order' => '2','form_name' => 'Credit Manager Queries','is_form_disabled'=>0,"template_id"=>null)); + array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '31','pd_form_order' => '4','pd_form_level_order' => '2','form_name' => 'Credit Manager Queries','is_form_disabled'=>0,"template_id"=>null)); + $keys = array_column($template_forms, 'pd_form_order'); + array_multisort($keys, SORT_ASC, $template_forms); + // $count = count($template_forms); + // $inserted = array("template_id"=>null,'map_id'=>$map_id,'form_id' => '31','pd_form_order' => '4','pd_form_level_order' => '2','form_name' => 'Credit Manager Queries','is_form_disabled'=>0); + // $template_forms = $this->array_splice_after_key($template_forms, ($count-1), $inserted); } }else{ array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '18','pd_form_order' => '2','pd_form_level_order' => '1','form_name' => 'General Information','is_form_disabled'=>0,"template_id"=>null)); array_push($template_forms,Array('map_id'=>$map_id,'form_id' => '26','pd_form_order' => '24','pd_form_level_order' => '1','form_name' => 'Photograph','is_form_disabled'=>0,"template_id"=>null)); } } - + // print_r($template_forms); $buiness_related_form = array(22,14,1,2,11,16); if(!strcasecmp($pd_master_detials[0]['lender_short_name'], 'CLIX')){ array_push($buiness_related_form,21);//buiness banking form id pushed for filter. @@ -2891,4 +2896,14 @@ class PD_Model extends SPARQ_Model { return $value[$key] == $keyValue; }); } +function array_splice_after_key($array, $key, $array_to_insert) +{ + $key_pos = array_search($key, array_keys($array)); + if($key_pos !== false){ + $key_pos++; + $second_array = array_splice($array, $key_pos); + $array = array_merge($array, $array_to_insert, $second_array); + } + return $array; +} } \ No newline at end of file diff --git a/api/application/views/report_templates/JSONTOREPORT_FI_OV_DI.php b/api/application/views/report_templates/JSONTOREPORT_FI_OV_DI.php index 2142e582..764fd321 100644 --- a/api/application/views/report_templates/JSONTOREPORT_FI_OV_DI.php +++ b/api/application/views/report_templates/JSONTOREPORT_FI_OV_DI.php @@ -385,7 +385,7 @@ defined('BASEPATH') or exit('No direct script access allowed'); echo 'Visit Initiated Date : ' . $pd_master_details[0]['createdon'] . ''; echo 'Visit Date : ' . $pd_master_details[0]['pd_visit_date'] . ''; echo 'Visit Report Date : ' . $pd_master_details[0]['pd_report_generated_date'] . ''; - echo 'Visit Initiated by : ' . $pd_master_details[0]['branch_name'] . ' Branch'; + echo 'Visit Initiated by : ' . $pd_master_details[0]['lender_full_name'] . ''; echo 'Loan Application ID : ' . $pd_master_details[0]['lender_applicant_id'] . ''; echo 'Product : Home Loan '; echo 'Customer Segment : Self Employed '; @@ -418,10 +418,10 @@ defined('BASEPATH') or exit('No direct script access allowed'); $general_form = json_decode($pd_processed_forms[27][0]['processed_json'], true); $value = $general_form['json']; $all_applicant_details = $applicants_details; - if ($value['is_person_met'] == 'yes') { - echo '

' . 'Applicant ('.$value['Name_of_the_Person_met'].') was met at the visited address.' . '

'; - }else if ($value['is_person_met'] == 'no') { - echo '

' . '('.$value['Name_of_the_Person'].') ('.$value['designation_person_met_master'].') was met at the visited address during visit..' . '

'; + if (strtoupper($value['is_person_met']) == 'YES') { + echo '

' . 'Applicant ('.$value['Name_of_the_Person_met_master'].') was met at the visited address.' . '

'; + }else if (strtoupper($value['is_person_met']) == 'NO') { + echo '

' . '('.$value['Name_of_the_Person'].') ('.$value['designation_person_met_master'].') was met at the visited address during visit.' . '

'; } if (isset($general_form['general_remark']) && $general_form['general_remark'] != "") { echo '

' . $general_form['general_remark'] . '

'; @@ -434,14 +434,13 @@ defined('BASEPATH') or exit('No direct script access allowed'); echo '
'; $address_form = json_decode($pd_processed_forms[28][0]['processed_json'], true); $address_value = $address_form['json']; - // print_r($address_value); if(!empty($address_value)){ echo '

ADDRESS DETAILS:

'; - if ($address_value['is_pd_done_on_initiated_address'] == 'yes') { + if (strtoupper($address_value['is_pd_done_on_initiated_address']) == 'YES') { echo '

' . ' Visit Initiated Address: '.$address_value['initiated_address'].' , '.$address_value['city_master'].' , '.$address_value['state_master'].' , '.$address_value['pincode_master'].'.

'; } - if ($address_value['is_pd_done_on_initiated_address'] == 'no') { + if (strtoupper($address_value['is_pd_done_on_initiated_address']) == 'NO') { echo '

' . ' Address Where Visit is Initiated: '.$address_value['initiated_address'].' , '.$address_value['city_master'].' , '.$address_value['state_master'].' , '.$address_value['pincode_master'].'. Address Where Visit was actually done: '.$address_value['actual_pd_address'].' , '.$address_value['city2_master'].' , '.$address_value['state2_master'].' , '.$address_value['pincode2_master'].'. @@ -463,13 +462,13 @@ defined('BASEPATH') or exit('No direct script access allowed'); $business_activities_during_visit = implode(', ', $ov_value['Was_any_business_activities_observed_during_visit']); $business_activities_during_visit = preg_replace("/_/i", ' ', $business_activities_during_visit ); $business_activities_during_visit = ucwords($business_activities_during_visit); - $company_name_sighted = $ov_value['was_the_company_name_board_sighted'] == 'Yes' ? 'seen' : 'not seen'; + $company_name_sighted = strtoupper($ov_value['was_the_company_name_board_sighted']) == 'YES' ? 'seen' : 'not seen'; echo '

'; @@ -534,7 +533,7 @@ defined('BASEPATH') or exit('No direct script access allowed'); $neighbourhood_business_running_yr = $neighbour_value['neighbourhood_name']." was not aware of how long the business is in operation."; } $ownwers_list = ''; - if(isset($neighbour_value['know_organisation_owner']) && $neighbour_value['know_organisation_owner'] == 'yes'){ + if(isset($neighbour_value['know_organisation_owner']) && strtoupper($neighbour_value['know_organisation_owner']) == 'YES'){ if(isset($neighbour_value['organisation_owner'])){ // echo "type" . gettype($neighbour_value['organisation_owner']); for($i = 0; $i < count($neighbour_value['organisation_owner']); $i++) @@ -610,11 +609,9 @@ defined('BASEPATH') or exit('No direct script access allowed'); '; @@ -640,8 +637,8 @@ defined('BASEPATH') or exit('No direct script access allowed'); foreach ($credit_officier_specific_queries['docs_to_be_sighted_processed'] as $doc_key => $doc_value) { echo 'Document Required : ' . $doc_value['doc_name'] . '
'; - echo 'Provided ( Yes / No ) : ' . ($doc_value['ans'] == 'yes' ? 'YES, Document available in zipped file enclosed with report' . '
' : 'NO
'); - if ($doc_value['ans'] != 'yes') { + echo 'Provided ( Yes / No ) : ' . (strtoupper($doc_value['ans']) == 'YES' ? 'YES, Document available in zipped file enclosed with report' . '
' : 'NO
'); + if (strtoupper($doc_value['ans']) != 'YES') { echo 'Reason : ' . $doc_value['reason']; } echo '

'; @@ -675,51 +672,22 @@ defined('BASEPATH') or exit('No direct script access allowed'); ?> - -
+ +

VISITING OFFICER`S REMARKS

- '; - // echo '

Personal feedback or market intelligence on the case (if any):

'; - // echo '

' . $final_remark_data['market_intelligence'] . '

'; - // echo '
'; - // //echo '
'; - // } - ?> +
+
  • Remarks:
  • + ' . $pd_officer_final_remark . '

    ' ?> - - -

    PD officer recommendation is ' . $fo_diplay . '.

    '; - if(isset($final_remark_data['recommendation_positive'])){?> - -

    The following key points were considered while arriving at the aforementioned status.

    - "; - foreach ($final_remark_data['recommendation_positive'] as $pos) { - echo "
  • " . $pos['reason_for_positive'] . "
  • "; - } - } else if ($negative) { - echo "'; ?>
    @@ -563,15 +564,16 @@ defined('BASEPATH') or exit('No direct script access allowed'); } echo '
    '; - echo '

    Document to be photographed/scanned:

    '; + // echo '

    Document to be photographed/scanned:

    '; + echo '

    DOCUMENT TO BE PHOTOGRAPHED/SCANNED:

    '; if (isset($credit_officier_specific_queries['docs_to_be_sighted_processed']) && count($credit_officier_specific_queries['docs_to_be_sighted_processed'])) { foreach ($credit_officier_specific_queries['docs_to_be_sighted_processed'] as $doc_key => $doc_value) { echo 'Document Required : ' . $doc_value['doc_name'] . '
    '; - echo 'Provided ( Yes / No ) : ' . ($doc_value['ans'] == 'yes' ? 'YES, Document available in zipped file enclosed with report' . '
    ' : 'NO
    '); - if ($doc_value['ans'] != 'yes') { + echo 'Provided ( Yes / No ) : ' . (strtoupper($doc_value['ans']) == 'YES' ? 'YES, Document available in zipped file enclosed with report' . '
    ' : 'NO
    '); + if (strtoupper($doc_value['ans']) != 'YES') { echo 'Reason : ' . $doc_value['reason']; } echo '

    '; @@ -608,48 +610,19 @@ defined('BASEPATH') or exit('No direct script access allowed');

    -

    VISITING OFFICER`S REMARKS

    +

    VISITING OFFICER`S REMARKS

    - '; - // echo '

    Personal feedback or market intelligence on the case (if any):

    '; - // echo '

    ' . $final_remark_data['market_intelligence'] . '

    '; - // echo '
    '; - // //echo '
    '; - // } - ?> +
    +
  • Remarks:
  • + ' . $pd_officer_final_remark . '

    ' ?> - - -

    PD officer recommendation is ' . $fo_diplay . '.

    '; - if(isset($final_remark_data['recommendation_positive'])){?> - -

    The following key points were considered while arriving at the aforementioned status.

    - "; - foreach ($final_remark_data['recommendation_positive'] as $pos) { - echo "
  • " . $pos['reason_for_positive'] . "
  • "; - } - } else if ($negative) { - echo "