diff --git a/api/application/config/constants.php b/api/application/config/constants.php
index 752e3c48..94fad650 100644
--- a/api/application/config/constants.php
+++ b/api/application/config/constants.php
@@ -92,6 +92,8 @@ defined('ROUTE_LOGIN_Y') OR define('ROUTE_LOGIN_Y', '(getPDReportPDFprevi
defined('ROUTE_LOGIN_Z') OR define('ROUTE_LOGIN_Z', 'getSalesPDImgDataCusLink'); // no errors
defined('ROUTE_LOGIN_W') OR define('ROUTE_LOGIN_W', 'saveSalesPDImage'); // no errors
defined('ROUTE_LOGIN_V') OR define('ROUTE_LOGIN_V', 'generateSatelliteImg'); // no errors
+defined('ROUTE_LOGIN_U') OR define('ROUTE_LOGIN_U', 'generateOTP');
+defined('ROUTE_LOGIN_T') OR define('ROUTE_LOGIN_T', 'verifyOTP');
defined('ROUTE_LOGIN_A') OR define('ROUTE_LOGIN_A', 'getAuditedImages'); // no errors
defined('TURN_SERVER_API') OR define('TURN_SERVER_API', 'getServerInfo'); // no errors
defined('VIDEO_CHAT_ACCESS_KEY_API') OR define('VIDEO_CHAT_ACCESS_KEY_API', 'getVideoChatAccessKey'); // no errors
diff --git a/api/application/config/customconfig_one.php b/api/application/config/customconfig_one.php
index 7b09fcba..da54dc42 100644
--- a/api/application/config/customconfig_one.php
+++ b/api/application/config/customconfig_one.php
@@ -112,7 +112,7 @@ cwIDAQAB
// ************ SMSGUPSHUP Configurations ***********************//
$config['sms_api_user_id'] = getenv('SMS_API_USER_ID');
$config['sms_api_pwd'] = getenv('SMS_API_PWD');
-$config['sms_gupshup_url'] = 'http://enterprise.smsgupshup.com/GatewayAPI/rest?method=SendMessage&send_to={{send_to_mobile_no}}&msg={{send_msg}}&msg_type=TEXT&userid={{sms_api_user_id}}&auth_scheme=plain&password={{sms_api_pwd}}&version=1.1&format=text';
+$config['sms_gupshup_url'] = 'http://enterprise.smsgupshup.com/GatewayAPI/rest?method=SendMessage&send_to={{send_to_mobile_no}}&msg={{send_msg}}&msg_type=TEXT&userid={{sms_api_user_id}}&auth_scheme=plain&password={{sms_api_pwd}}&v=1.1&format=text';
$config['master_tables_field_names'] = array('INDUSTRYCLASSIFICATION' => 'name','UOM' => 'name','OCCUPATIONMEMBERS' => 'name','EDUQUALIFICATION' => 'qualification_name', 'TYPEOFACTIVITY' => 'name','RELATIONSHIPS' => 'name','FREQUENCY' => 'name', 'CUSTOMERBEHAVIOUR' => 'description', 'CUSTOMERSEGMENT' => 'name','DESIGNATION' => 'designation', 'EARNINGMEMBERSSTATUS' => 'earning_member_status','EDUQUALIFICATION' => 'qualification_name','ADDRESSTYPE' => 'address_type','LOCALITY' => 'locality_name','ASSETTYPE' => 'name','PROPERTIES' => 'name','INVESTMENTTYPE' => 'name','INSURANCETYPE' => 'name','PERSONSMET' => 'person_met_name','RESIDENCEOWNERSHIP' => 'name','PAYMENTMODE' => 'name','ACCOUNTTYPE' => 'name','SOURCEOFOTHERINCOME' => 'name','MORTAGEPROPERTYTYPE' => 'name','ENDUSEOFLOAN' => 'enduse_of_loan','SOURCEOFBALANCETRANSFER' => 'name', 'STATUSOFCONSTRUCTION' => 'name','BTLENDERLIST'=>'lender_name','MORTAGEPROPERTIES'=>'property_name','EXISTINGLOANTYPES'=>'loan_type_name','PDAPPLICANTSDETAILS'=>'applicant_name','RELATIONWITHBUSINESS'=>'relation_with_business_name','BUSINESSENTITYTYPE'=>'business_entity_type_name','COMPANYRELATIONSHIPS'=>'name','STATE'=>'name','CITY'=>'name','COUNTRY'=>'country_name','BOUNCEMASTER'=>'bounce_reason_name','BUSINESSEXPENSES'=>'expense_item','BUSINESSINCOME'=>'business_income_item','COMMENTSONLOCALITY'=>'rating','COMPANY'=>'company_id','LOCALITY'=>'locality_name','NONINDIVIDUALENTITIES'=>'non_individual_entity_name','PDFORMS'=>'pd_form_name','PDLOCATIONAPPROACH'=>'description','PDTYPE'=>'type_name','PDNOTIFICATION'=>'pd_status','QUESTIONCATEGORY'=>'category_name','ROLES'=>'role_name','SUBPRODUCTS'=>'name','TITLES'=>'name','PINCODE'=>'pincode','PRODUCTS'=>'name','ENTITYTYPE'=>'name','PDTEAM'=>'team_name','ENTITY'=>'short_name','PDSTATUS'=>'pd_status_name','LISTOFMASTERS'=>'master_name','OTPREJECTION'=>'rejection_reason','ENDUSEOFTOPUP'=>'end_use_of_topup','VEHICLETYPE'=>'vehicle_type_name','PDOFFICERRECOMMENDATIONS'=>'pdofficer_recommendation','REGIONS'=>'name','PRICINGINFO'=>'pricing_info_id','SALESVENDORLIST' => 'vendor','SALESEQUIPMENTLIST' => 'equipment');
diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php
index 375e4067..f2a5e8e9 100644
--- a/api/application/controllers/PD_Controller.php
+++ b/api/application/controllers/PD_Controller.php
@@ -20,7 +20,7 @@ class PD_Controller extends REST_Controller {
//class level variable declaration
//protected $external_path;
- private $photo_names = array('selfie_with_person_met' => array('Person met','18',0,0),'person_met_id' => array('Person met ID Proof','18',0,0),'address_proof_visited' => array('Address Proof','5',0,0),'name_board_seen' => array('Name Board Seen','13',0,0),'machinary_image' => array('Machinery Image','22',0,0),'gst_Regn_cert_pic' => array('GST Regn Cert','13',0,0),'pf_regn_pic' => array('PF Regn','13',0,0),'esic_regn_pic' => array('ESIC Regn','13',0,0),'export_import_cert_pic' => array('Export Import Cert','13',0,0),'factory_cert_pic' => array('Factory Cert','13',0,0),'shop_eat_act_cert_pic' => array('Shop Est Act Cert','13',0,0),'eb_bill_pic' => array('EB Bill','13',0,0),'practice_cert_pic' => array('Cert of Practice','13',0,0),'fire_noc_pic' => array('Fire NOC','13',0,0),'stock_image' => array('Stock image','11',1,1),'client_image' => array('Client Bills','2',1,1),'supplier_image' => array('Supplier Bills','1',1,1));
+ private $photo_names = array('selfie_with_person_met' => array('Person met','18',0,0),'person_met_id' => array('Person met ID Proof','18',0,0),'address_proof_visited' => array('Address Proof','5',0,0),'name_board_seen' => array('Name Board Seen','13',0,0),'machinery_image' => array('Machinery Image','22',0,0),'gst_Regn_cert_pic' => array('GST Regn Cert','13',0,0),'pf_regn_pic' => array('PF Regn','13',0,0),'esic_regn_pic' => array('ESIC Regn','13',0,0),'export_import_cert_pic' => array('Export Import Cert','13',0,0),'factory_cert_pic' => array('Factory Cert','13',0,0),'shop_eat_act_cert_pic' => array('Shop Est Act Cert','13',0,0),'eb_bill_pic' => array('EB Bill','13',0,0),'practice_cert_pic' => array('Cert of Practice','13',0,0),'fire_noc_pic' => array('Fire NOC','13',0,0),'stock_image' => array('Stock image','11',1,1),'client_image' => array('Client Bills','2',1,1),'supplier_image' => array('Supplier Bills','1',1,1));
private $existing_imges = array();
function __construct()
@@ -1108,12 +1108,30 @@ class PD_Controller extends REST_Controller {
$mwise_lender_id = (ENVIRONMENT == 'production' ? 7 : 35);
$current_lender_id = (isset($pd_details['fk_lender_id']) && $pd_details['fk_lender_id'] != '' ? $pd_details['fk_lender_id'] : $temp_data[0]['fk_lender_id']);
$is_mwise_lender = ( $current_lender_id == $mwise_lender_id ? true : false);
+ $this->load->model('User_Management_Model');
+ $user_details = $this->User_Management_Model->getUserDetails($pd_details['fk_updatedby']);
+ $role = $user_details['data'][0]['user_role'];
+ if($is_mwise_lender && (!empty($agency_id)) && ($agency_id != null) && ((int)$agency_id != 0) && ($pd_details['pd_status'] == "TRIGGERED") && ($role == 30)){
+ $pd_details['vendor_status'] = null;
+ $pd_details['pd_agency_id'] = null;
+ $pd_details['pd_status'] = $pd_details['pd_status'];
+ }
+
if($is_mwise_lender && (!empty($agency_id)) && ($agency_id != null) && ((int)$agency_id != 0) && ($pd_details['pd_status'] != "TRIGGERED" || $pd_details['pd_status'] != "QC_COMPLETED"))
{
+ //newly implemented
+ if(($pd_details['pd_status'] == "CANCELLED") && ($role == 27 || $role == 26 || $role == 30)){
+ $pd_details['vendor_status'] = null;
+ $pd_details['pd_agency_id'] = null;
+ $pd_details['pd_status'] = $pd_details['pd_status'];
+ }
+ else{
$pd_details['vendor_status'] = $pd_details['pd_status'];
- $pd_details['pd_status'] = ALLOCATED_TO_FIA;
+ $pd_details['pd_status'] = ALLOCATED_TO_FIA;}
}
+
+
$where_condition_array = array('pd_id' => $pd_details['pd_id'],'random_string' => $pd_details['random_string']);
$pd_id_modified = $this->PD_Model->updateRecords($pd_details,PDTRIGGER,$where_condition_array);
@@ -11296,7 +11314,8 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
public function smcStuffs($pd_details,$existing_pd_details = array())
{
- // echo "i am here";exit();
+ // echo "i am here";
+ // echo $pd_details['pd_status'];
//if is this MWISE (SMC Credit PD) lender then auto allocate to RCM users and make pd status as allocated
//get RCM user for auto allocation based on pd address
@@ -11308,6 +11327,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$current_lender_id = (isset($pd_details['fk_lender_id']) && $pd_details['fk_lender_id'] != '' ? $pd_details['fk_lender_id'] : $existing_pd_details[0]['fk_lender_id']) ;
$is_mwise_lender = ( $current_lender_id == $mwise_lender_id ? true : false);
// echo !$is_mwise_lender;
+ // echo "curr".$current_lender_id;die();
if($is_mwise_lender && (($pd_details['pd_status'] == TRIGGERED) || ($pd_details['pd_status'] == ALLOCATED)))
{
$regional_credit_manager = $this->PD_Model->getRCM($pd_details['fk_state']);//pass pd address city as param
diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php
index fc6c57ee..5f90ceb3 100644
--- a/api/application/controllers/SMC_Credit_PD_Controller.php
+++ b/api/application/controllers/SMC_Credit_PD_Controller.php
@@ -1050,7 +1050,7 @@ class SMC_Credit_PD_Controller extends REST_Controller {
//$SMC_CREDIT_PD = $this->SMC_Credit_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC');
- $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno, PDTYPE.type_name, PDTRIGGER.lender_applicant_id, PDTRIGGER.fk_product_id, PRODUCT.abbr, PDTRIGGER.pd_status, PDAPPLICANTSDETAILS.applicant_name, (SELECT createdon FROM h_common_masters where PDTRIGGER.pd_id = primary_key AND field_name = "pd_status" order by log_id DESC limit 1) as updatedon, (SELECT m_user_profile.first_name FROM h_common_masters JOIN m_user_profile on h_common_masters.new_value = m_user_profile.userid where PDTRIGGER.pd_id = primary_key AND field_name = "fk_pd_allocated_to" order by log_id DESC limit 1) as officer_name,PDTRIGGER.mis_report_remarks');
+ $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno, PDTYPE.type_name, PDTRIGGER.lender_applicant_id, PDTRIGGER.fk_product_id, PRODUCT.abbr, PDTRIGGER.pd_status, PDAPPLICANTSDETAILS.applicant_name, (SELECT createdon FROM h_common_masters where PDTRIGGER.pd_id = primary_key AND field_name = "pd_status" order by log_id DESC limit 1) as updatedon, (SELECT concat(m_user_profile.first_name," " ,m_user_profile.last_name) FROM h_common_masters JOIN m_user_profile on h_common_masters.new_value = m_user_profile.userid where PDTRIGGER.pd_id = primary_key AND field_name = "fk_pd_allocated_to" order by log_id DESC limit 1) as officer_name,PDTRIGGER.mis_report_remarks');
$this->db->FROM(PDTRIGGER.' as PDTRIGGER');
$this->db->JOIN(PRODUCTS.' as PRODUCT','PDTRIGGER.fk_product_id = PRODUCT.product_id','LEFT');
@@ -1549,6 +1549,7 @@ public function filterSalesPDList_post() {
// print_r($view_data['pd_section_data'][15]);die();
$view_data['smc_images'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name!=' => 'satellite'),SMC_CREDIT_PD_DOCS);
$view_data['satellite'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name=' => 'satellite'),SMC_CREDIT_PD_DOCS);
+ // print_r($view_data['smc_images']);die();
//print_r(count($view_data['smc_images']));die();
//score card part
@@ -1813,7 +1814,7 @@ public function filterSalesPDList_post() {
$this->response($data,REST_Controller::HTTP_OK);
}
- //2 roles = SMC Vendor PD officer and SMC Vendor PD manager
+ //3 roles = SMC Vendor PD officer and SMC Vendor PD manager,lender admin
function getSMCVendorPDOfficersList_get(){
// $role_id = $this->get('role_id');
diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php
index 67ab3023..b1c28459 100644
--- a/api/application/controllers/Sales_PD_Controller.php
+++ b/api/application/controllers/Sales_PD_Controller.php
@@ -157,7 +157,7 @@ class Sales_PD_Controller extends REST_Controller {
function prepareSalesPDReport($sales_pd_id,$api = true)
{
log_message('ERROR','####PREPARE SALESPD REPORT CALLED'.$sales_pd_id);
- $columns = array('SALES_PD_DATA.*','ENTITY.short_name','PRODUCT.abbr');
+ $columns = array('SALES_PD_DATA.*','ENTITY.short_name','PRODUCT.abbr','USERPROFILE.smc_emp_code');
$table = SALES_PD_DATA.' as SALES_PD_DATA';
$joins = array(
array('table' => ENTITY. ' as ENTITY',
@@ -165,14 +165,16 @@ class Sales_PD_Controller extends REST_Controller {
'jointype' => 'INNER'),
array('table' => PRODUCTS. ' as PRODUCT',
'condition' =>'SALES_PD_DATA.product_id = PRODUCT.product_id',
- 'jointype' => 'INNER')
+ 'jointype' => 'INNER'),
+ array('table' => USERPROFILE. ' as USERPROFILE',
+ 'condition' =>'SALES_PD_DATA.createdby = USERPROFILE.userid',
+ 'jointype' => 'LEFT')
);
$where_condition_array = array('SALES_PD_DATA.sales_pd_id' => $sales_pd_id);
$sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array);
$pd_type = "";
if($sales_pd_data[0]['sales_pd_type'] == 1){$pd_type = "Physical PD-"; }else if($sales_pd_data[0]['sales_pd_type'] == 2){$pd_type = "Tele PD-";}
- // print_r($sales_pd_data);die();
if($sales_pd_data)
{
@@ -313,7 +315,10 @@ class Sales_PD_Controller extends REST_Controller {
// print_r ($where_condition_array);
// ----END OF FILTERING THE LAST 10 DAYS RECORDS---
-
+ $MWISELender = (ENVIRONMENT == 'production' ? 7 : 35);
+ if($role && is_numeric($role) && $role == 11 && $MWISELender == $lender_id){
+ // $where_condition_array['SALES_PD_DATA.product_id'] = (ENVIRONMENT == 'production' ? 23 : 22);
+ }else{
if($role && is_numeric($role) && $role == 15) //if role area sales head the pull all meq cases
{
$where_condition_array['SALES_PD_DATA.product_id'] = (ENVIRONMENT == 'production' ? 23 : 22);
@@ -323,7 +328,7 @@ class Sales_PD_Controller extends REST_Controller {
{
$where_condition_array['SALES_PD_DATA.createdby'] = $user_id;
}
-
+ }
$order_by = 'SALES_PD_DATA.sales_pd_id';
$sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC','',$or_where);
@@ -961,7 +966,7 @@ class Sales_PD_Controller extends REST_Controller {
public function testAPISalesPD_post()
{
log_message('ERROR','####testAPISalesPD CALLED 2897');
- // PDALERTS::sendSalesPDMail($this,2897,"Delhi");die();
+ // PDALERTS::sendSalesPDMail($this,3019,869);die();
//PDALERTS::sendSalesPDMail($this,32);die();
satellite_image::getSatelliteImage(2897,2);//die();
// $url = "https://maps.googleapis.com/maps/api/staticmap?center=12.9788141,80.1871334&zoom=14&markers=color:red|12.9788141,80.1871334&size=800x300&maptype=roadmap&key=AIzaSyA3lYDYxwtn5vLSl45SOKbtK7G6cEyXGr0";
diff --git a/api/application/controllers/Template_Management_Controller.php b/api/application/controllers/Template_Management_Controller.php
index be86dbf1..41b752c5 100644
--- a/api/application/controllers/Template_Management_Controller.php
+++ b/api/application/controllers/Template_Management_Controller.php
@@ -946,8 +946,11 @@ class Template_Management_Controller extends REST_Controller {
}else{
$result_array[$inx]["forms"] = array();
}
- $buiness_arr = array("form_id"=> "13","form_name"=> "Business Information","json"=> "","is_form_disabled"=> "0","is_business_form"=> "1","is_group_form"=> "1");
- array_push($result_array[$inx]["forms"],$buiness_arr);
+ array_push($result_array[$inx]["forms"],array("form_id"=> "13","form_name"=> "Business Information","json"=> "","is_form_disabled"=> "0","is_business_form"=> "1","is_group_form"=> "1","pd_form_order"=>"5"));
+ array_push($result_array[$inx]["forms"],array("form_id"=> "18","form_name"=> "General Information","json"=> "","is_form_disabled"=> "0","is_business_form"=> "0","is_group_form"=> "0","pd_form_order"=>"2"));
+ array_push($result_array[$inx]["forms"],array("form_id"=> "26","form_name"=> "Photograph","json"=> "","is_form_disabled"=> "0","is_business_form"=> "0","is_group_form"=> "0","pd_form_order"=>"24"));
+ // $buiness_arr = array("form_id"=> "13","form_name"=> "Business Information","json"=> "","is_form_disabled"=> "0","is_business_form"=> "1","is_group_form"=> "1");
+ // array_push($result_array[$inx]["forms"],$buiness_arr);
}
if(count($result_array)>0)
{
@@ -1025,6 +1028,8 @@ class Template_Management_Controller extends REST_Controller {
// API 3 : to save and Update the Mapping Details and return the Pkid
public function saveTemplateV2_post(){
+ // draft,approve,completed
+ // strtoupper(str_replace(' ', '', $form_status));
$records = $this->post("records");
// print_r($records);die();
if( (!isset($records['entity_id'])) || (!isset($records['product_id'])) || (!isset($records['customer_segment_id'])) )
@@ -1081,16 +1086,27 @@ class Template_Management_Controller extends REST_Controller {
$map_id = $records['map_id'];
$form_id = $records['form_id'];
$fields = array('id');
+ $status = strtoupper(str_replace(' ', '',$records['form_status']));
$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){
- $this->db->where('id',$json_table[0]['id']);
- $this->db->set('isactive',0);
- $this->db->update(TEMPLATE_JSON_V2);
- }
- $json = json_encode($records['json'],true);
- $fields = array('form_id' => $form_id,'json' => $json,'map_id'=>$map_id);
- $json_pk_id = $this->Template_Management_Model->saveTemplateMapping($fields,TEMPLATE_JSON_V2);
+ if(count($json_table)>0 && $status == "COMPLETED"){
+ $this->db->where('id',$json_table[0]['id']);
+ $this->db->set('isactive',0);
+ $this->db->update(TEMPLATE_JSON_V2);
+ }else if(count($json_table)>0 && ($status == "DRAFT" || $status == "APPROVED" )){
+ $json = json_encode($records['json'],true);
+ $this->db->where('id',$json_table[0]['id']);
+ $this->db->where('map_id',$map_id);
+ $this->db->where('form_id',$form_id);
+ $this->db->where('is_form_status',$status);
+ $this->db->set('json',$json);
+ $this->db->update(TEMPLATE_JSON_V2);
+ $json_pk_id = $json_table[0]['id'];
+ }else{
+ $json = json_encode($records['json'],true);
+ $fields = array('form_id' => $form_id,'json' => $json,'map_id'=>$map_id,'is_form_status'=>$status);
+ $json_pk_id = $this->Template_Management_Model->saveTemplateMapping($fields,TEMPLATE_JSON_V2);
+ }
if($json_pk_id)
{
$data['dataStatus'] = true;
@@ -1413,6 +1429,7 @@ class Template_Management_Controller extends REST_Controller {
$count = isset($onchange_properties) ? count($onchange_properties) : 0 ;
if($count>0 && !empty($onchange_properties)){
foreach ($onchange_properties as $key1 => $value1) {
+ // echo $value1['expression'];
// if($value1['question_key'] == 'Payment_Terms'){
// echo "I have step 1";
// echo($value['question_key']);
@@ -1433,6 +1450,8 @@ class Template_Management_Controller extends REST_Controller {
// print_r($this->call_arr2($value1['questions'][$j]['question']));
// echo "
parent ".$value['question_key'];
$latest_quest = isset($value1['questions'][$j]['question_key']) ? $value1['questions'] : $value1['questions'][$j]['question'];
+ // $latest_quest = $value1['expression'] ? $latest_quest.$value1['expression'] : $latest_quest;
+ // echo " Key ".$value1['insert_index'];
$temp[$i] = $this->call_arr1($latest_quest);
$arr2 = $this->call_arr2($latest_quest);
$return_arr[$i] = $this->merged_arr($temp[$i],$arr2);
diff --git a/api/application/controllers/User_Management_Controller.php b/api/application/controllers/User_Management_Controller.php
index c8b96244..65717bef 100644
--- a/api/application/controllers/User_Management_Controller.php
+++ b/api/application/controllers/User_Management_Controller.php
@@ -565,10 +565,10 @@ else {
$OTP = substr($string2,0,6);
// $msg = "Your OTP for forgot password is ".$OTP.".";
// SMS_GUPSHUP::sendSMS($msg,$mobile);
- $msg = "OTP for starting your personal discussions with the verification officer is ".$OTP.".Pls share this only when the officer has reached your place";
- // $msg = "PD for Loan Applicant ".$OTP." ID - ".$userid." has been triggered.";
-
- SMS_GUPSHUP::sendSMS($msg,$mobile,array('userid' => $userid,'status' => 'STARTED','msg' => 'Started OTP msg from user controlller'));
+ // $msg = "OTP for starting your personal discussions with the verification officer is ".$OTP.".Pls share this only when the officer has reached your place";
+ // $msg = "PD for Loan Applicant ".$OTP." ID - ".$OTP." has been triggered.";
+ $msg = "PDGenie OTP is : ".$OTP;
+ SMS_GUPSHUP::sendSMS($msg,$mobile,array('id'=>$userid,'msg'=>"Your OTP is ".$OTP." from User Management Controller"));
$this->User_Management_Model->updateRecords(array('OTP'=>$OTP),USERPROFILE,array('userid'=>$userid));
$data['dataStatus'] = true;
diff --git a/api/application/helpers/authorization_helper.php b/api/application/helpers/authorization_helper.php
index e9fd42ba..fddb2e3e 100644
--- a/api/application/helpers/authorization_helper.php
+++ b/api/application/helpers/authorization_helper.php
@@ -72,7 +72,7 @@ class AUTHORIZATION
}
- if( $routingName == ROUTE_LOGIN_X || $routingName == ROUTE_LOGIN_Y || $routingName == ROUTE_LOGIN_Z || $routingName == ROUTE_LOGIN_W || $routingName == ROUTE_LOGIN_V || $routingName == ROUTE_LOGIN_A || $routingName == TURN_SERVER_API || $routingName == VIDEO_CHAT_ACCESS_KEY_API || $routingName ==SAVEROOMINFO_API || $routingName ==SAVESMCCREDITPDIMAGE_API || $routingName ==GETSMCPDIMGSECTIONDATA_API)
+ if( $routingName == ROUTE_LOGIN_X || $routingName == ROUTE_LOGIN_Y || $routingName == ROUTE_LOGIN_Z || $routingName == ROUTE_LOGIN_W || $routingName == ROUTE_LOGIN_V || $routingName == ROUTE_LOGIN_A || $routingName == TURN_SERVER_API || $routingName == VIDEO_CHAT_ACCESS_KEY_API || $routingName ==SAVEROOMINFO_API || $routingName ==SAVESMCCREDITPDIMAGE_API || $routingName ==GETSMCPDIMGSECTIONDATA_API || $routingName == ROUTE_LOGIN_T || $routingName == ROUTE_LOGIN_U)
{
return true;
}
diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php
index 20ecc858..5cb0eef7 100644
--- a/api/application/helpers/pdalerts_helper.php
+++ b/api/application/helpers/pdalerts_helper.php
@@ -544,16 +544,17 @@ class PDALERTS
$mail->Password = "noreply@ssa"; // "The password"
$mail->Port = 465; // "The port"
$mail_id = 'ssa@venbainfotech.com';
- // $mail_id = 'sanjeev.p@venbainfotech.com';
if(ENVIRONMENT == 'testing' && in_array((string)$city,$city_arg)){ $mail->addBCC("venkiraj0@gmail.com");}
if(ENVIRONMENT == 'production')
{
$mail_id = 'cpa@smcfinance.com';
+ $mail->addBCC("cpumumbai@smcfinance.com");
+ $mail->addBCC("cpa@smcfinance.com");
$mail->addBCC("neville@sinemanagement.com");
$mail->addBCC("ssa@venbainfotech.com");
$mail->addAddress('cpumumbai@smcfinance.com');
if(in_array((string)$city,$city_arg)){ $mail->addBCC("satendersingh@smcfinance.com");}
- //$mail->addBCC("vitvelz@gmail.com");
+ // $mail->addBCC("vitvelz@gmail.com");
} // Name is optional }
$mail->addAddress($mail_id);
@@ -714,7 +715,7 @@ class PDALERTS
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,
+ concat(ALLOCATED.first_name,' ',ALLOCATED.last_name) as pdofficer_name,PDTRIGGER.excel_file_id,
PDTRIGGER.pd_agency_id,AGENCYLIST.agency_name,AGENCYLIST.mail_id as agency_mail");
$CI->db->FROM(PDTRIGGER." as PDTRIGGER");
$CI->db->JOIN(ENTITY." as ENTITY","PDTRIGGER.fk_lender_id = ENTITY.entity_id",'LEFT');
@@ -726,7 +727,7 @@ class PDALERTS
$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();
-
+ // print_r($core_details);die();
$CI->db->SELECT("USERPROFILE.email");
$CI->db->FROM(USERPROFILE." as USERPROFILE");
$CI->db->JOIN(USERPROFILEROLES." as USERPROFILEROLES", "USERPROFILEROLES.isactive = 1 and USERPROFILEROLES.fk_userid = USERPROFILE.userid");
@@ -744,21 +745,21 @@ class PDALERTS
else{
$mail_id = $rcm_mail_id;
}
- log_message('ERROR','#### MW AGENCY-MAIL CALLED TYPE 2(RCM and CM) PD ID :'.$pd_id." & MAIL : ".$mail_id);
- $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'];
+ log_message('ERROR','#### MW AGENCY-MAIL CALLED TYPE 2(RCM and CM) PD ID :'.$pd_id." and MAIL : ".$mail_id);
+ $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'];
$ref_str = "vendor email id";
}
if($flag == 1){ // Mail Content For - Agency ONLY
$mail_id = $core_details[0]['agency_mail'];
- log_message('ERROR','#### MW AGENCY-MAIL CALLED TYPE 1(AGENCY) PD ID :'.$pd_id." & MAIL : ".$mail_id);
- $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'];
+ log_message('ERROR','#### MW AGENCY-MAIL CALLED TYPE 1(AGENCY) PD ID :'.$pd_id." and MAIL : ".$mail_id);
+ $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";
}
if($flag == 3){ // Mail Conent For - Allocated Person ONLY
$mail_id = $core_details[0]['allocated_email'];
- log_message('ERROR','#### MW-AGENCY MAIL CALLED TYPE 3(Normal Allocated Person) PD ID :'.$pd_id." & MAIL : ".$mail_id);
+ log_message('ERROR','#### MW-AGENCY MAIL CALLED TYPE 3(Normal Allocated Person) PD ID : '.$pd_id." and MAIL : ".$mail_id);
$CI->db->SELECT("*");
$CI->db->FROM(PDNOTIFICATIONMSG." as PDNOTIFICATIONMSG");
$CI->db->WHERE("PDNOTIFICATIONMSG.pd_status",ALLOCATED);
@@ -766,15 +767,27 @@ class PDALERTS
$pd_notification_msg = $CI->db->GET()->result_array();
$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'];
+ $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'] : "-";
+
+ if(!empty($core_details[0]['excel_file_id']) && $core_details[0]['excel_file_id'] != null){
+ $CI->db->SELECT("PDAPPLICANTSDETAILS.applicant_name,PDAPPLICANTSDETAILS.mobile_no");
+ $CI->db->FROM(PDAPPLICANTSDETAILS." as PDAPPLICANTSDETAILS");
+ $CI->db->WHERE("PDAPPLICANTSDETAILS.fk_pd_id",$pd_id);
+ $applicatant_details = $CI->db->GET()->result_array();
+ $company_name = $applicatant_details[0]['applicant_name'] ? $applicatant_details[0]['applicant_name'] : "-";
+ $applicant_name = $applicatant_details[1]['applicant_name'] ? $applicatant_details[1]['applicant_name'] : "-";
+ }else{
+ $company_name = $core_details[0]['company_name'] ? $core_details[0]['company_name'] : "-";
+ $applicant_name = $core_details[0]['applicant_name'] ? $core_details[0]['applicant_name'] : "-";
+ }
+ // $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']
+ ."
4. Name of the loan applicant : ".$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
diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php
index bd384b4c..86fc5c84 100644
--- a/api/application/models/PD_Model.php
+++ b/api/application/models/PD_Model.php
@@ -2313,7 +2313,7 @@ class PD_Model extends SPARQ_Model {
function getSMCVendorPDOfficersList($agency_id){
// if(empty($role)){
// $role = array(28,29);
- $role = array(29);
+ $role = array(29,30);
// }
$this->db->select('USERPROFILE.userid,USERPROFILE.first_name,USERPROFILE.last_name,USERPROFILE.first_name as name,USERPROFILEROLES.user_role');
$this->db->from(USERPROFILE.' as USERPROFILE');
diff --git a/api/application/models/SMC_Credit_PD_Model.php b/api/application/models/SMC_Credit_PD_Model.php
index 54cc4fc2..c8ed2aa8 100644
--- a/api/application/models/SMC_Credit_PD_Model.php
+++ b/api/application/models/SMC_Credit_PD_Model.php
@@ -135,7 +135,7 @@ class SMC_Credit_PD_Model extends SPARQ_Model {
$result = $CMusers;
}
- }else if($role == 27){
+ }else if($role == 27 || $role == 30){
$result = $RCMusers;
}
return $result;
diff --git a/api/application/models/Template_Management_Model.php b/api/application/models/Template_Management_Model.php
index 7ade995c..9de859a5 100644
--- a/api/application/models/Template_Management_Model.php
+++ b/api/application/models/Template_Management_Model.php
@@ -314,12 +314,13 @@ 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,TEMPLATE_JSON_V2.is_form_disabled,PDFORMS.is_business_form,TEMPLATE_JSON_V2.is_group_form');
+ $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,PDFORMS.is_business_form,TEMPLATE_JSON_V2.is_group_form,PDFORMS.pd_form_order');
$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);
$this->db->WHERE('TEMPLATE_JSON_V2.map_id',$value);
$this->db->WHERE('PDFORMS.is_business_form',0);
+ $this->db->ORDER_BY('PDFORMS.pd_form_order');
$result = $this->db->GET()->result_array();
return $result;
}
diff --git a/api/application/views/sale_pd_templates/MEQ.php b/api/application/views/sale_pd_templates/MEQ.php
index 8c96f409..6949a0ca 100644
--- a/api/application/views/sale_pd_templates/MEQ.php
+++ b/api/application/views/sale_pd_templates/MEQ.php
@@ -8,6 +8,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$rupee_symbol = "₹";
$title = "";
if($master[0]['sales_pd_type'] == 1){$title = "Physical "; }else if($master[0]['sales_pd_type'] == 2){$title = "Tele ";}
+ $smc_emp_code = $master[0]['smc_emp_code'];
//print_r($master[0]['abbr']);die();
?>
@@ -617,6 +618,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');