TINY REPORT CHANGES IMGC TRIGGER CHANGES

This commit is contained in:
Velz2020 2019-09-07 18:29:18 +05:30
parent c4966671db
commit 79d8311c47
8 changed files with 117 additions and 11 deletions

View File

@ -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';

View File

@ -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);
}
}

View File

@ -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();
}
}

View File

@ -192,7 +192,7 @@ public static function getOthersAssetsDetails($values){
$header_row .= '<th>Asset '.($bsk+1).'</th>';
$first_row .= '<td class="customtd">'.$fetchVal['business_assets_mode_master'].'</td>';
$sec_row .= '<td class="customtd">'.($fetchVal['business_details'][0]['equipment_manufacturing_description']).'';
$sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? 'purchased at '.$fetchVal['business_purchase_year'] .'</td>' : '</td>';
$sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? ' purchased in '.$fetchVal['business_purchase_year'] .'</td>' : '</td>';
$third_row .= '<td class="customtd">'. ucfirst($ownership_type) .'</td>';
$fourth_row .= '<td class="customtd">'.$owners_list.'</td>';
$fifth_row .= '<td class="customtd">'.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').'</td>';
@ -207,7 +207,7 @@ public static function getOthersAssetsDetails($values){
$first_row .= '<td class="customtd">'.$fetchVal['business_assets_mode_master'].'</td>';
$sec_row .= '<td class="customtd">'.($fetchVal['business_details'][0]['manufacturer_model_vehicle']).'';
$sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? 'purchased at '.$fetchVal['business_purchase_year'].'</td>' : '</td>';
$sec_row .= $fetchVal['business_purchase_year'] != '' || $fetchVal['business_purchase_year'] != null ? ' purchased in '.$fetchVal['business_purchase_year'].'</td>' : '</td>';
$third_row .= '<td class="customtd">'. ucfirst($ownership_type) .'</td>';
$fourth_row .= '<td class="customtd">'.$owners_list.'</td>';
$fifth_row .= '<td class="customtd">'.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').'</td>';

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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' : "");

View File

@ -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<span contenteditable="true">.</span>';
@ -3022,7 +3022,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td class="customtd"><?php echo $pstRow['type'] ?></td>
<td class="customtd"><?php echo $pstRow['name'] ?></td>
<td class="customtd"><?php echo $pstRow['value'] && $pstRow['value'] != "" ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pstRow['value']) : 'Not Observed'?></td>
<td class="customtd"><?php echo $pstRow['quantity'] && $pstRow['quantity'] != "" ? $pstRow['quantity'].' '.$pstRow['uom'] : 'Not Observed' ?></td>
<td class="customtd"><?php echo $pstRow['quantity'] && $pstRow['quantity'] != "" ? $pstRow['quantity'].' '.$pstRow['uom'] : 'Could Not Verify' ?></td>
<!-- <td><?php //echo $pstRow['is_sufficiant'] ?></td> -->
</tr>
@ -3760,7 +3760,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?>
<tr>
<td class="customtd"><?php echo (++$oidkey) ?></td>
<td class="customtd"><?php echo $oiRow['source']; if(!strcasecmp($oiRow['source'], 'RENTAL INCOME')){ echo '<br>(Details Available in Annexure B)'; $GLOBALS['is_rental_available'] = 1 ; } ?></td>
<td class="customtd"><?php echo $oiRow['source']; if(!strcasecmp($oiRow['source'], 'RENTAL INCOME') && isset($pd_processed_forms[17][0]['processed_json']) ){ echo '<br>(Details Available in Annexure B)'; $GLOBALS['is_rental_available'] = 1 ; } ?></td>
<td class="customtd"><?php echo $oiRow['earned_by'] ?></td>
<td class="customtd"><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($oiRow['amount']).' '.$oiRow['frequency'] ?></td>