diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 452c4786..f53cee9c 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -151,6 +151,7 @@ $route['saveEntityFinInstitutions'] = 'Entity_Management_Controller/saveEntityFi $route['(getEntityFinInstitutions/:any)'] = 'Entity_Management_Controller/getEntityFinInstitutions'; $route['saveEntityOtherPreferences'] = 'Entity_Management_Controller/saveEntityOtherPreferences'; $route['(getEntityOtherPreferences/:any)'] = 'Entity_Management_Controller/getEntityOtherPreferences'; +$route['(getEntityPreferences/:any)'] = 'Entity_Management_Controller/getEntityPreferences'; //PD RELATED $route['triggerNewPD'] = 'PD_Controller/triggerNewPD'; diff --git a/api/application/controllers/Entity_Management_Controller.php b/api/application/controllers/Entity_Management_Controller.php index fe53e8c1..00895eb0 100644 --- a/api/application/controllers/Entity_Management_Controller.php +++ b/api/application/controllers/Entity_Management_Controller.php @@ -953,6 +953,7 @@ class Entity_Management_Controller extends REST_Controller { $products = array(); $customer_segments = array(); $pd_types = array(); + $fk_createdby = ''; if($entity_id) { $preferences = $this->Entity_Management_Model->selectCustomRecords(array('*'),array('fk_entity_id' => $entity_id),ENTITYPREFERENCE); @@ -971,10 +972,11 @@ class Entity_Management_Controller extends REST_Controller { { $pd_types = explode(",",$preference_value['values']); } + $fk_createdby = $preference_value['fk_createdby']; } $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; - $data['records'] = array('products' => $products,'customer_segments' => $customer_segments,'pd_types' => $pd_types); + $data['records'] = array('products' => $products,'customer_segments' => $customer_segments,'pd_types' => $pd_types,'fk_createdby' => $fk_createdby); $this->response($data,REST_Controller::HTTP_OK); } @@ -1096,5 +1098,90 @@ class Entity_Management_Controller extends REST_Controller { } } + + + public function getEntityPreferences_get() + { + $entity_id = $this->uri->segment(2); + $products = array(); + $customer_segments = array(); + $pd_types = array(); + $financial_institutions = array(); + //echo $entity_id; + $existing_preferences = $this->Entity_Management_Model->selectCustomRecords(array('*'),array('fk_entity_id' => $entity_id),ENTITYPREFERENCE); + $financial_institutions = $this->Entity_Management_Model->selectCustomRecords(array('*'),array('fk_entity_id' => $entity_id,'isactive' => 1),ENTITYFININSTITUTION); + + // if(count($existing_financial_institutions)) + // { + // $financial_institutions = $this->Entity_Management_Model->selectCustomRecords(array('*'),array('fk_entity_id' => $entity_id,'isactive' => 1),ENTITYFININSTITUTION); + // } + + + if(count($existing_preferences)) + { + foreach($existing_preferences as $preference_key => $preference_value) + { + if($preference_value['preference_type'] == 1) + { + $products = explode(",",$preference_value['values']); + //$products = '(' . $preference_value['values'] . ')'; + } + if($preference_value['preference_type'] == 2) + { + $customer_segments = explode(",",$preference_value['values']); + } + if($preference_value['preference_type'] == 3) + { + $pd_types = explode(",",$preference_value['values']); + } + + } + + } + //GET PRODUCT AND SUB PRODUCT + $this->db->SELECT('product_id,name as product_name,abbr as product_abbr')->FROM(PRODUCTS); + if(count($products)) + { + $this->db->WHERE_IN('product_id ',$products); + } + $this->db->WHERE('isactive',1); + $products = $this->db->GET()->result_array(); + //print_r($products);die(); + foreach($products as $key => $value) + { + $fields = array('subproduct_id','name as subproduct_name','abbr as subproduct_abbr','is_others'); + $where_condition_array = array('isactive' => 1,'fk_product_id' => $value['product_id']); + $subproducts = $this->Entity_Management_Model->selectCustomRecords($fields,$where_condition_array,SUBPRODUCTS); + //array_push($result_data[$key],$subproducts); + $products[$key]['subproducts'] = $subproducts; + } + + //GET CUSTOMER SEGMENTS + $this->db->SELECT('customer_segment_id,name as customer_segment,abbr')->FROM(CUSTOMERSEGMENT); + if(count($customer_segments)) + { + $this->db->WHERE_IN('customer_segment_id ',$customer_segments); + } + $this->db->WHERE('isactive',1); + $customer_segments = $this->db->GET()->result_array(); + + //GET PDTYPES + $this->db->SELECT('*')->FROM(PDTYPE); + if(count($pd_types)) + { + $this->db->WHERE_IN('pd_type_id ',$pd_types); + } + $this->db->WHERE('isactive',1); + $pd_types = $this->db->GET()->result_array(); + + + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = array('products' =>$products,'customer_segments' => $customer_segments, 'pd_types' => $pd_types,'financial_institutions' => $financial_institutions); + $this->response($data,REST_Controller::HTTP_OK); + + + + } } diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 47c06562..6718b476 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -8790,4 +8790,20 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() } } + + + public function adminSetUserPassword_post() + { + //$email = $this + //$sql = "SELECT email FROM sineedgeprod.m_user_profile where email like '%imgc%'"; + // $u = $this->db->query($sql)->result_array(); + // print_r($u); + // die(); + // foreach($u as $v) + // { + // $this->aws_cognito->adminSetUserPassword($v['email']); + // } + + // die(); + } } \ No newline at end of file diff --git a/api/application/helpers/assetsform_helper.php b/api/application/helpers/assetsform_helper.php index b26f397b..6cdb9784 100644 --- a/api/application/helpers/assetsform_helper.php +++ b/api/application/helpers/assetsform_helper.php @@ -192,7 +192,7 @@ public static function getOthersAssetsDetails($values){ $header_row .= 'Asset '.($bsk+1).''; $first_row .= ''.$fetchVal['business_assets_mode_master'].''; $sec_row .= ''.($fetchVal['business_details'][0]['equipment_manufacturing_description']).''; - $sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? 'purchased at '.$fetchVal['business_purchase_year'] .'' : ''; + $sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? ' purchased in '.$fetchVal['business_purchase_year'] .'' : ''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; @@ -207,7 +207,7 @@ public static function getOthersAssetsDetails($values){ $first_row .= ''.$fetchVal['business_assets_mode_master'].''; $sec_row .= ''.($fetchVal['business_details'][0]['manufacturer_model_vehicle']).''; - $sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? 'purchased at '.$fetchVal['business_purchase_year'].'' : ''; + $sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? ' purchased in '.$fetchVal['business_purchase_year'].'' : ''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; diff --git a/api/application/helpers/authorization_helper.php b/api/application/helpers/authorization_helper.php index d9640b15..528b3df9 100644 --- a/api/application/helpers/authorization_helper.php +++ b/api/application/helpers/authorization_helper.php @@ -78,7 +78,8 @@ class AUTHORIZATION set_status_header(REST_CONTROLLER::HTTP_UNAUTHORIZED,"Unauthorized"); $response['status']=false; $response['error']="Access denied!"; - log_message('error','Access denied!'); + $custom_log_info = 'Access denied! '.' Authorization key does not exist or not match' ; + log_message('error',$custom_log_info); echo json_encode($response); exit; } @@ -114,7 +115,8 @@ class AUTHORIZATION set_status_header(REST_CONTROLLER::HTTP_UNAUTHORIZED,"Unauthorized"); $response['status']=false; $response['error']="Unauthorized Role Access"; - log_message('error','Unauthorized Role Access'); + $custom_log_info = 'Unauthorized Role Access - '. $token_payload['custom:role_id'] . ' Email - '.$token_payload['email'].' API - '.$routingName; + log_message('error',$custom_log_info); echo json_encode($response); exit; } diff --git a/api/application/helpers/businessform_helper.php b/api/application/helpers/businessform_helper.php index f56b6580..dbff781a 100644 --- a/api/application/helpers/businessform_helper.php +++ b/api/application/helpers/businessform_helper.php @@ -400,7 +400,7 @@ public static function getActivityDetails($values,$type){ } // get business peak period details -public static function getBusinessPeakDetails($details){ +public static function getBusinessPeakDetails($details,$reason){ $getRow='The Business has lower sales/services during,'; $getRow.= count($details) >1 ?' the periods of ' :' the period of '; foreach($details as $key=>$value){ @@ -445,7 +445,7 @@ public static function getBusinessPeakDetails($details){ break; } } - $getRow .='.'; + $getRow .='.'. '( Reason is '. $reason .')'; return $getRow; } } diff --git a/api/application/helpers/otherfamilyform_helper.php b/api/application/helpers/otherfamilyform_helper.php index caea8854..c2f5536e 100644 --- a/api/application/helpers/otherfamilyform_helper.php +++ b/api/application/helpers/otherfamilyform_helper.php @@ -13,7 +13,7 @@ public static function getFamilyDetails($values){ $storeValue['selected_person_title']= isset($fetchVal['selected_person_title_master']) ? $fetchVal['selected_person_title_master'] : ''; $storeValue['selected_person']= isset($fetchVal['selected_person_master']) ? $fetchVal['selected_person_master'] : $fetchVal['selected_person']; - $storeValue['residency_address']=$fetchVal['residence_place'].' in, '.$fetchVal['residence_city_master'].', '.$fetchVal['residence_state_master'].'-'; + $storeValue['residency_address']=$fetchVal['residence_place'].', '.$fetchVal['residence_city_master'].', '.$fetchVal['residence_state_master'].'-'; $storeValue['residency_address'] .=($fetchVal['residence_pin'] == 1) ? $fetchVal['residence_other_pincode'] : (($fetchVal['residence_pin'] > 1) ? $fetchVal['residence_pincode_master'] : ""); //$storeValue['residency_address'] .='.'; $storeValue['residence_No_of_years']=($fetchVal['residence_No_of_years'] == 1) ? $fetchVal['residence_No_of_years'].' year' :(($fetchVal['residence_No_of_years'] > 1) ? $fetchVal['residence_No_of_years'].' years' : ""); diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index c157d9f8..b7a06a15 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -1359,7 +1359,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } // this if for get business peak period if(strtoupper($businessRow['seasonality'])=='YES' && array_key_exists('peak_period_of_business',$businessRow)){ - $bindEachResult['business_peak_details']=Businessform::getBusinessPeakDetails($businessRow['peak_period_of_business']); + $bindEachResult['business_peak_details']=Businessform::getBusinessPeakDetails($businessRow['peak_period_of_business'],$businessRow['month_of_business_run']); } else{ $bindEachResult['business_peak_details']='The Business has no major change in sales across seasons.'; @@ -3022,7 +3022,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - + @@ -3760,7 +3760,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> - (Details Available in Annexure B)'; $GLOBALS['is_rental_available'] = 1 ; } ?> + (Details Available in Annexure B)'; $GLOBALS['is_rental_available'] = 1 ; } ?>