CHANGE_CLAIMS_STATUS : RV
This commit is contained in:
parent
339518f760
commit
c90e2205e6
@ -4841,12 +4841,12 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function getTheEmpDataForClaimSearchByMobile($param, $type = 'mobile')
|
||||
public function getTheEmpDataForClaimSearchByMobile($param, $type = 'mobile', $client_policy_id = null)
|
||||
{
|
||||
$field_name = 'employees.' . $type;
|
||||
|
||||
// Construct the base query
|
||||
$data = $this->clientPolicyModel
|
||||
$query = $this->clientPolicyModel
|
||||
->select("
|
||||
clients.id AS client_id,
|
||||
clients.client_name,
|
||||
@ -4861,24 +4861,33 @@ class ClientController extends AdminController
|
||||
employees.email_corporate AS emp_email,
|
||||
employees.relationship AS emp_relationship,
|
||||
employee_polices.uhid AS policy_no,
|
||||
employee_polices.tpa_id AS tpa_no
|
||||
employee_polices.tpa_id AS tpa_no,
|
||||
employee_polices.client_policy_id AS policy_id
|
||||
")
|
||||
->join('clients', 'client_policy.client_id = clients.id', 'left')
|
||||
->join('insurers', 'client_policy.insurer_id = insurers.id', 'left')
|
||||
->join('tpa', 'client_policy.tpa_id = tpa.id', 'left')
|
||||
->join('employees', 'clients.id = employees.client_id', 'left')
|
||||
->join('employee_polices', 'employees.id = employee_polices.employee_id', 'left')
|
||||
->join('employees', 'clients.id = employees.client_id')
|
||||
->join('employee_polices', 'employees.id = employee_polices.employee_id')
|
||||
->where('client_policy.is_active', 1)
|
||||
->where('insurers.is_active', 1)
|
||||
->where('tpa.is_active', 1)
|
||||
->where('employees.is_active', 1)
|
||||
->where('employees.relationship', "Self")
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where($field_name, $param)
|
||||
->groupBy('employees.id')
|
||||
->orderBy('employees.id', 'DESC')
|
||||
->first();
|
||||
|
||||
->where($field_name, $param);
|
||||
|
||||
if (!empty($client_policy_id)) {
|
||||
$query->where('employee_polices.client_policy_id', $client_policy_id);
|
||||
}
|
||||
|
||||
$query->groupBy('employees.id')
|
||||
->orderBy('employees.id', 'DESC');
|
||||
|
||||
$data = $query->get()->getRowArray();
|
||||
|
||||
// print_r(db_connect()->getLastQuery()); die;
|
||||
|
||||
$memberData = [];
|
||||
$dataForClientAndInsurer = [];
|
||||
|
||||
@ -4891,7 +4900,7 @@ class ClientController extends AdminController
|
||||
|
||||
if(!empty($data) && count($data) > 0){
|
||||
|
||||
$memberData = $this->employeeModel->getEmployeeByEmployeeCode($data['emp_code']);
|
||||
$memberData = $this->employeeModel->getEmployeeByEmployeeCode($data['emp_code'], $data['policy_id']);
|
||||
|
||||
$acms = $this->clientRMModel
|
||||
->select('user_profiles.id, user_profiles.first_name')
|
||||
@ -4914,6 +4923,7 @@ class ClientController extends AdminController
|
||||
'message' => 'Data found',
|
||||
'data' => $data,
|
||||
'param' => $param,
|
||||
'client_policy_id' => $client_policy_id,
|
||||
'type' => $type,
|
||||
'dataForClientAndInsurer' => $dataForClientAndInsurer,
|
||||
'memberData' => $memberData,
|
||||
@ -4925,6 +4935,7 @@ class ClientController extends AdminController
|
||||
'code' => 404,
|
||||
'message' => 'No data found',
|
||||
'param' => $param,
|
||||
'client_policy_id' => $client_policy_id,
|
||||
'type' => $type,
|
||||
'dataForClientAndInsurer' => $dataForClientAndInsurer,
|
||||
'memberData' => $memberData,
|
||||
|
||||
@ -1381,6 +1381,12 @@ class TicketController extends BaseController
|
||||
$lastMatchedStatus = $status;
|
||||
}
|
||||
}
|
||||
|
||||
if($lastMatchedStatus == 1){
|
||||
if(!empty($incoming_form_values['tpa_no'])){
|
||||
$lastMatchedStatus = 2;
|
||||
}
|
||||
}
|
||||
|
||||
return $lastMatchedStatus;
|
||||
}
|
||||
|
||||
@ -240,9 +240,9 @@ class EmployeeModel extends Model
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function getEmployeeByEmployeeCode($emp_code)
|
||||
public function getEmployeeByEmployeeCode($emp_code, $client_policy_id = null)
|
||||
{
|
||||
return $this->select("
|
||||
$query = $this->select("
|
||||
employees.id AS emp_id,
|
||||
employees.name AS emp_name,
|
||||
employees.emp_code,
|
||||
@ -255,9 +255,18 @@ class EmployeeModel extends Model
|
||||
->join('employee_polices', 'employees.id = employee_polices.employee_id', 'left')
|
||||
->where('employees.is_active', 1)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->groupBy('employees.id')
|
||||
->findAll();
|
||||
->where('employees.emp_code', $emp_code);
|
||||
|
||||
if(!empty($client_policy_id)){
|
||||
$query->where('employee_polices.client_policy_id', $client_policy_id);
|
||||
}
|
||||
|
||||
$query->groupBy('employees.id');
|
||||
$data = $query->findAll();
|
||||
|
||||
return $data;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -448,7 +448,7 @@ function claimStatusFieldChanges(fields) {
|
||||
var $field = $("#" + fieldId);
|
||||
|
||||
if ($field.length) {
|
||||
$field.prop('required', true);
|
||||
// $field.prop('required', true);
|
||||
|
||||
var $parentDiv = $field.closest("div");
|
||||
$parentDiv.show();
|
||||
|
||||
@ -342,7 +342,7 @@ function claimStatusFieldChanges(fields) {
|
||||
var $field = $("#" + fieldId);
|
||||
|
||||
if ($field.length) {
|
||||
$field.prop('required', true);
|
||||
// $field.prop('required', true);
|
||||
|
||||
var $parentDiv = $field.closest("div");
|
||||
$parentDiv.show();
|
||||
|
||||
@ -512,17 +512,19 @@ function getTheEmpDataForClaimSearchByMobile(input, searchType = null) {
|
||||
console.log(input)
|
||||
let type = $('#employee_data_points').val()
|
||||
let param = $('#emp_mobile_number_for_claim').val()
|
||||
let client_policy_id = $('#emp_client_policy_data_list').val()
|
||||
|
||||
if (searchType == 'client') {
|
||||
type = 'emp_code';
|
||||
param = $(input).val();
|
||||
}
|
||||
let url = '<?= base_url('util/getTheEmpDataForClaimSearchByMobile/') ?>' + param + '/' + type;
|
||||
let url = '<?= base_url('util/getTheEmpDataForClaimSearchByMobile/') ?>' + param + '/' + type + '/' + client_policy_id;
|
||||
|
||||
// Data to send in the AJAX request
|
||||
let requestData = {
|
||||
param: param,
|
||||
type: type,
|
||||
client_policy_id: client_policy_id,
|
||||
};
|
||||
|
||||
// Show loader
|
||||
|
||||
Loading…
Reference in New Issue
Block a user