diff --git a/api/application/config/routes.php b/api/application/config/routes.php
index 15d7594c..23761651 100755
--- a/api/application/config/routes.php
+++ b/api/application/config/routes.php
@@ -339,4 +339,5 @@ $route['saveAndUpdateTemplateFormsV2'] = 'Template_Management_Controller/saveTem
$route['deleteTemplateV2'] = 'Template_Management_Controller/deleteTemplateV2';
// $route['updateTemplateFormsV2'] = 'Template_Management_Controller/updateTemplateFormsV2';
$route['loadFullTemplateV2'] = 'Template_Management_Controller/loadFullTemplateV2';
-$route['formWiseJSONTemplateV2'] = 'Template_Management_Controller/formWiseJSONTemplateV2';
\ No newline at end of file
+$route['formWiseJSONTemplateV2'] = 'Template_Management_Controller/formWiseJSONTemplateV2';
+$route['disableformV2'] = 'Template_Management_Controller/disableformV2';
\ No newline at end of file
diff --git a/api/application/controllers/Template_Management_Controller.php b/api/application/controllers/Template_Management_Controller.php
index d0cfa998..cac604ad 100644
--- a/api/application/controllers/Template_Management_Controller.php
+++ b/api/application/controllers/Template_Management_Controller.php
@@ -1205,4 +1205,45 @@ class Template_Management_Controller extends REST_Controller {
}
}
}
+
+ public function disableformV2_get(){
+ if( (!isset($_GET['map_id'])) && (!isset($_GET['form_id'])) )
+ {
+ $data['dataStatus'] = false;
+ $data['status'] = REST_Controller::HTTP_NOT_FOUND;
+ $data['msg'] = 'Key Missing! Please Check again map-id and form-id';
+ $this->response($data,REST_Controller::HTTP_OK);
+ } else{
+ $map_id = $_GET['map_id'];
+ $form_id = $_GET['form_id'];
+ $fields = array('id');
+ $where_condition_array = array('map_id'=>$map_id,"form_id"=>$form_id,"isactive"=>1);
+ $json_table = $this->Template_Management_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATE_JSON_V2);
+ if(count($json_table)>0){
+ // $data['dataStatus'] = true;
+ // $data['status'] = REST_Controller::HTTP_OK;
+ // $data['json'] = $json_table[0]['json'];
+ // $this->response($data,REST_Controller::HTTP_OK);
+ $res = $this->Template_Management_Model->updateRecords(array('is_form_disabled' => 1),TEMPLATE_JSON_V2,$where_condition_array);
+ if($res){
+ $data['dataStatus'] = true;
+ $data['status'] = REST_Controller::HTTP_OK;
+ $data['msg'] = 'Successfully Disabled';
+ $this->response($data,REST_Controller::HTTP_OK);
+ }else{
+ $data['dataStatus'] = false;
+ $data['status'] = REST_Controller::HTTP_NOT_MODIFIED;
+ $data['msg'] = 'Something Went Wrong! Try again Later';
+ $this->response($data,REST_Controller::HTTP_OK);
+ }
+ }
+ else
+ {
+ $data['dataStatus'] = false;
+ $data['status'] = REST_Controller::HTTP_NOT_FOUND;
+ $data['msg'] = 'No Data Found Given Map-id and Form-id';
+ $this->response($data,REST_Controller::HTTP_OK);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php
index 07715c5e..310b278c 100644
--- a/api/application/helpers/pdalerts_helper.php
+++ b/api/application/helpers/pdalerts_helper.php
@@ -61,7 +61,7 @@ class PDALERTS
//SMC MWISE Custome PdNotification Don't Call.
$smc_lender_id = ENVIRONMENT == 'production' ? 7 : 35; //SMC lender id MWISE in live and demo
- if($smc_lender_id != $core_details[0]['fk_lender_id']){
+ if($smc_lender_id != $core_details[0]['fk_lender_id']){
//Trigger Custom Notification apart from entity and PD level notification config
CUSTOM_PDALERTS::custom_pdnotification($CI,$core_details);//die();
//END Trigger Custom Notification apart from entity and PD level notification config
@@ -710,7 +710,9 @@ class PDALERTS
$CI->db->SELECT("PDTRIGGER.pd_id,PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,ENTITY.short_name,
PDTRIGGER.scheduled_on,PDTRIGGER.pd_date_of_initiation,PDTRIGGER.updatedon,PDTRIGGER.encrypted_url,
PDTRIGGER.lender_applicant_id,PDTRIGGER.fk_pd_type,PDTRIGGER.pd_status,PDTRIGGER.vendor_status,
- PDTRIGGER.fk_pd_allocated_to,ALLOCATED.email as allocated_email,PDAPPLICANTSDETAILS.applicant_name,
+ PDTRIGGER.pd_contact_mobileno,PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDAPPLICANTSDETAILS.company_name,
+ PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,
+ PDTRIGGER.fk_pd_allocated_to,ALLOCATED.email as allocated_email,PDAPPLICANTSDETAILS.applicant_name,PDAPPLICANTSDETAILS.mobile_no,
concat(ALLOCATED.first_name,' ',ALLOCATED.last_name) as pdofficer_name,
PDTRIGGER.pd_agency_id,AGENCYLIST.agency_name,AGENCYLIST.mail_id as agency_mail");
$CI->db->FROM(PDTRIGGER." as PDTRIGGER");
@@ -718,6 +720,10 @@ class PDALERTS
$CI->db->JOIN(AGENCYLIST. ' as AGENCYLIST','PDTRIGGER.pd_agency_id = AGENCYLIST.agency_id','LEFT');
$CI->db->JOIN(USERPROFILE." as ALLOCATED","PDTRIGGER.fk_pd_allocated_to = ALLOCATED.userid",'LEFT');
$CI->db->JOIN(PDAPPLICANTSDETAILS." as PDAPPLICANTSDETAILS","PDTRIGGER.pd_id = PDAPPLICANTSDETAILS.fk_pd_id AND PDAPPLICANTSDETAILS.applicant_type = 1",'LEFT');
+ $CI->db->JOIN(STATE.' as STATE','PDTRIGGER.fk_state = STATE.state_id ','LEFT');
+ $CI->db->JOIN(CITY.' as CITY','PDTRIGGER.fk_city = CITY.city_id','LEFT');
+ $CI->db->JOIN(PINCODE.' as PINCODE','PDTRIGGER.pincode = PINCODE.pincode_id','LEFT');
+
$CI->db->WHERE("PDTRIGGER.pd_id",$pd_id);
$core_details = $CI->db->GET()->result_array();
// echo count($core_details);
@@ -730,19 +736,19 @@ class PDALERTS
// Mail - RCM
log_message('ERROR','#### MW AGENCY-MAIL CALLED TYPE 2 RCM '.$pd_id);
$mail_id = $core_details[0]['allocated_email'];
- $msg = "PD for Loan Application ID-".$core_details[0]['pd_sno']." (".$core_details[0]['applicant_name'].") have been triggered to the vendor.
This is an automatically generated notification mail. Please contact on vendor email id for any
- queries/update. ";
+ $msg = "PD for Loan Application ID-".$core_details[0]['pd_sno']." (".$core_details[0]['applicant_name'].") have been triggered to the vendor. ";
$subject = "PD allocated to vendor for application ID - ".$core_details[0]['pd_sno'] ." & ".$core_details[0]['applicant_name'];
// $mail->addBCC("ps9064515@gmail.com");
// $mail_id = 'ps9064515@gmail.com';
+ $ref_str = "vendor email id";
}else if($flag == 1){
// mail - Agency
// $mail_id = "venbalap08@gmail.com";
log_message('ERROR','#### MW AGENCY-MAIL CALLED TYPE 1 AGENCY '.$pd_id);
$mail_id = $core_details[0]['agency_mail'];
- $msg = "PD for Loan Application ID - ".$core_details[0]['pd_sno'] ." & ". $core_details[0]['applicant_name']." have been allocated to you.
This is an automatically generated notification mail. Please contact on client email id for any
- queries/update. ";
+ $msg = "PD for Loan Application ID - ".$core_details[0]['pd_sno'] ." & ". $core_details[0]['applicant_name']." have been allocated to you. ";
$subject = "PD allocated for application ID - ".$core_details[0]['pd_sno'] ." & ". $core_details[0]['applicant_name'];
+ $ref_str = "client email id";
// $mail->addBCC("venbalap08@gmail.com");
}else if($flag == 3){
log_message('ERROR','#### MW-AGENCY MAIL CALLED TYPE 3 TRIGGER '.$pd_id);
@@ -755,8 +761,19 @@ class PDALERTS
$msg = $pd_notification_msg[0]['lender'];
$msg = self::stringReplace($msg,$core_details,'MAIL');
$subject = "PD allocated for application ID - ".$core_details[0]['pd_sno'] ." & ". $core_details[0]['applicant_name'];
+ $ref_str = "";
// $mail->addBCC("sanjeev.p@venbainfotech.com");
}
+ $company_name = $core_details[0]['company_name'] ? $core_details[0]['company_name'] : "-";
+ $msg .= "
1. Name of the firm : ".$company_name
+ ."
2. Address : ".$core_details[0]['addressline1'].",".$core_details[0]['city_name'].",".$core_details[0]['state_name']."-".$core_details[0]['pincode']."."
+ ."
3. Loan Amount : ".$core_details[0]['loan_amount']
+ ."
4. Name of the loan applicant : ".$core_details[0]['applicant_name']
+ ."
5. Contact Number : ".$core_details[0]['mobile_no'];
+ if(!empty($ref_str)){
+ $msg .= "
This is an automatically generated notification mail. Please contact on ".$ref_str." for any
+ queries/update. ";
+ }
$mail->IsSMTP(); // Telling the class to use SMTP
$mail->SMTPAuth = true;
diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php
index 70b8fad5..c41a5e64 100644
--- a/api/application/models/PD_Model.php
+++ b/api/application/models/PD_Model.php
@@ -2351,7 +2351,7 @@ class PD_Model extends SPARQ_Model {
$map_id = "";
}
}
- $this->db->SELECT('TEMPLATE_JSON_V2.map_id,TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_order,PDFORMS.pd_form_level_order,PDFORMS.pd_form_name as form_name');
+ $this->db->SELECT('TEMPLATE_JSON_V2.map_id,TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_order,PDFORMS.pd_form_level_order,PDFORMS.pd_form_name as form_name,TEMPLATE_JSON_V2.is_form_disabled');
$this->db->FROM(TEMPLATE_JSON_V2.' as TEMPLATE_JSON_V2');
$this->db->JOIN(PDFORMS.' as PDFORMS','TEMPLATE_JSON_V2.form_id = PDFORMS.pd_form_id','LEFT');
$this->db->WHERE('TEMPLATE_JSON_V2.isactive',1);
@@ -2593,4 +2593,11 @@ class PD_Model extends SPARQ_Model {
return $result_data;
}
+
+ public function testSection($id){
+ $this->db->SELECT('*')->FROM("t_pd_form_details_json")->WHERE('fk_pd_id',$id)->WHERE('isactive',1)
+ ->WHERE('fk_form_id',22)->WHERE('company_id',1);
+ $query = $this->db->get();
+ return $query->result();
+ }
}
\ No newline at end of file
diff --git a/api/application/models/Template_Management_Model.php b/api/application/models/Template_Management_Model.php
index 00dd36b1..a36d365e 100644
--- a/api/application/models/Template_Management_Model.php
+++ b/api/application/models/Template_Management_Model.php
@@ -314,7 +314,7 @@ class Template_Management_Model extends SPARQ_Model {
}
public function getTemplateFormsV2($value){
- $this->db->SELECT('TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_name as form_name,TEMPLATE_JSON_V2.json');
+ $this->db->SELECT('TEMPLATE_JSON_V2.form_id,PDFORMS.pd_form_name as form_name,TEMPLATE_JSON_V2.json,TEMPLATE_JSON_V2.is_form_disabled');
$this->db->FROM(TEMPLATE_JSON_V2.' as TEMPLATE_JSON_V2');
$this->db->JOIN(PDFORMS.' as PDFORMS','TEMPLATE_JSON_V2.form_id = PDFORMS.pd_form_id','LEFT');
$this->db->WHERE('TEMPLATE_JSON_V2.isactive',1);