From 59fc88ca8bd0cba0647937565a80cd9eec0c8b5e Mon Sep 17 00:00:00 2001 From: sanjeev Date: Thu, 20 Jan 2022 21:00:20 +0530 Subject: [PATCH 01/15] SMS config url : ps --- api/application/config/customconfig_one.php | 2 +- .../User_Management_Controller.php | 7 +++---- api/application/helpers/pdalerts_helper.php | 20 ++++++++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) 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/User_Management_Controller.php b/api/application/controllers/User_Management_Controller.php index c8b96244..ddf08957 100644 --- a/api/application/controllers/User_Management_Controller.php +++ b/api/application/controllers/User_Management_Controller.php @@ -565,10 +565,9 @@ 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."; + 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/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 20ecc858..795e7115 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -726,7 +726,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 +744,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,11 +766,13 @@ 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'] : "-"; + + // $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'] From 498512484c0ee2dd9b2d16b9bb10ed1adde8dc30 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Fri, 21 Jan 2022 19:14:54 +0530 Subject: [PATCH 02/15] SMC mail Template changes : ps --- api/application/helpers/pdalerts_helper.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 795e7115..ca239841 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -714,7 +714,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'); @@ -770,13 +770,23 @@ class PDALERTS $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 From cbfc81102e7473eb478abebda157769ff46e15b0 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Mon, 24 Jan 2022 21:01:21 +0530 Subject: [PATCH 03/15] form order key added --- .../controllers/Template_Management_Controller.php | 10 ++++++++-- .../controllers/User_Management_Controller.php | 3 ++- api/application/models/Template_Management_Model.php | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/api/application/controllers/Template_Management_Controller.php b/api/application/controllers/Template_Management_Controller.php index be86dbf1..3f00cf47 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) { @@ -1413,6 +1416,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 +1437,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 ddf08957..65717bef 100644 --- a/api/application/controllers/User_Management_Controller.php +++ b/api/application/controllers/User_Management_Controller.php @@ -566,7 +566,8 @@ else { // $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 - ".$OTP." has been triggered."; + // $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)); 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; } From aedb19da24c575a43ac299ee87ef2579c275698c Mon Sep 17 00:00:00 2001 From: sanjeev Date: Fri, 28 Jan 2022 15:50:51 +0530 Subject: [PATCH 04/15] Nation sales role : ps --- api/application/controllers/Sales_PD_Controller.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index 67ab3023..ccb45815 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -313,7 +313,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 +326,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); @@ -334,6 +337,7 @@ class Sales_PD_Controller extends REST_Controller { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = $sales_pd_data; + $data['c'] =count($sales_pd_data); $this->response($data,REST_Controller::HTTP_OK); } else From d52a0709376dd21903ecf7582c46f608dc9adf9a Mon Sep 17 00:00:00 2001 From: sanjeev Date: Fri, 28 Jan 2022 17:29:33 +0530 Subject: [PATCH 05/15] Invaild Token Fixes : ps --- api/application/config/constants.php | 2 ++ api/application/helpers/authorization_helper.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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/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; } From 6229b9ff98fdea8902f876dfda8c3d6fceb1f47d Mon Sep 17 00:00:00 2001 From: sanjeev Date: Sat, 29 Jan 2022 10:46:20 +0530 Subject: [PATCH 06/15] Mail added in BCC : ps --- api/application/helpers/pdalerts_helper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index ca239841..1d5d0c32 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); From d5bfa6b7ec00bf7dae125d220a149349c10e5888 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Sat, 29 Jan 2022 11:04:47 +0530 Subject: [PATCH 07/15] vit gmail removed : ps --- api/application/helpers/pdalerts_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 1d5d0c32..5cb0eef7 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -554,7 +554,7 @@ class PDALERTS $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); From 1338fb7c7bc464a2b2776a31aee025313ce4d978 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Thu, 3 Feb 2022 17:30:19 +0530 Subject: [PATCH 08/15] mis report last_name added : ps --- api/application/controllers/SMC_Credit_PD_Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index fc6c57ee..1989de0e 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'); From 64c2b3697d2645a34692de2e8132370d37c111fa Mon Sep 17 00:00:00 2001 From: sanjeev Date: Sat, 5 Feb 2022 11:18:36 +0530 Subject: [PATCH 09/15] machinery spell : ps --- api/application/controllers/PD_Controller.php | 2 +- api/application/controllers/Sales_PD_Controller.php | 3 +-- api/application/views/smc_creditpd_reports/MWISE.php | 2 +- api/application/views/smc_creditpd_reports/MWISE2.php | 2 +- api/application/views/smc_creditpd_reports/NBFC.php | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index d3b55142..566ff7be 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() diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index ccb45815..492a4315 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -337,7 +337,6 @@ class Sales_PD_Controller extends REST_Controller { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = $sales_pd_data; - $data['c'] =count($sales_pd_data); $this->response($data,REST_Controller::HTTP_OK); } else @@ -965,7 +964,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/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index f44e05ed..fb713317 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -1492,7 +1492,7 @@ aforementioned status 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinary Image'); + $photo_names = array('person_met' => 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinery Image'); // if($master[0]['sales_pd_type'] == 2){ $photo_names['selfie_with_person_met'] = 'Selfie of the person contacted';} // echo count($smc_images);die(); //print_r(array_keys($section9));die(); diff --git a/api/application/views/smc_creditpd_reports/MWISE2.php b/api/application/views/smc_creditpd_reports/MWISE2.php index 5e137a54..d8f467c6 100644 --- a/api/application/views/smc_creditpd_reports/MWISE2.php +++ b/api/application/views/smc_creditpd_reports/MWISE2.php @@ -623,7 +623,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinary Image'); + $photo_names = array('person_met' => 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinery Image'); // if($master[0]['sales_pd_type'] == 2){ $photo_names['selfie_with_person_met'] = 'Selfie of the person contacted';} // echo count($smc_images);die(); //print_r(array_keys($section9));die(); diff --git a/api/application/views/smc_creditpd_reports/NBFC.php b/api/application/views/smc_creditpd_reports/NBFC.php index 729edda6..502be047 100644 --- a/api/application/views/smc_creditpd_reports/NBFC.php +++ b/api/application/views/smc_creditpd_reports/NBFC.php @@ -536,7 +536,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinary Image'); + $photo_names = array('person_met' => 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinery Image'); // if($master[0]['sales_pd_type'] == 2){ $photo_names['selfie_with_person_met'] = 'Selfie of the person contacted';} // echo count($smc_images);die(); //print_r(array_keys($section9));die(); From 4fade3d4f699a9b15973a4d4c336a08cdcad62eb Mon Sep 17 00:00:00 2001 From: sanjeev Date: Sat, 5 Feb 2022 18:26:26 +0530 Subject: [PATCH 10/15] image name added : ps --- api/application/views/smc_creditpd_reports/MWISE.php | 2 +- api/application/views/smc_creditpd_reports/NBFC.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index fb713317..35d53675 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -1492,7 +1492,7 @@ aforementioned status 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinery Image'); + $photo_names = array('person_met' => 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinery Image','additional_photograph'=>'Additional Photographs','property_images'=>'Property Image'); // if($master[0]['sales_pd_type'] == 2){ $photo_names['selfie_with_person_met'] = 'Selfie of the person contacted';} // echo count($smc_images);die(); //print_r(array_keys($section9));die(); diff --git a/api/application/views/smc_creditpd_reports/NBFC.php b/api/application/views/smc_creditpd_reports/NBFC.php index 502be047..3842ed30 100644 --- a/api/application/views/smc_creditpd_reports/NBFC.php +++ b/api/application/views/smc_creditpd_reports/NBFC.php @@ -536,7 +536,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinery Image'); + $photo_names = array('person_met' => 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinery Image','additional_photograph'=>'Additional Photographs','property_images'=>'Property Image'); // if($master[0]['sales_pd_type'] == 2){ $photo_names['selfie_with_person_met'] = 'Selfie of the person contacted';} // echo count($smc_images);die(); //print_r(array_keys($section9));die(); From 8c3ed448d4e7c08731fd5d3286dce90b8b995324 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Sat, 12 Feb 2022 10:23:01 +0530 Subject: [PATCH 11/15] vendor cancellation status on RCM's : ps --- api/application/controllers/PD_Controller.php | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 566ff7be..26721ef6 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1108,12 +1108,24 @@ 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" || $pd_details['pd_status'] != "QC_COMPLETED")) { + //newly implemented + if(($pd_details['pd_status'] == "CANCELLED") && $role == 27){ + $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 +11308,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 +11321,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 From 2932e968ff3c9359a7f693b50ed709495e9b7746 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Mon, 14 Feb 2022 11:02:55 +0530 Subject: [PATCH 12/15] CM vendor cancellation :ps --- api/application/controllers/PD_Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 26721ef6..9931ff09 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1115,7 +1115,7 @@ class PD_Controller extends REST_Controller { 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){ + if(($pd_details['pd_status'] == "CANCELLED") && ($role == 27 || $role == 26)){ $pd_details['vendor_status'] = null; $pd_details['pd_agency_id'] = null; $pd_details['pd_status'] = $pd_details['pd_status']; From 00705fff8b5c9677dccc300ba24d19e2ceca9040 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Mon, 21 Feb 2022 10:24:07 +0530 Subject: [PATCH 13/15] report changes : ps --- api/application/controllers/PD_Controller.php | 10 +++++-- .../controllers/SMC_Credit_PD_Controller.php | 5 ++-- .../controllers/Sales_PD_Controller.php | 3 +- .../Template_Management_Controller.php | 29 ++++++++++++++----- api/application/models/PD_Model.php | 2 +- .../models/SMC_Credit_PD_Model.php | 2 +- .../views/sale_pd_templates/MEQ.php | 4 +++ .../views/sale_pd_templates/MWISE.php | 4 +++ .../views/smc_creditpd_reports/MWISE.php | 6 +++- .../views/smc_creditpd_reports/NBFC.php | 4 +++ 10 files changed, 53 insertions(+), 16 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 9931ff09..294bcc7f 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1111,11 +1111,17 @@ class PD_Controller extends REST_Controller { $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)){ + 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']; diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 1989de0e..7f9ae1cc 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -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 @@ -1627,7 +1628,7 @@ public function filterSalesPDList_post() { $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); } - // echo $html_content;exit(); + echo $html_content;exit(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF @@ -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 492a4315..45f94cd1 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -214,7 +214,8 @@ class Sales_PD_Controller extends REST_Controller { //$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr']; $view_name = $sales_pd_data[0]['short_name'];if( $sales_pd_data[0]['abbr'] == 'MEQ'){ $view_name = $sales_pd_data[0]['abbr']; } $html_content = $this->load->view('sale_pd_templates/'.$view_name,$view_data,true); - // echo $html_content;die(); + print_r($view_data);die(); + echo $html_content;die(); $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF $output_file = $this->external_path ."/sales_pd/" . $sales_pd_id . "/temp.pdf"; diff --git a/api/application/controllers/Template_Management_Controller.php b/api/application/controllers/Template_Management_Controller.php index 3f00cf47..41b752c5 100644 --- a/api/application/controllers/Template_Management_Controller.php +++ b/api/application/controllers/Template_Management_Controller.php @@ -1028,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'])) ) @@ -1084,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; 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/views/sale_pd_templates/MEQ.php b/api/application/views/sale_pd_templates/MEQ.php index 8c96f409..4cb36fc4 100644 --- a/api/application/views/sale_pd_templates/MEQ.php +++ b/api/application/views/sale_pd_templates/MEQ.php @@ -617,6 +617,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Designation of Sales Team Member + + Employee ID + + Date of PD Visit diff --git a/api/application/views/sale_pd_templates/MWISE.php b/api/application/views/sale_pd_templates/MWISE.php index 72da0bd4..390fd6fd 100644 --- a/api/application/views/sale_pd_templates/MWISE.php +++ b/api/application/views/sale_pd_templates/MWISE.php @@ -597,6 +597,10 @@ if(isset($section6)) Designation of Sales Team Member + + Employee ID + + Date of PD Visit diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index 35d53675..c836aa45 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -1539,7 +1539,11 @@ if(count($smc_images)) Designation of Sales Team Member --> - + + Employee ID + + + Date of PD Visit diff --git a/api/application/views/smc_creditpd_reports/NBFC.php b/api/application/views/smc_creditpd_reports/NBFC.php index 3842ed30..33b16671 100644 --- a/api/application/views/smc_creditpd_reports/NBFC.php +++ b/api/application/views/smc_creditpd_reports/NBFC.php @@ -583,6 +583,10 @@ if(count($smc_images)) Designation of Sales Team Member --> + + Employee ID + + Date of PD Visit From 01c8595785eea8a2f56478689ad9fd52ff8412cc Mon Sep 17 00:00:00 2001 From: sanjeev Date: Mon, 21 Feb 2022 10:27:18 +0530 Subject: [PATCH 14/15] unwanted line removed : ps --- api/application/controllers/SMC_Credit_PD_Controller.php | 2 +- api/application/controllers/Sales_PD_Controller.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 7f9ae1cc..5f90ceb3 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1628,7 +1628,7 @@ public function filterSalesPDList_post() { $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); } - echo $html_content;exit(); + // echo $html_content;exit(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index 45f94cd1..492a4315 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -214,8 +214,7 @@ class Sales_PD_Controller extends REST_Controller { //$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr']; $view_name = $sales_pd_data[0]['short_name'];if( $sales_pd_data[0]['abbr'] == 'MEQ'){ $view_name = $sales_pd_data[0]['abbr']; } $html_content = $this->load->view('sale_pd_templates/'.$view_name,$view_data,true); - print_r($view_data);die(); - echo $html_content;die(); + // echo $html_content;die(); $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF $output_file = $this->external_path ."/sales_pd/" . $sales_pd_id . "/temp.pdf"; From 2290cf98b37b4fc2a93fc11f6904defd89a89860 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Tue, 22 Feb 2022 10:52:38 +0530 Subject: [PATCH 15/15] report change 1 : ps --- api/application/controllers/Sales_PD_Controller.php | 8 +++++--- api/application/views/sale_pd_templates/MEQ.php | 3 ++- api/application/views/sale_pd_templates/MWISE.php | 3 ++- api/application/views/smc_creditpd_reports/MWISE.php | 4 ++-- api/application/views/smc_creditpd_reports/NBFC.php | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index 492a4315..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) { diff --git a/api/application/views/sale_pd_templates/MEQ.php b/api/application/views/sale_pd_templates/MEQ.php index 4cb36fc4..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(); ?> @@ -619,7 +620,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Employee ID - + diff --git a/api/application/views/sale_pd_templates/MWISE.php b/api/application/views/sale_pd_templates/MWISE.php index 390fd6fd..57aff3ad 100644 --- a/api/application/views/sale_pd_templates/MWISE.php +++ b/api/application/views/sale_pd_templates/MWISE.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(); ?> @@ -599,7 +600,7 @@ if(isset($section6)) Employee ID - + Date of PD Visit diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index c836aa45..46a070a6 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -1539,10 +1539,10 @@ if(count($smc_images)) Designation of Sales Team Member --> - + Date of PD Visit diff --git a/api/application/views/smc_creditpd_reports/NBFC.php b/api/application/views/smc_creditpd_reports/NBFC.php index 33b16671..99cacdbb 100644 --- a/api/application/views/smc_creditpd_reports/NBFC.php +++ b/api/application/views/smc_creditpd_reports/NBFC.php @@ -583,10 +583,10 @@ if(count($smc_images)) Designation of Sales Team Member --> - + Date of PD Visit