diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 696be3fe..e7e80b36 100644 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -107,7 +107,7 @@ class ClientController extends AdminController } - public function Testing() + public function Testing() //this function for only tsesting some logics not use for business logic { $results = $this->clientPolicyModel ->select('id, policy_terms') @@ -312,11 +312,12 @@ class ClientController extends AdminController // ]; $subTypeOptions = [ - 1 => 'Replenishment', + 1 => 'Replenishment By Client', 2 => 'Adjustment', 3 => 'Refund From Deletion', 4 => 'Debit', - 5 => 'Asset Policy', + 5 => 'Non EB', + 6 => 'Refund By Insurer', ]; $data['subTypeOptions'] = $subTypeOptions; @@ -448,7 +449,6 @@ class ClientController extends AdminController { $this->myLogger->logme('error','edit client general info function called'); $uploadFilePath = ROOTPATH . 'public/uploads/logo/'; - // print_r($this->request->getFile('client_logo'));die; $file_name = file_Upload($this->request->getFile('client_logo'), $uploadFilePath); $id = $this->request->getPost('PrimaryKey'); @@ -637,6 +637,11 @@ class ClientController extends AdminController $this->myLogger->logme('error','Client branch CREATE function called'); $data = $this->request->getPost(); + if (!isset($data['sez'])) { + $data['sez'] = 0; + } elseif ($data['sez']) { + $data['sez'] = 1; + } $data['created_by'] = get_session_userid(); $insert = $this->clientBranchModel->insert($data); @@ -672,6 +677,11 @@ class ClientController extends AdminController $id = $this->request->getPost('branch_id_primarykey'); $client_id = $this->request->getPost('client_id'); $data = $this->request->getPost(); + if (!isset($data['sez'])) { + $data['sez'] = 0; + } elseif ($data['sez']) { + $data['sez'] = 1; + } $data['updated_by'] = get_session_userid(); $insert = $this->clientBranchModel->update($id, $data); $this->myLogger->logme('error','Client branch EDITED by {data}', ['data' => get_session_userid()]); @@ -1270,16 +1280,26 @@ class ClientController extends AdminController public function getClientPolicyById($id=null) { $this->myLogger->logme('error','getClientPolicyById function called'); + if($id){ $client_policy_data = $this->clientPolicyModel->where(['id' => $id, 'is_active' => 1])->first(); $insurer_id = $client_policy_data['insurer_id']; $client_id = $client_policy_data['client_id']; - $polices = $this->policesModel->where(['insurer_id' => $insurer_id, 'is_active' => 1])->findAll(); + + $base_policy_policy_type_id = 0; + if($client_policy_data['base_policy'] != null){ + $base_policy_policy_type_id = $this->clientPolicyModel->select('policy_type_id')->where(['id' => $client_policy_data['base_policy'], 'is_active' => 1])->first(); + } + + $polices = $this->policesModel + ->select('policies.*, policy_type.policy_type') + ->join('policy_type', 'policy_type.id = policies.policy_type_id') + ->where(['policies.insurer_id' => $insurer_id, 'policies.is_active' => 1]) + ->findAll(); $client_policy_list = $this->clientPolicyModel->getpolicyWithPattern( $client_id ); $cd_data = $this->CDMasterModel->where('client_id', $client_id)->where('insurer_id', $insurer_id)->findAll(); - - return $this->respond(['status' => true,'code' => 200, 'client_policy_list' => $client_policy_list, 'data' => $client_policy_data, 'cd_data' => $cd_data, "insurer_id" => $client_policy_data['insurer_id'], 'policy' => $polices], 200); + return $this->respond(['status' => true,'code' => 200, 'client_policy_list' => $client_policy_list, 'data' => $client_policy_data, 'cd_data' => $cd_data, "insurer_id" => $client_policy_data['insurer_id'], 'policy' => $polices, 'base_policy_type_id' => $base_policy_policy_type_id['policy_type_id']], 200); }else{ return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200); } @@ -2266,7 +2286,8 @@ class ClientController extends AdminController - public function get_cd_ac($client_id, $insurer_id){ + public function get_cd_ac($client_id, $insurer_id) + { $cd_data = $this->CDMasterModel ->where('client_id', $client_id) @@ -2307,7 +2328,8 @@ class ClientController extends AdminController } - public function checkPolicyType($policy_type_id, $client_branch_id, $client_id){ + public function checkPolicyType($policy_type_id, $client_branch_id, $client_id) + { $policyCount = $this->clientPolicyModel ->where('policy_type_id', $policy_type_id) @@ -2372,7 +2394,8 @@ class ClientController extends AdminController - public function getPolicyTermsFormJson($policy_type_id){ + public function getPolicyTermsFormJson($policy_type_id) + { $JSON = $this->policyTypeModel->where('id', $policy_type_id)->first(); return $this->respond(['status' => true, 'data' => $JSON], 200); @@ -2403,7 +2426,8 @@ class ClientController extends AdminController } - public function checkAdditionPremiumJSON($client_id, $client_policy_id){ + public function checkAdditionPremiumJSON($client_id, $client_policy_id) + { $get_additional_rack_rate_relationship_json = $this->policyPremium2Model ->where('client_id', $client_id) diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index 5d6ec3b9..0d7fde57 100644 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -125,8 +125,6 @@ class MasterController extends AdminController } - - public function editInsurerOnboarding($id = null) { @@ -367,7 +365,6 @@ class MasterController extends AdminController // $this->loadLayout('insurer_onboarding', $data); } - public function tpaRemove($id = null) { $this->myLogger->logme('error','TPA Remove function called'); @@ -382,8 +379,6 @@ class MasterController extends AdminController } } - - public function removeTPABranch($id = null) { $this->myLogger->logme('error','TPA Branch Remove function called'); @@ -424,8 +419,6 @@ class MasterController extends AdminController } - - public function createTPAGeneralInfo() { @@ -483,12 +476,6 @@ class MasterController extends AdminController } } - - - - - - public function createTPABranch() { @@ -521,8 +508,6 @@ class MasterController extends AdminController } } - - public function editTPAOnboarding($id = null) { @@ -555,9 +540,6 @@ class MasterController extends AdminController } - - - public function editTPAGeneralInfo() { $this->myLogger->logme('error','edit TPA general info function called'); @@ -624,7 +606,6 @@ class MasterController extends AdminController } } - public function editTPAGet($id = null) { $this->myLogger->logme('error','Edit TPA Onboarding function called'); @@ -639,7 +620,6 @@ class MasterController extends AdminController exit(); } - public function editTPABranch() { $this->myLogger->logme('error','TPA branch CREATE function called'); @@ -680,7 +660,6 @@ class MasterController extends AdminController } } - public function tpaBranchList($id = null) { $this->myLogger->logme('error','TPA List function called'); @@ -693,14 +672,11 @@ class MasterController extends AdminController exit(); } - - - //Ends TPA Models + + //Start KYC - - public function kycList() { $this->myLogger->logme('error','KYC list function called'); diff --git a/app/Models/ClientBranchModel.php b/app/Models/ClientBranchModel.php index 1ace7a2a..c6083a49 100644 --- a/app/Models/ClientBranchModel.php +++ b/app/Models/ClientBranchModel.php @@ -19,6 +19,11 @@ class ClientBranchModel extends Model "created_by", "updated_by", "is_active", + "pincode", + "address1", + "address2", + "gst", + "sez", ]; public function getBranchAndContactByBranchId($branch_id){ diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php index d0ce5e00..ef056e3e 100644 --- a/app/Models/ClientPolicyModel.php +++ b/app/Models/ClientPolicyModel.php @@ -131,11 +131,12 @@ class ClientPolicyModel extends Model public function getinsurerswithclientid($id){ return $this->db->table('client_policy') - ->select('client_policy.*') + ->select('client_policy.*, cd_master.cd_ac_no') ->select('insurers.name as insurer_name, insurers.short_name as insurer_short') ->select('clients.client_name as client_name') ->join('clients','clients.id=client_policy.client_id') ->join('insurers', 'insurers.id = client_policy.insurer_id') + ->join('cd_master', 'cd_master.insurer_id = client_policy.insurer_id') ->where('client_policy.client_id', $id) ->groupBy('client_policy.insurer_id') ->groupBy('client_policy.client_id', $id) // Group by insurer_id diff --git a/app/Models/InsurerModel.php b/app/Models/InsurerModel.php index 6c5d3617..f388b93b 100644 --- a/app/Models/InsurerModel.php +++ b/app/Models/InsurerModel.php @@ -23,21 +23,22 @@ class InsurerModel extends Model - public function getCreatedByUserName(){ + public function getCreatedByUserName() + { return $this->db->table('insurers') ->select('insurers.*') // ->select('user_profiles.first_name as user_name') // ->join('user_profiles', 'user_profiles.id = clients.created_by') ->get() - ->getResult(); - + ->getResult(); } public function getInsurerName($insurerId) { // Fetch the insurer name based on the insurer ID - $query = $this->select('id,name') - ->where('id', $insurerId) + $query = $this->select('insurers.id,insurers.name, cd_master.cd_ac_no') + ->join('cd_master', 'cd_master.insurer_id = insurers.id') + ->where('insurers.id', $insurerId) ->get(); if ($query->resultID->num_rows > 0) { @@ -47,19 +48,6 @@ class InsurerModel extends Model return null; // or handle accordingly if the insurer is not found } - // public function getdepositData($id) - // { - // // Fetch the insurer name based on the insurer ID - // $query = $this->db->table('cash_deposit') - - - // ->get() - - - // ->getResult(); - - // } - - } +} \ No newline at end of file diff --git a/app/Views/cd_master_list.php b/app/Views/cd_master_list.php index 21e599ce..6f781f49 100644 --- a/app/Views/cd_master_list.php +++ b/app/Views/cd_master_list.php @@ -40,7 +40,7 @@ table.dataTable thead th {