diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 9cbacc52..5c8f614e 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -4003,7 +4003,6 @@ class PD_Controller extends REST_Controller } // Get all assigned pd forms associated with this pd from template_forms table - // pdtype 4 is template_id ella. if ($template_id == null) { $columns = array('TEMPLATEFORMS.form_id', 'PDFORMS.pd_form_name'); $table = TEMPLATEFORMS . ' as TEMPLATEFORMS'; @@ -4023,8 +4022,9 @@ class PD_Controller extends REST_Controller //$pd_form_raw_data_with_score = $this->calculatePDScore($pd_form_raw_data); $transformed_data = $this->transformKeyPairToQuestionAnswers($pd_form_raw_data, $template_form_detail['form_id']); - + if($final_data_to_response['fk_pd_type'] != 4){ $final_data_to_response['question_answers']['form_details'][] = array('name' => [$template_form_detail['pd_form_name']], 'details' => $transformed_data); + }else{$final_data_to_response['question_answers']['form_details'] = array(); } //$final_data_to_response['question_answers']['form_details'] = array_merge($final_data_to_response['question_answers']['form_details'],array('name' =>[$template_form_detail['pd_form_name']],'details' => $transformed_data)); @@ -4040,7 +4040,6 @@ class PD_Controller extends REST_Controller foreach ($final_data_to_response as $key => $value) { $object->$key = $value; } - if($final_data_to_response['fk_pd_type'] == 4){ $final_data_to_response = 1; } if (count($final_data_to_response)) { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; @@ -4769,7 +4768,7 @@ class PD_Controller extends REST_Controller $pd_report_time = date('Y-m-d-H-i-s'); $pd_report_store = $this->external_path . '/pd_reports/' . $pdid . '/' . $pd_report_time . '.html'; $is_write_done = file_put_contents($pd_report_store, $t); -die; + if ($is_write_done) { //$update = $this->PD_Model->updateRecords(array('pd_report_html_filename' => $pd_report_time),PDTRIGGER,array('pd_id' => $pdid)); diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 92c63246..0abf2431 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -1935,6 +1935,7 @@ class PD_Model extends SPARQ_Model { // echo $pd_form_id; $pd_master_detials = $this->getPDMasterDetails($pd_id); + if(!empty($pd_master_detials[0]['fk_pd_template_id'])){ $this->db->SELECT('PDFORMDETAILS.fk_pd_id,PDFORMDETAILS.fk_form_id,PDFORMDETAILS.iter_column_name,PDFORMDETAILS.iter_sub_column_name,PDFORMDETAILS.iteration, PDFORMDETAILS.column_name, PDFORMDETAILS.column_id, PDFORMDETAILS.column_value,TEMPLATECATEGORYWEIGHTAGE.weightage as category_weightage,TEMPLATECATEGORYWEIGHTAGE.fk_question_category_id,QUESTIONKEYMAPPING.fk_category_id,QUESTIONCATEGORY.category_name,SCORECARDQUESTIONS.score_question_id,SCORECARDQUESTIONS.weightage as question_weightage,SCORECARDQUESTIONS.calc_type,SCORECARDANSWERS.score'); $this->db->FROM(PDFORMDETAILS.' as PDFORMDETAILS'); $this->db->JOIN(TEMPLATECATEGORYWEIGHTAGE.' as TEMPLATECATEGORYWEIGHTAGE','TEMPLATECATEGORYWEIGHTAGE.fk_template_id ='.$pd_master_detials[0]['fk_pd_template_id']); @@ -1983,7 +1984,7 @@ class PD_Model extends SPARQ_Model { } } - return $form_details; + return $form_details;}else{ return array();} } 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 dede4999..39dfca55 100644 --- a/api/application/views/report_templates/JSONTOREPORT_FI_OV_DI.php +++ b/api/application/views/report_templates/JSONTOREPORT_FI_OV_DI.php @@ -419,7 +419,7 @@ defined('BASEPATH') or exit('No direct script access allowed'); $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.' . '
'; + 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_met'].') ('.$value['designation_person_met_master'].') was met at the visited address during visit..' . '
'; } @@ -438,15 +438,15 @@ defined('BASEPATH') or exit('No direct script access allowed'); echo '' . ' - Visit Initiated Address: '.$address_value['initiated_address'].' , '.$address_value['city_master'].' , '.$address_value['state_master'].' , '.$address_value['pincode_master'].'.
'; + 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') { 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'].'. - Reason for change in Visit address: '.$address_value['end_use'].'.
'; + 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'].'. + Reason for change in Visit address: '.$address_value['end_use'].'.'; } - echo '' . 'The Field Visit was done at '.$address_value['address_type_master'].' of the loan applicants. The '.$address_value['address_type_master'].' is located in a '.$address_value['locality_master'].' and the estimated area of the '.$address_value['address_type_master'].' is '.$address_value['uom_master'].'. The location was '.$address_value['Approach_to_PD_location'].'. As Per Officer, the '.$address_value['address_type_master'].' is situated in a '.$address_value['comment_locality_master'].' Locality. ' . '
'; + echo '' . 'The Field Visit was done at '.$address_value['address_type_master'].' of the loan applicants. The '.$address_value['address_type_master'].' is located in a '.$address_value['locality_master'].' and the estimated area of the '.$address_value['address_type_master'].' is '.$address_value['uom_master'].'. The location was '.$address_value['Approach_to_PD_location'].'. As Per Officer, the '.$address_value['address_type_master'].' is situated in a '.$address_value['comment_locality_master'].' Locality. ' . '
'; } ?> @@ -460,28 +460,30 @@ defined('BASEPATH') or exit('No direct script access allowed'); $ov_value = $Office_visit_data['json']; $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 ); $company_name_sighted = $ov_value['was_the_company_name_board_sighted'] == 'Yes' ? 'seen' : 'not seen'; - echo 'Brief of the Business / Service Model: '.$ov_value['business_brief'].'.
-Visited address is of a '.$ov_value['visited_address_is'].'.
-At the time of visit, the officer sighted '.$ov_value['no_of_employees_sighted_by_PD_officer_during_visit'].' employees at the business premises.
-The Business Name board was .'.$company_name_sighted.'.at the visited address.
'; + echo ''.$ov_value['remarks_others'].'was sighted during visit and pictures are enclosed with the Report.
'; + echo 'The '.$ov_value['visited_address_is'].' is '.$ov_value['Visited_address_is_rented'].'.
'; + echo 'The '.$ov_value['visited_address_is'].' is Rented or Owned is Not Disclosed by the person met.
'; + echo 'Business Activity was '.$company_name_sighted.' and '.$business_activities_during_visit.'
'; + echo 'Stock was seen during visit and pictures are enclosed with the Report.
'; + echo 'Stock was not seen during visit because '.$ov_value['reason_of_stock_non_availability'].' .
'; + echo '