From 68255d35901fc583bb79093bb14f3a2beb9d226e Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Tue, 13 Jan 2026 15:20:24 +0530 Subject: [PATCH 01/24] FIX_"$" remove --- app/Controllers/EmployeeRestController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index c2f9f397..d2c411b1 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -3658,7 +3658,7 @@ class EmployeeRestController extends AdminController where emp.id = :employee_id: and emp.is_active = 1 and emp.emp_status = 'active' limit 1 "; - $binds = ['insured_emp_id'=>$insured_emp_id,'client_policy_id'=>(int)$client_policy_id,'$employee_id'=>$employee_id ]; + $binds = ['insured_emp_id'=>$insured_emp_id,'client_policy_id'=>(int)$client_policy_id,'employee_id'=>$employee_id ]; $emp_ticket_data = $this->employeeModel->query($sql,$binds)->getResultArray(); // print_r(db_connect()->getLastQuery()); die; From b163f3220e4ccc759b2b70e2c08e74b771ec406d Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 21 Jan 2026 09:33:18 +0530 Subject: [PATCH 02/24] FIX_LIVE_ISSUES --- app/Config/Routes.php | 2 +- app/Controllers/ClientController.php | 9 ++-- app/Controllers/EmployeeController.php | 2 +- app/Controllers/LeadsController.php | 19 +++++-- app/Helpers/excel_util_helper.php | 4 +- app/Models/PolicyTransactionModel.php | 48 ++++++++++++++++- app/Views/view_rfq.php | 71 +++++++++++++++++++++++--- 7 files changed, 137 insertions(+), 18 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 89e8cfc8..755be53f 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -427,6 +427,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) { $routes->get('checkDuplicateCdAccount', 'MasterController::checkDuplicateCdAccount'); $routes->get('proceedExcelFileDataValidation', 'EmployeeController::proceedExcelFileDataValidation'); $routes->get('checkTpaApiEnable', 'EmployeeRestController::checkTpaApiEnable'); + $routes->get('generateDemographyDataTable', 'LeadsController::generateDemographyDataTable'); }); $routes->post("policy_tranction/sendInstallmentRemainderMail","PolicyTransactionController::sendInstallmentRemainderMail"); @@ -525,7 +526,6 @@ $routes->cli('cli/check_env', 'MasterController::checkEnv'); $routes->cli('cli/enrollOpendAndClose', 'DashboardController::updatePolicyEnrollmentStatus'); $routes->cli("cli/sendCroneRemainderMail", "DashboardController::sendCroneRemainderMail"); $routes->cli('cli/update-emp-policy-status', 'ClientController::updateEmpAndPolicyStatus'); -$routes->cli('cli/update-emp-policy-status', 'ClientController::updateEmpAndPolicyStatus'); $routes->cli('cli/insurerRFQRemainder', 'LeadsController::remainderForQcr'); $routes->cli('cli/sendMailWithAutoQuery','TicketController::sendMailWithAutoQuery'); $routes->cli('cli/MediAssit-ClaimStatusUpdate','MediAssistApiController::ClaimStatusUpdate'); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 0b6470bc..0b2f549b 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -6091,6 +6091,8 @@ class ClientController extends AdminController // $response = $ticketServiceController->getClaimExcelErrorData(["file_id" => 41]); // $response = $ticketServiceController->claimDumpOnBoardProcess(["file_id" => 17]); // $response = $ticketServiceController->extractExcelData("claims_dump_form_client.xlsx"); + // $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 48]); + // $response = $ticketServiceController->tpaClaimDumpToTicketMasterImporters(["file_id" => 48]); // dd($response); // ---------- TICKET CONTROLLER -------------------------------------------------------------------------------- @@ -6105,7 +6107,8 @@ class ClientController extends AdminController $empServiceController = new EmployeeServiceController(); // $res = $empServiceController->excelFileFormatValidation(['file_id' => '1248']); // $res = $empServiceController->excelFileDataValidation(['file_id' => '1252']); - // $res = $empServiceController->employeesOnboardPreprocess(['file_id' => 1183]); + // $res = $empServiceController->employeesOnboardPreprocess(['file_id' => 1263]); + // $res = $empServiceController->employeesOnboardPreprocess(['file_id' => 1262]); // $res = $empServiceController->employeesOnboardPreprocess(['file_id' => 1169]); // $res = $empServiceController->employeesOnboardProcess(['file_id' => 835]); // $res = $empServiceController->employeesEnrollmentInsert(['file_id' => 836]); @@ -6231,8 +6234,8 @@ class ClientController extends AdminController // $res = $LeadsController->convertQCRJsonToPolicyTerms($jsonArray, $policy_type, $proposel_name, $insurer_name); // $res = $LeadsController->handleMemberDataGPATotalSumInsurerFromExcel(['lead_id' => 169]); // $res = $LeadsController->reorderProposalsByInsurerTotal($jsonArray); - // $res = $LeadsController->calculateMembersDemography(['lead_id' => 326]); - // $res = $LeadsController->generateDemographyDataTable(['lead_id' => 326]); + // $res = $LeadsController->calculateMembersDemography(['lead_id' => 287], "internal"); + // $res = $LeadsController->generateDemographyDataTable(['lead_id' => 287]); // echo $res; // dd($res); diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index f4ceecc2..a22add93 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -392,7 +392,7 @@ class EmployeeController extends AdminController CONCAT( ( SELECT lc.name - FROM level_contect lc + FROM level_contacts lc WHERE lc.id = files.hr_id LIMIT 1 ), diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index a3ebe469..b0eef1fb 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -1136,7 +1136,7 @@ class LeadsController extends BaseController // 12. Conditional rendering based on lead_form_type if ($lead_data['lead_form_type'] == 1) { - $data['demogrphy_html_data'] = $this->generateDemographyDataTable(['lead_id' => $id]); + // $data['demogrphy_html_data'] = $this->generateDemographyDataTable(['lead_id' => $id]); $this->loadLayout('view_rfq.php', $data); } else if ($lead_data['lead_form_type'] == 2) { $data['occupancy'] = $this->occupancyModel->findAll(); @@ -5384,8 +5384,13 @@ class LeadsController extends BaseController return []; } - public function generateDemographyDataTable($param) - { + public function generateDemographyDataTable($param = []) + { + + if ($this->request !== null) { + $param['lead_id'] = $this->request->getGet('lead_id'); + } + $returnData = $this->calculateMembersDemography($param, "internal"); $html = ""; @@ -5431,6 +5436,14 @@ class LeadsController extends BaseController } } + if ($this->request !== null) { + if(!empty($html)){ + return $this->respond(['status' => true, 'data' => $html], 200); + }else{ + return $this->respond(['status' => false, 'data' => $html], 200); + } + } + return $html; } diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php index 98b171e5..c2c77a52 100755 --- a/app/Helpers/excel_util_helper.php +++ b/app/Helpers/excel_util_helper.php @@ -1884,7 +1884,7 @@ if (!function_exists('premium_calculation_manager')) { } // if the family floater case first self add first the process completed, after spouse or any dependent add the rata premium not added this change will handle this - if (strtolower($emp_data['relationship']) != 'self' && $temp_slab_rates[0]['premium_type'] == 1 && $emp_data['temp']['action'] == 'DA') { + if (strtolower($emp_data['relationship']) != 'self' && empty($emp_data['temp']['acting_self']) && $temp_slab_rates[0]['premium_type'] == 1 && $emp_data['temp']['action'] == 'DA') { //set dependent si to 0 $emp_data['policy_details']['basic_cover_si'] = 0; $emp_data['policy_details']['premium'] = 0; @@ -1897,7 +1897,7 @@ if (!function_exists('premium_calculation_manager')) { $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * ($gst / 100)), 2, '.', ''); } - }else if(strtolower($emp_data['relationship']) != 'self' && $temp_slab_rates[0]['premium_type'] == 1 && ($emp_data['temp']['action'] == 'I' || $emp_data['temp']['action'] == 'A' || $emp_data['temp']['action'] == 'MI')){ + }else if(strtolower($emp_data['relationship']) != 'self' && empty($emp_data['temp']['acting_self']) && $temp_slab_rates[0]['premium_type'] == 1 && ($emp_data['temp']['action'] == 'I' || $emp_data['temp']['action'] == 'A' || $emp_data['temp']['action'] == 'MI')){ $emp_data['policy_details']['basic_cover_si'] = 0; $emp_data['policy_details']['premium'] = 0; diff --git a/app/Models/PolicyTransactionModel.php b/app/Models/PolicyTransactionModel.php index 92ab47d8..4c736e26 100644 --- a/app/Models/PolicyTransactionModel.php +++ b/app/Models/PolicyTransactionModel.php @@ -2568,8 +2568,10 @@ pt.action_type as action_type_string, c.client_name, + c.id as client_id, c.short_name AS client_short_name, cb.branch_name AS client_branch_name, + cb.id AS client_branch_id, cb.address1 AS client_address, ptype.policy_type, ptype.bap, @@ -2577,6 +2579,7 @@ ins.name AS insurer_name, ins.short_name AS insurer_short_name, ib.branch_name AS insurer_branch_name, + ib.id AS insurer_branch_id, ib.branch_code AS insurer_branch_code, created_user.first_name AS user_name, @@ -2734,8 +2737,10 @@ pt.action_type as action_type_string, c.client_name, + c.id as client_id, c.short_name AS client_short_name, cb.branch_name AS client_branch_name, + cb.id AS client_branch_id, cb.address1 AS client_address, ptype.policy_type, ptype.bap, @@ -2743,6 +2748,7 @@ ins.name AS insurer_name, ins.short_name AS insurer_short_name, ib.branch_name AS insurer_branch_name, + ib.id AS insurer_branch_id, ib.branch_code AS insurer_branch_code, created_user.first_name as user_name, @@ -3002,13 +3008,14 @@ public function getBDSReportList($start_date = 0, $end_date = 0, $client_id = 0, $insurer_id = 0, $policy_type_id = 0, $date_type = 0, $issuer = 0, $client_branch_id = 0, $insurer_branch_id = 0, $client_policy_id = 0, $user_id = 0, $where = []) { - + $whereAdded = false; $statement_month_condition = ''; if ($date_type == 'statement_month' && $start_date != 0 && $end_date != 0) { $statement_month_condition = " WHERE statement_month >= '" . $start_date . "' AND statement_month <= '" . $end_date . "' "; + $whereAdded = true; } $default_date_filter = ''; @@ -3098,6 +3105,33 @@ $conditions .= " AND pt.issuer = $issuer "; } + $main_conditions = ''; + function addCondition(&$main_conditions, &$whereAdded, $condition) + { + if (!$whereAdded) { + $main_conditions .= " WHERE $condition "; + $whereAdded = true; + } else { + $main_conditions .= " AND $condition "; + } + } + + // 4. Common filters + if ($client_id != 0) { + addCondition($main_conditions, $whereAdded, "client_id = $client_id"); + } + + if ($insurer_id != 0) { + addCondition($main_conditions, $whereAdded, "insurer_id = $insurer_id"); + } + + if ($client_branch_id != 0) { + addCondition($main_conditions, $whereAdded, "client_branch_id = $client_branch_id"); + } + + if ($insurer_branch_id != 0) { + addCondition($main_conditions, $whereAdded, "insurer_branch_id = $insurer_branch_id"); + } $sql = " SELECT * FROM ( @@ -3137,8 +3171,10 @@ pt.action_type as action_type_string, c.client_name, + c.id as client_id, c.short_name AS client_short_name, cb.branch_name AS client_branch_name, + cb.id AS client_branch_id, cb.address1 AS client_address, ptype.policy_type, ptype.bap, @@ -3146,6 +3182,7 @@ ins.name AS insurer_name, ins.short_name AS insurer_short_name, ib.branch_name AS insurer_branch_name, + ib.id AS insurer_branch_id, ib.branch_code AS insurer_branch_code, created_user.first_name AS user_name, @@ -3294,8 +3331,10 @@ pt.action_type as action_type_string, c.client_name, + c.id as client_id, c.short_name AS client_short_name, cb.branch_name AS client_branch_name, + cb.id AS client_branch_id, cb.address1 AS client_address, ptype.policy_type, ptype.bap, @@ -3303,6 +3342,7 @@ ins.name AS insurer_name, ins.short_name AS insurer_short_name, ib.branch_name AS insurer_branch_name, + ib.id AS insurer_branch_id, ib.branch_code AS insurer_branch_code, created_user.first_name as user_name, @@ -3479,8 +3519,10 @@ pt.action_type as action_type_string, c.client_name, + c.id as client_id, c.short_name AS client_short_name, cb.branch_name AS client_branch_name, + cb.id AS client_branch_id, cb.address1 AS client_address, ptype.policy_type, ptype.bap, @@ -3488,6 +3530,7 @@ ins.name AS insurer_name, ins.short_name AS insurer_short_name, ib.branch_name AS insurer_branch_name, + ib.id AS insurer_branch_id, ib.branch_code AS insurer_branch_code, created_user.first_name as user_name, @@ -3616,6 +3659,7 @@ ) AS final_result $statement_month_condition + $main_conditions -- GROUP BY statement_month, insurer_name, policy_no -- WHERE id = 6143 @@ -3631,7 +3675,7 @@ $result = $query->getResultArray(); // $countofalldata = count($result); // dd($result); - // dd($this->db->getLastQuery()); + // dd($this->db->getLastQuery()->getQuery()); $keys = []; $filtered = []; diff --git a/app/Views/view_rfq.php b/app/Views/view_rfq.php index 63c66276..01d8aed9 100644 --- a/app/Views/view_rfq.php +++ b/app/Views/view_rfq.php @@ -1059,7 +1059,7 @@ + + \ No newline at end of file From e0eeb42779a434fc70b1ee380a4c925a008c55ca Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 27 Jan 2026 09:54:24 +0530 Subject: [PATCH 07/24] FIX_FIXES --- .env.sample | 10 +++++++++- app/Filters/AuthMVC.php | 2 +- .../BaseTpaClaimImportService.php | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.env.sample b/.env.sample index 6a9a2f06..9c0f9e71 100755 --- a/.env.sample +++ b/.env.sample @@ -99,4 +99,12 @@ CORS_DEBUG=true APP_SIGNATURE = TOKENTIMEOUT = -JWT_SECRET = \ No newline at end of file +JWT_SECRET = + +ICICI_PRIMARY_KEY_CONSTANT = + +ABHI_PRIMARY_KEY_CONSTANT = + +R_CARE_PRIMARY_KEY_CONSTANT = + +FHPL_PRIMARY_KEY_CONSTANT = \ No newline at end of file diff --git a/app/Filters/AuthMVC.php b/app/Filters/AuthMVC.php index e5826b6b..ef2da046 100755 --- a/app/Filters/AuthMVC.php +++ b/app/Filters/AuthMVC.php @@ -23,7 +23,7 @@ class AuthMVC implements FilterInterface // } // Fingerprint validation - $fp = generateFingerprint() + $fp = generateFingerprint(); // log_message('error',$fp); if (session()->get('fingerprint') !== $fp) { return AuthLogout::logout(); diff --git a/app/Libraries/TPAClaimsImportServices/BaseTpaClaimImportService.php b/app/Libraries/TPAClaimsImportServices/BaseTpaClaimImportService.php index 33fbedc9..1485dee2 100644 --- a/app/Libraries/TPAClaimsImportServices/BaseTpaClaimImportService.php +++ b/app/Libraries/TPAClaimsImportServices/BaseTpaClaimImportService.php @@ -47,7 +47,7 @@ abstract class BaseTpaClaimImportService } $tpaInsertData = $this->mapTPAData($rows, $fileId); - dd($tpaInsertData); + // dd($tpaInsertData); if (empty($tpaInsertData)) { return ['status' => false, 'message' => 'These records already exist in the system.']; From 88cd33e2f0e7f1e7944b348e9c85a2d1d2db7e10 Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Tue, 27 Jan 2026 10:09:25 +0530 Subject: [PATCH 08/24] FIX_due filepath missing --- app/Controllers/ClientController.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 7289c89e..9563cbe2 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -1134,6 +1134,7 @@ class ClientController extends AdminController $data = $this->request->getPost(); $sanitized_data = sanitizeInputArrayAdvanced($data); $form_type = $sanitized_data['form_type'] ?? null; + $uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents'; unset($data['file_name']); @@ -1188,6 +1189,7 @@ class ClientController extends AdminController $data = $this->request->getPost(); $sanitized_data = sanitizeInputArrayAdvanced($data); $form_type = $sanitized_data['form_type'] ?? null; + $uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents'; unset($sanitized_data['file_name']); @@ -1279,6 +1281,7 @@ class ClientController extends AdminController $file = $this->request->getFile('file_name'); + $uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents'; $fileName = file_Upload($file, $uploadFilePath); if (!empty($fileName)) { @@ -1286,10 +1289,10 @@ class ClientController extends AdminController } $sanitized_data['created_by'] = get_session_userid(); - $uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents'; - $File = file_Upload($uploadedFile, $uploadFilePath); - $this->myLogger->logme('info', 'Result of file_Upload: ' . $File); + + + $this->myLogger->logme('info', 'Result of file_Upload: ' . $fileName); unset($data['file_name']); $insertID = $this->clientKYCDocsModel->insert($sanitized_data); @@ -1297,7 +1300,7 @@ class ClientController extends AdminController if ($insertID) { $html = $this->generateKycSingleTable($sanitized_data['client_id']); $dropdown = $this->fetch_dropdown($sanitized_data['client_id']); - return $this->respond(['status' => true, 'code' => 200, 'file_name' => $File, 'html' => $html,'dropdown'=>$dropdown], 200); + return $this->respond(['status' => true, 'code' => 200, 'file_name' => $fileName, 'html' => $html,'dropdown'=>$dropdown], 200); } else { $this->myLogger->logme('error', 'Database insert failed.'); return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to add document'], 200); From 9623492a01196f1df9ff0c874a32522d0ea74530 Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Tue, 27 Jan 2026 11:32:39 +0530 Subject: [PATCH 09/24] FIX_minor issues --- app/Controllers/AppContentManagementController.php | 2 +- app/Controllers/ClientController.php | 5 +++-- app/Controllers/MasterController.php | 2 +- app/Controllers/TicketController.php | 1 + app/Views/add_image_list.php | 2 +- app/Views/cd_master_list.php | 2 +- app/Views/client_list.php | 2 +- app/Views/client_policy.php | 8 ++++---- app/Views/employee_data_list.php | 2 +- app/Views/insurer_export_templete.php | 2 +- app/Views/kyc_list.php | 2 +- app/Views/payout_list.php | 2 +- app/Views/policy_type_list.php | 2 +- app/Views/test_members_list.php | 2 +- 14 files changed, 19 insertions(+), 17 deletions(-) diff --git a/app/Controllers/AppContentManagementController.php b/app/Controllers/AppContentManagementController.php index ac62129d..ac00f848 100755 --- a/app/Controllers/AppContentManagementController.php +++ b/app/Controllers/AppContentManagementController.php @@ -230,7 +230,7 @@ class AppContentManagementController extends AdminController ]); } $request_post_data = $this->request->getPost(); - $data = sanitizeInputArrayAdvanced($data); + $data = sanitizeInputArrayAdvanced($request_post_data); $id = $data['fe_id']; diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 9563cbe2..65b805b4 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -1155,7 +1155,8 @@ class ClientController extends AdminController } else { $kycDocs = $this->generateKycPrimaryTable($sanitized_data['client_id']); } - return $this->respond(['status' => true, 'code' => 200, 'data' => $kycDocs, 'file_name' => $File], 200); + return $this->respond(['status' => true, 'code' => 200, 'data' => $kycDocs, 'file_name' => $file + ], 200); } else { return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to upload KYC document'], 200); } @@ -1212,7 +1213,7 @@ class ClientController extends AdminController } else { $kycDocs = $this->generateKycPrimaryTable($sanitized_data['client_id']); } - return $this->respond(['status' => true, 'code' => 200, 'data' => $kycDocs, 'file_name' => $File], 200); + return $this->respond(['status' => true, 'code' => 200, 'data' => $kycDocs, 'file_name' => $file], 200); } else { return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to upload KYC document'], 200); } diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index be71e82c..e645daf2 100755 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -1383,7 +1383,7 @@ class MasterController extends AdminController } $data = $this->request->getPost(); $sanitized_post_data = sanitizeInputArrayAdvanced($data); - $id = $sanitizeInputArrayAdvanced['PrimaryKey']; + $id = $sanitized_post_data['PrimaryKey']; $update = $this->tpaBranchModel->update($id, $sanitized_post_data); // print_r($this->request->getPost('name[]')); diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 7dee25b6..275797f7 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -3328,6 +3328,7 @@ class TicketController extends BaseController $is_moved = $file->move(WRITEPATH . 'uploads/claims_mis/'); if ($is_moved) { + $file_path = WRITEPATH.'uploads/claims_mis'; $filename = file_Upload_for_lead($file, $file_path); $fileSize = $file->getSize(); // File size in bytes $fileSize = $fileSize / (1024 * 1024); // Convert to MB diff --git a/app/Views/add_image_list.php b/app/Views/add_image_list.php index c91db897..113ce962 100755 --- a/app/Views/add_image_list.php +++ b/app/Views/add_image_list.php @@ -56,7 +56,7 @@ table.dataTable thead th {