CHANGE_CLAIMS_STATUS : RV

This commit is contained in:
VENKATESHWARAN 2025-02-24 14:10:18 +05:30
parent 339518f760
commit c90e2205e6
6 changed files with 47 additions and 19 deletions

View File

@ -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; $field_name = 'employees.' . $type;
// Construct the base query // Construct the base query
$data = $this->clientPolicyModel $query = $this->clientPolicyModel
->select(" ->select("
clients.id AS client_id, clients.id AS client_id,
clients.client_name, clients.client_name,
@ -4861,23 +4861,32 @@ class ClientController extends AdminController
employees.email_corporate AS emp_email, employees.email_corporate AS emp_email,
employees.relationship AS emp_relationship, employees.relationship AS emp_relationship,
employee_polices.uhid AS policy_no, 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('clients', 'client_policy.client_id = clients.id', 'left')
->join('insurers', 'client_policy.insurer_id = insurers.id', 'left') ->join('insurers', 'client_policy.insurer_id = insurers.id', 'left')
->join('tpa', 'client_policy.tpa_id = tpa.id', 'left') ->join('tpa', 'client_policy.tpa_id = tpa.id', 'left')
->join('employees', 'clients.id = employees.client_id', 'left') ->join('employees', 'clients.id = employees.client_id')
->join('employee_polices', 'employees.id = employee_polices.employee_id', 'left') ->join('employee_polices', 'employees.id = employee_polices.employee_id')
->where('client_policy.is_active', 1) ->where('client_policy.is_active', 1)
->where('insurers.is_active', 1) ->where('insurers.is_active', 1)
->where('tpa.is_active', 1) ->where('tpa.is_active', 1)
->where('employees.is_active', 1) ->where('employees.is_active', 1)
->where('employees.relationship', "Self") ->where('employees.relationship', "Self")
->where('employee_polices.is_active', 1) ->where('employee_polices.is_active', 1)
->where($field_name, $param) ->where($field_name, $param);
->groupBy('employees.id')
->orderBy('employees.id', 'DESC') if (!empty($client_policy_id)) {
->first(); $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 = []; $memberData = [];
$dataForClientAndInsurer = []; $dataForClientAndInsurer = [];
@ -4891,7 +4900,7 @@ class ClientController extends AdminController
if(!empty($data) && count($data) > 0){ 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 $acms = $this->clientRMModel
->select('user_profiles.id, user_profiles.first_name') ->select('user_profiles.id, user_profiles.first_name')
@ -4914,6 +4923,7 @@ class ClientController extends AdminController
'message' => 'Data found', 'message' => 'Data found',
'data' => $data, 'data' => $data,
'param' => $param, 'param' => $param,
'client_policy_id' => $client_policy_id,
'type' => $type, 'type' => $type,
'dataForClientAndInsurer' => $dataForClientAndInsurer, 'dataForClientAndInsurer' => $dataForClientAndInsurer,
'memberData' => $memberData, 'memberData' => $memberData,
@ -4925,6 +4935,7 @@ class ClientController extends AdminController
'code' => 404, 'code' => 404,
'message' => 'No data found', 'message' => 'No data found',
'param' => $param, 'param' => $param,
'client_policy_id' => $client_policy_id,
'type' => $type, 'type' => $type,
'dataForClientAndInsurer' => $dataForClientAndInsurer, 'dataForClientAndInsurer' => $dataForClientAndInsurer,
'memberData' => $memberData, 'memberData' => $memberData,

View File

@ -1382,6 +1382,12 @@ class TicketController extends BaseController
} }
} }
if($lastMatchedStatus == 1){
if(!empty($incoming_form_values['tpa_no'])){
$lastMatchedStatus = 2;
}
}
return $lastMatchedStatus; return $lastMatchedStatus;
} }

View File

@ -240,9 +240,9 @@ class EmployeeModel extends Model
return $results; 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.id AS emp_id,
employees.name AS emp_name, employees.name AS emp_name,
employees.emp_code, employees.emp_code,
@ -255,9 +255,18 @@ class EmployeeModel extends Model
->join('employee_polices', 'employees.id = employee_polices.employee_id', 'left') ->join('employee_polices', 'employees.id = employee_polices.employee_id', 'left')
->where('employees.is_active', 1) ->where('employees.is_active', 1)
->where('employee_polices.is_active', 1) ->where('employee_polices.is_active', 1)
->where('employees.emp_code', $emp_code) ->where('employees.emp_code', $emp_code);
->groupBy('employees.id')
->findAll(); if(!empty($client_policy_id)){
$query->where('employee_polices.client_policy_id', $client_policy_id);
}
$query->groupBy('employees.id');
$data = $query->findAll();
return $data;
} }
} }

View File

@ -448,7 +448,7 @@ function claimStatusFieldChanges(fields) {
var $field = $("#" + fieldId); var $field = $("#" + fieldId);
if ($field.length) { if ($field.length) {
$field.prop('required', true); // $field.prop('required', true);
var $parentDiv = $field.closest("div"); var $parentDiv = $field.closest("div");
$parentDiv.show(); $parentDiv.show();

View File

@ -342,7 +342,7 @@ function claimStatusFieldChanges(fields) {
var $field = $("#" + fieldId); var $field = $("#" + fieldId);
if ($field.length) { if ($field.length) {
$field.prop('required', true); // $field.prop('required', true);
var $parentDiv = $field.closest("div"); var $parentDiv = $field.closest("div");
$parentDiv.show(); $parentDiv.show();

View File

@ -512,17 +512,19 @@ function getTheEmpDataForClaimSearchByMobile(input, searchType = null) {
console.log(input) console.log(input)
let type = $('#employee_data_points').val() let type = $('#employee_data_points').val()
let param = $('#emp_mobile_number_for_claim').val() let param = $('#emp_mobile_number_for_claim').val()
let client_policy_id = $('#emp_client_policy_data_list').val()
if (searchType == 'client') { if (searchType == 'client') {
type = 'emp_code'; type = 'emp_code';
param = $(input).val(); 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 // Data to send in the AJAX request
let requestData = { let requestData = {
param: param, param: param,
type: type, type: type,
client_policy_id: client_policy_id,
}; };
// Show loader // Show loader