From 8a5b5fcfd0b3fe87e89deb9feebc932c182c128d Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Mon, 10 Mar 2025 15:24:14 +0530 Subject: [PATCH] FIX_CLAIMS_MODULE_ISSUES : RV --- app/Controllers/ClientController.php | 14 ++++--------- .../PolicyTransactionController.php | 11 ++++++++-- app/Controllers/TicketController.php | 13 +++--------- app/Models/EmployeeModel.php | 16 +++++++++++++++ app/Views/ticket_auto_query.php | 20 ++++++++++--------- app/Views/ticket_reply.php | 8 +++++++- 6 files changed, 50 insertions(+), 32 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 07fb963a..fffbcbd8 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -4910,16 +4910,10 @@ class ClientController extends AdminController if(!empty($data) && count($data) > 0){ $memberData = $this->employeeModel->getEmployeeByEmployeeCode($data['emp_code'], $data['policy_id'], $client_id); - - $acms = $this->clientRMModel - ->select('user_profiles.id, user_profiles.first_name') - ->join('clients', 'client_rm.client_id = clients.id', 'left') - ->join('user_profiles', 'client_rm.user_id = user_profiles.id', 'left') - ->where('clients.is_active', 1) - ->where('client_rm.is_active', 1) - ->where('user_profiles.is_active', 1) - ->where('clients.id', $data['client_id']) - ->findAll(); + $acms_datas = $this->employeeModel->getAcmUsingClientID($data['client_id']); + if(!empty($acms_datas)){ + $acms = $acms_datas; + } } diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index a9d3b8ee..336c3d5c 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -433,7 +433,7 @@ class PolicyTransactionController extends BaseController 'pt_id' => $pt_id, 'insurer_id' => $insurer_id ?? 0, 'insurer_branch_id' => $insurer_branch_id ?? 0, - 'co_share_type' => $data['co_share_type'][$index] ?? null, + 'co_share_type' => $data['co_share_type'][$index] ?? 1, 'co_share_per' => $data['co_share_per'][$index] ?? 0, 'bp_amt' => $data['base_premium'][$index] ?? 0, 'bp_gst_amt' => $data['gst_amount'][$index] ?? 0, @@ -1607,8 +1607,15 @@ class PolicyTransactionController extends BaseController ->where('policy_transaction.action_type', 'inception') ->findAll(); + $is_copay_yes = $this->policyTransactionModel + ->where('client_id', $client_id) + ->where('client_policy_id', $client_policy_id) + ->where('action_type', 'inception') + ->where('is_active', 1) + ->first(); + if ($totalCount) { - return $this->respond(['status' => true, 'code' => 200, 'data' => $totalCount], 200); + return $this->respond(['status' => true, 'code' => 200, 'data' => $totalCount, 'is_copay_yes' => $is_copay_yes], 200); } else { return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to get data'], 200); } diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 4b3a9619..e0d3d07f 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -456,8 +456,9 @@ class TicketController extends BaseController if (!empty($ticket_data['client_policy_id'])){ $ticket_data['client_policy_id_text'] = $this->clientPolicyModel->select('concat(policy_type.policy_type,"-",client_policy.policy_no) as client_policy_name')->join('policy_type','policy_type.id = client_policy.policy_type_id and policy_type.is_active = 1')->where('client_policy.id',$ticket_data['client_policy_id'])->first()['client_policy_name']; } - // dd($ticket_data); + // dd($data); $data['ticket_data'] = $ticket_data; + $data['acms'] = $this->employeeModel->getAcmUsingClientID($ticket_data['client_id']); // dd($data); @@ -853,15 +854,7 @@ class TicketController extends BaseController $replaceData = $ticket_data[$value] ?? ''; } else if ($value == "policy_type") { $replaceData = str_replace("Claim-", "", $this->ticketType[$ticket_data['ticket_type_id']] ?? ""); - } else if ($value == 'emp_name'){ - if(empty($ticket_data['emp_id'])){ - $replaceData = $ticket_data['emp_name']??""; - } - }else if ($value == 'insured_name'){ - if(empty($ticket_data['insured_emp_id'])){ - $replaceData = $ticket_data['insured_name']?? ""; - } - }else { + } else { $replaceData = isset($ticket_data[$value]) ? $ticket_data[$value] : ''; } diff --git a/app/Models/EmployeeModel.php b/app/Models/EmployeeModel.php index 57ac791b..524eb18b 100755 --- a/app/Models/EmployeeModel.php +++ b/app/Models/EmployeeModel.php @@ -287,5 +287,21 @@ class EmployeeModel extends Model } + public function getAcmUsingClientID($client_id) + { + return $this->db->table('client_rm') + ->select('user_profiles.id, user_profiles.first_name') + ->join('user_profiles', 'client_rm.user_id = user_profiles.id') + ->where([ + 'client_rm.level' => 3, + 'user_profiles.role' => 3, + 'client_rm.is_active' => 1, + 'user_profiles.is_active' => 1, + 'client_rm.client_id' => $client_id + ]) + ->get() + ->getResultArray(); + } + } diff --git a/app/Views/ticket_auto_query.php b/app/Views/ticket_auto_query.php index 24dcef21..5caf68d4 100644 --- a/app/Views/ticket_auto_query.php +++ b/app/Views/ticket_auto_query.php @@ -58,6 +58,7 @@