From 2a2802459e362008f7bbb60612e845cb62de2978 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Fri, 13 Sep 2019 16:31:05 +0530 Subject: [PATCH] PD TAT REPORT OTEHR ISSUES --- api/application/config/routes.php | 1 + .../controllers/Dash_Board_Controller.php | 20 ++++++++++- api/application/controllers/PD_Controller.php | 11 +++--- api/application/models/Dash_Board_Model.php | 34 +++++++++++++++++++ .../views/report_templates/JSONTOREPORT.php | 17 +++++++--- .../report_templates/JSONTOREPORT_CLIX.php | 13 +++++-- .../report_templates/JSONTOREPORT_RI.php | 7 ++++ 7 files changed, 90 insertions(+), 13 deletions(-) diff --git a/api/application/config/routes.php b/api/application/config/routes.php index b2ad6b7d..07f86d1e 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -244,6 +244,7 @@ $route['getDashBoardDetailsOfCity'] = 'Dash_Board_Controller/getDashBoardDetails $route['getDashBoardAlertDetails'] = 'Dash_Board_Controller/getDashBoardDetailsOfAlert'; $route['PD_MIS_report'] = 'Dash_Board_Controller/PD_MIS_report'; $route['alertPDTAT'] = 'Dash_Board_Controller/alertPDTAT'; +$route['pdTATReport'] = 'Dash_Board_Controller/pdTATReport'; $route['testCognito'] = 'Branch_Controller/testCognito'; //$route['(getPDReportHTML/:any)'] = 'Welcome/getPDReportHTML'; diff --git a/api/application/controllers/Dash_Board_Controller.php b/api/application/controllers/Dash_Board_Controller.php index 3f799529..fdb9fdd0 100644 --- a/api/application/controllers/Dash_Board_Controller.php +++ b/api/application/controllers/Dash_Board_Controller.php @@ -154,5 +154,23 @@ class Dash_Board_Controller extends REST_Controller { } - + public function pdTATReport_post() + { + + $filter_params = ($this->post()); + $applicant_id = isset($filter_params['applicant_id']) && $filter_params['applicant_id'] != '' ? $filter_params['applicant_id'] : null; + $from_date = isset($filter_params['from_date']) && $filter_params['from_date'] != '' ? $filter_params['from_date'] : null; + $to_date = isset($filter_params['to_date']) && $filter_params['to_date'] != '' ? $filter_params['to_date'] : null; + $city = isset($filter_params['city']) && $filter_params['city'] != '' ? $filter_params['city'] : null; + $branch = isset($filter_params['branch']) && $filter_params['branch'] != '' ? $filter_params['branch'] : null; + $lenderid = isset($filter_params['lenderid']) && $filter_params['lenderid'] != '' ? $filter_params['lenderid'] : null; + + $res = $this->Dash_Board_Model->pdTATreport($applicant_id,$from_date,$to_date,$city,$branch,$lenderid); + + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = $res; + $this->response($data,REST_Controller::HTTP_OK); + + } } \ No newline at end of file diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index a0be9f58..70a5b658 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -8825,7 +8825,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $records = $this->post(); $current_operation = null; $applicant_id = null; - //print_r($records); + //print_r($records);die(); $applicant_type = $records['is_applicant'] ? 0 : ($records['is_person_met'] ? 3 : ''); $applicant_details = array('fk_pd_id' => $records['fk_pd_id'],'applicant_name' => $records['applicant_name'],'applicant_title_name' => $records['applicant_title_name'],'applicant_type' => $applicant_type ); @@ -8837,7 +8837,10 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() } else { - unset($applicant_details['applicant_type']); + if($applicant_type == 0) + { + unset($applicant_details['applicant_type']); + } $applicant_id = $this->PD_Model->updateRecords($applicant_details,PDAPPLICANTSDETAILS,array('pd_co_applicant_id' => $records['pd_co_applicant_id'])); $current_operation = 2;// 2 means UPDATE } @@ -8893,14 +8896,14 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $lender_id = $this->PD_Model->selectCustomRecords(array('fk_lender_id'),array('pd_id' => $records['fk_pd_id']),PDTRIGGER); $bucket_name = LENDER_BUCKET_NAME_PREFIX.$lender_id[0]['fk_lender_id']; - $applicant_name = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => ($records['applicant_name'])),PDDOCUMENTS); + $applicant_name = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => ($records['applicant_name']),'isactive' => 1),PDDOCUMENTS); if(count($applicant_name)) { $profilepics3path = 'pd'.$records['fk_pd_id'].'/'.($applicant_name[0]['pd_document_name']); $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$profilepics3path,'30 minutes'); $is_person_met_pic = $singed_uri; } - $applicant_name_id = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => ($records['applicant_name'].'-id_proof')),PDDOCUMENTS); + $applicant_name_id = $this->PD_Model->selectCustomRecords(array('pd_document_name'),array('fk_pd_id' => $records['fk_pd_id'],'pd_document_title' => ($records['applicant_name'].'-id_proof'),'isactive' => 1),PDDOCUMENTS); if(count($applicant_name_id)) { $profilepics3path = 'pd'.$records['fk_pd_id'].'/'.($applicant_name_id[0]['pd_document_name']); diff --git a/api/application/models/Dash_Board_Model.php b/api/application/models/Dash_Board_Model.php index 656ec5f2..34994ac7 100644 --- a/api/application/models/Dash_Board_Model.php +++ b/api/application/models/Dash_Board_Model.php @@ -233,6 +233,40 @@ class Dash_Board_Model extends SPARQ_Model { return $query->result(); } + public function pdTATreport($applicant_id = null,$from_date = null,$to_date = null,$city = null,$branch = null,$lenderid = null) + { + $this->db->SELECT('*,TIMEDIFF(triggered,draft) as draft_to_triggered,TIMEDIFF(allocated,triggered) as triggered_to_allocated,TIMEDIFF(accepted,allocated) as allocated_to_accepted,TIMEDIFF(scheduled,accepted) as accepted_to_scheduled,TIMEDIFF(initiated,scheduled) as scheduled_to_initiated,TIMEDIFF(started,initiated) as initiated_to_started,TIMEDIFF(inprogress,started) as started_to_inprogress,TIMEDIFF(completed,inprogress) as inprogress_to_completed,TIMEDIFF(qc_complete,completed) as completed_to_qc_complete'); + $this->db->FROM(PDMIS); + if($applicant_id != null) + { + $this->db->LIKE('application_id',$applicant_id); + } + if($from_date != null) + { + $this->db->WHERE('date(triggered)>=',$from_date); + } + if($to_date != null) + { + $this->db->WHERE('date(triggered)<=',$to_date); + } + if($city != null) + { + $this->db->LIKE('city',$city); + } + if($branch != null) + { + $this->db->LIKE('branch',$branch); + } + // if($lenderid != null) + // { + // $this->db->LIKE('branch',$branch); + // } + + $query = $this->db->get(); + //print_r($this->db->last_query()); + return $query->result(); + } + } \ No newline at end of file diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 100b6c2a..18ac7028 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -1224,8 +1224,17 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { $loan_table_dispaly_rows[] = array('particulars' => 'Type of Property Being Mortgaged','details' => substr_count($loan_form['property_type_master'],'Others') ? $loan_form['property_type_others'] : $loan_form['property_type_master']); + //print_r($loan_form);die(); $owners_list = null;foreach($loan_form['owners_list_master'] as $owner){ $owners_list.=$owner.' and '; } + ///echo $owners_list; $owners_list = substr_replace($owners_list, '', strrpos($owners_list, 'and'),strlen($owners_list)); + if($owners_list == '') + { + if(isset($loan_form['owner_name_group'][0]['owner_name'])) + { + $owners_list = $loan_form['owner_name_group'][0]['owner_name']['name']; + } + } $loan_table_dispaly_rows[] = array('particulars' => 'Name of the current / proposed owner(s) of the Property being Mortgaged','details' => $owners_list); $loan_table_dispaly_rows[] = array('particulars' => 'Status of Construction','details' => $loan_form['construction_status_master']); @@ -2988,18 +2997,16 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $bindStockResult["service_stocks"]=array(); } //print_r($bindStockResult);die(); - count($bindStockResult['wholesale']) || count($bindStockResult['retail']) || count($bindStockResult['manufacturing'] || $bindStockResult["service_stocks"])? array_push($stockResult,$bindStockResult) : $stockResult; + count($bindStockResult['wholesale']) || count($bindStockResult['retail']) || count($bindStockResult['manufacturing']) || count($bindStockResult["service_stocks"])? array_push($stockResult,$bindStockResult) : array(); //echo "**********************"; //print_r($stockResult);die(); ?> -

Stock Details

-

@@ -3158,7 +3165,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); '.$stock_form_remarks.'

'; + echo '

'.$stock_form_remarks.'

'; //else {?> 'Name of the current / proposed owner(s) of the Property being Mortgaged','details' => $owners_list); $loan_table_dispaly_rows[] = array('particulars' => 'Status of Construction','details' => $loan_form['construction_status_master']); @@ -2940,13 +2947,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $bindStockResult["service_stocks"]=array(); } //print_r($bindStockResult);die(); - count($bindStockResult['wholesale']) || count($bindStockResult['retail']) || count($bindStockResult['manufacturing'] || $bindStockResult["service_stocks"])? array_push($stockResult,$bindStockResult) : $stockResult; + count($bindStockResult['wholesale']) || count($bindStockResult['retail']) || count($bindStockResult['manufacturing']) || count($bindStockResult["service_stocks"])? array_push($stockResult,$bindStockResult) : $stockResult; //echo "**********************"; //print_r($stockResult);die(); ?> @@ -3110,7 +3117,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); '.$stock_form_remarks.'

'; + echo '

'.$stock_form_remarks.'

'; //else {?> 'Name of the current / proposed owner(s) of the Property being Mortgaged','details' => $owners_list); $loan_table_dispaly_rows[] = array('particulars' => 'Status of Construction','details' => $loan_form['construction_status_master']);