From 24dfb6b289947ca60097def74af5221b982be5f1 Mon Sep 17 00:00:00 2001 From: velz Date: Thu, 16 Apr 2026 17:45:50 +0530 Subject: [PATCH 1/6] FIX_VISIT_SSO&TPA_DELETION_1 --- .gitignore | 1 + app/Controllers/ApiServiceController.php | 64 +++++++++++++++----- app/Controllers/EmployeeController.php | 4 ++ app/Controllers/FhplApiController.php | 1 + app/Controllers/HealthIndiaApiController.php | 1 + app/Controllers/MediAssistApiController.php | 2 +- app/Controllers/VidalApiController.php | 1 + app/Views/batch_list.php | 9 ++- 8 files changed, 65 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 1ab80e5d..adeb2bd5 100755 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,5 @@ composer.lock .env .phpunit* phpqueue.sh +.claude diff --git a/app/Controllers/ApiServiceController.php b/app/Controllers/ApiServiceController.php index 2b7c2e45..23ee92c9 100644 --- a/app/Controllers/ApiServiceController.php +++ b/app/Controllers/ApiServiceController.php @@ -231,11 +231,23 @@ class ApiServiceController extends BaseController // json_decode(file_get_contents(WRITEPATH.'/tmp/db.json'),true), // json_decode(file_get_contents(WRITEPATH.'/tmp/medi.json'),true) // ); - // print_rr($report); + // print_rr('tata'); // die(); + // $mediAssistController = new MediAssistApiController(); + // $mediAssistController->MediAssistGetBenefDetails( [ 'policy_no' => '97000063250400000012', 'file_id' =>'5704','client_policy_id' => '1839' ] ); + // $mediAssistController->MediAssistGetBenefDetails( [ 'policy_no' => '97000063250400000016', 'file_id' =>'5704','client_policy_id' => '2002' ] ); + // die(); + // $vidalApiController = new VidalApiController; + // $vidalApiController->VidalGetBenefDetails( [ 'policy_no' => '570000/48/2026/363', 'file_id' =>'5264','client_policy_id' => '9433'] ); + // $fhplApiController = new FhplApiController; + // $fhplApiController->FhplGetBenefDetails( [ 'policy_no' => '570000/48/2026/453', 'file_id' =>'9999','client_policy_id' => '3557'] ); + + // $healthIndiaApiController = new HealthIndiaApiController; + // $healthIndiaApiController->HealthIndiaGetBenefDetails( [ 'policy_no' => '97000063250400000116', 'file_id' =>'9998','client_policy_id' => '6523'] ); + // die(); //START OF THE PROGRAM log_message('error', "getTPAID payloads :" . json_encode($this->request->getPost() ?? [])); $tpa_id = $this->request->getPost('tpa_id') ?? null; @@ -452,7 +464,7 @@ class ApiServiceController extends BaseController $data = $db->table('employees e') ->select('pt.policy_type, e.name, e.email_corporate as email, e.mobile as phone, e.emp_code as memberId, e.gender, e.dob, e.relationship as relation, - cp.policy_no as policyNumber, ep.employee_id as employeeId, cp.policy_start_date as policyStartDate, cp.policy_end_date as policyEndDate , cp.wellness_plan_id as planId , cp.wellness_vendor_id') + cp.policy_no as policyNumber, ep.employee_id as employeeId,ep.id, cp.policy_start_date as policyStartDate, cp.policy_end_date as policyEndDate , cp.wellness_plan_id as planId , cp.wellness_vendor_id') ->join('employee_polices ep', 'e.id = ep.employee_id') ->join('client_policy cp', 'ep.client_policy_id = cp.id') ->join('policy_type pt', 'cp.policy_type_id = pt.id') @@ -480,20 +492,40 @@ class ApiServiceController extends BaseController } else if ($row['planId'] != null && empty($row['wellness_vendor_id'])) // VISIT { - $userParams['name'] = $row['name']; - $userParams['email'] = $row['email']; - $userParams['phone'] = $row['phone']; - $userParams['memberId'] = $row['employeeId']; // memberId is unique primary key. - $userParams['gender'] = $row['gender']; - $userParams['dob'] = $row['dob']; - $userParams['relation'] = $row['relation']; - $userParams['policyNumber'] = $row['policyNumber']; - $userParams['employeeId'] = $row['memberId']; - $userParams['policyStartDate']= $row['policyStartDate']; - $userParams['policyEndDate'] = $row['policyEndDate']; - $userParams['policyName'] = $row['policy_type']; - $userParams['planId'] = $row['planId']; - $userParams['moduleName'] = 'home'; + + //OLD PARAMS + // $userParams['name'] = $row['name']; + // $userParams['email'] = $row['email']; + // $userParams['phone'] = $row['phone']; + // $userParams['memberId'] = $row['employeeId']; // memberId is unique primary key. + // $userParams['gender'] = $row['gender']; + // $userParams['dob'] = $row['dob']; + // $userParams['relation'] = $row['relation']; + // $userParams['policyNumber'] = $row['policyNumber']; + // $userParams['employeeId'] = $row['memberId']; + // $userParams['policyStartDate']= $row['policyStartDate']; + // $userParams['policyEndDate'] = $row['policyEndDate']; + // $userParams['policyName'] = $row['policy_type']; + // $userParams['planId'] = $row['planId']; + // $userParams['moduleName'] = 'home'; + + //NEW PARAMS + $userParams['memberId'] = $row['id']; // employee policy primary key (which used while onboard)from DB + $userParams['phone'] = $row['phone']; + $userParams['email'] = $row['email']; + $userParams['relationship'] = $row['relation']; + $userParams['gender'] = $row['gender']; + $userParams['dob'] = $row['dob']; + $userParams['policyNumber'] = $row['policyNumber']; + $userParams['policyStartDate'] = $row['policyStartDate']; + $userParams['policyEndDate'] = $row['policyEndDate']; + $userParams['plan'] = $row['planId']; + $userParams['source'] = 'NAHANCE'; + $userParams['employeeId'] = $row['memberId']; + $userParams['firstName'] = $row['name']; + $userParams['middleName'] = ''; + $userParams['lastName'] = ''; + break; // stop after first GMC match } } diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 3fc7e8fe..1728bd57 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -497,6 +497,8 @@ class EmployeeController extends AdminController batch_files.amount, batch_files.status, batch_files.client_branch_id, + insurers.short_name as insurer_short_name, + tpa.short_name as tpa_short_name, DATE_FORMAT(batch_files.policy_issue_date, '%d/%m/%Y') AS policy_issue_date, CASE @@ -512,6 +514,8 @@ class EmployeeController extends AdminController ") ->join('client_policy', 'client_policy.id = batch_files.client_policy_id') + ->join('insurers', 'client_policy.insurer_id = insurers.id') + ->join('tpa', 'client_policy.tpa_id = tpa.id') ->join('client_branch', 'client_branch.id = batch_files.client_branch_id') ->join('policy_type', 'policy_type.id = client_policy.policy_type_id') ->join('clients', 'clients.id = client_policy.client_id') diff --git a/app/Controllers/FhplApiController.php b/app/Controllers/FhplApiController.php index f43430f4..0589b80e 100644 --- a/app/Controllers/FhplApiController.php +++ b/app/Controllers/FhplApiController.php @@ -1037,6 +1037,7 @@ class FhplApiController extends BaseController 'is_active' => 1, 'created_by' => $file_info[0]['created_by'] ?? null, + 'action_flag_status' => $row['IsActive'] == 1 ? 'A' : 'D' ]; } diff --git a/app/Controllers/HealthIndiaApiController.php b/app/Controllers/HealthIndiaApiController.php index 01e86c12..ed5f7e1a 100644 --- a/app/Controllers/HealthIndiaApiController.php +++ b/app/Controllers/HealthIndiaApiController.php @@ -1066,6 +1066,7 @@ class HealthIndiaApiController extends BaseController 'is_active' => 1, 'created_by' => $file_info[0]['created_by'] ?? null, + 'action_flag_status' => $row['insuredStatus'] == 'Active' ? 'A' : 'D' ]; } // log_message('error','HEALTH_INDIA - COUNT' . count($mappedRows)); diff --git a/app/Controllers/MediAssistApiController.php b/app/Controllers/MediAssistApiController.php index 3a70329b..e16a8cd1 100644 --- a/app/Controllers/MediAssistApiController.php +++ b/app/Controllers/MediAssistApiController.php @@ -807,7 +807,7 @@ class MediAssistApiController extends BaseController 'gender' => strtoupper($row['benefSex'] ?? null), 'self' => strtolower($row['relName'] ?? '') === 'self' ? 1 : 0, - 'si' => $row['sum_insured'] ?? null, + 'si' => $row['sum_Insured'] ?? null, 'doj' => $this->mediDate($row['benefWEF'] ?? null), diff --git a/app/Controllers/VidalApiController.php b/app/Controllers/VidalApiController.php index 23394231..06a78a57 100644 --- a/app/Controllers/VidalApiController.php +++ b/app/Controllers/VidalApiController.php @@ -1617,6 +1617,7 @@ class VidalApiController extends BaseController 'doj' => $doj, 'is_active' => 1, 'created_by' => $file_info[0]['created_by'] ?? null, + 'action_flag_status' => $row['isDeleted'] == 0 ? 'D' : 'A' ]; } diff --git a/app/Views/batch_list.php b/app/Views/batch_list.php index 7b1b0f6f..29afb9f5 100755 --- a/app/Views/batch_list.php +++ b/app/Views/batch_list.php @@ -141,7 +141,14 @@ - - + + + + + + From c6d39cb3534f4bfc682306450340277582c7f03b Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Fri, 17 Apr 2026 18:26:26 +0530 Subject: [PATCH 2/6] FIX_POS --- app/Views/pos_list.php | 123 +++++++++++++++++++++++++---------------- 1 file changed, 74 insertions(+), 49 deletions(-) diff --git a/app/Views/pos_list.php b/app/Views/pos_list.php index 58345781..4f164095 100644 --- a/app/Views/pos_list.php +++ b/app/Views/pos_list.php @@ -128,10 +128,12 @@
+
- + +
@@ -173,7 +175,7 @@
- Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG. <= Default + Allowed: PDF, PNG, JPG, JPEG.
@@ -181,7 +183,7 @@
- Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG. <= Default + Allowed: PDF, PNG, JPG, JPEG.
@@ -189,7 +191,7 @@
- Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG. <= Default + Allowed: PDF, PNG, JPG, JPEG.
@@ -227,41 +229,6 @@
+ \ No newline at end of file From fc10f71680b3b1927030464726a95dd1ee1f6a19 Mon Sep 17 00:00:00 2001 From: Venkatesh Date: Sat, 18 Apr 2026 11:40:35 +0530 Subject: [PATCH 3/6] FIX_LEAD_TO_OPPRTUTITIES_AND_MEDIASSIST_CLAIMS_STATUS_MAPPING --- app/Controllers/LeadsController.php | 4 ++-- app/Controllers/MediAssistApiController.php | 6 ++--- app/Views/leads_form.php | 3 +++ app/Views/leads_form_handler.php | 10 +++++--- app/Views/leads_non_eb.php | 26 ++++++++++++--------- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index b6f5f35f..765afe8f 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -4774,7 +4774,7 @@ class LeadsController extends BaseController // πŸ”Ή Client Details (Single Row) $data['actual_lead_client_details'] = $this->leadModel - ->select('sales_actual_leads.company_name, clients.short_name, sales_actual_leads.email, sales_actual_leads.phone, sales_actual_leads.address, sales_actual_leads.website, sales_actual_leads.gst_number, sales_actual_leads.status, sales_actual_leads.assigned_to') + ->select('sales_actual_leads.company_name, clients.short_name, clients.client_type, sales_actual_leads.email, sales_actual_leads.phone, sales_actual_leads.address, sales_actual_leads.website, sales_actual_leads.gst_number, sales_actual_leads.status, sales_actual_leads.assigned_to') ->join('clients', 'clients.id = sales_actual_leads.client_id', 'left') ->where('sales_actual_leads.lead_id', $actual_lead_id) ->first(); // first row only @@ -5527,7 +5527,7 @@ class LeadsController extends BaseController * * @param string $recipientType insurer|client|internal */ - protected function downloadFileFromGoogleSheet(array $lead_data, string $recipientType = 'insurer'): array + protected function downloadFileFromGoogleSheet(array $lead_data, string $recipientType = 'insurer'): ?array { try { $leadId = (int) ($lead_data['id'] ?? 0); diff --git a/app/Controllers/MediAssistApiController.php b/app/Controllers/MediAssistApiController.php index 3a70329b..e553b989 100644 --- a/app/Controllers/MediAssistApiController.php +++ b/app/Controllers/MediAssistApiController.php @@ -596,7 +596,7 @@ class MediAssistApiController extends BaseController "Confirmation Awaited" => 4, "Information Awaited Reminder" => 4, "Information Awaited Final Reminder" => 4, - "Insurer Concurrence Awaited" => 6, + "Insurer Concurrence Awaited" => 7, "Closed" => 12, "Physical Documents Awaited" => 9, @@ -944,7 +944,7 @@ class MediAssistApiController extends BaseController "Confirmation Awaited" => 4, "Information Awaited Reminder" => 4, "Information Awaited Final Reminder" => 4, - "Insurer Concurrence Awaited" => 6, + "Insurer Concurrence Awaited" => 7, "Closed" => 12, "Physical Documents Awaited" => 9, @@ -1191,7 +1191,7 @@ class MediAssistApiController extends BaseController "Confirmation Awaited" => 4, "Information Awaited Reminder" => 4, "Information Awaited Final Reminder" => 4, - "Insurer Concurrence Awaited" => 6, + "Insurer Concurrence Awaited" => 7, "Closed" => 12, "Physical Documents Awaited" => 9, diff --git a/app/Views/leads_form.php b/app/Views/leads_form.php index af7fbeff..c4b3e57a 100644 --- a/app/Views/leads_form.php +++ b/app/Views/leads_form.php @@ -2516,6 +2516,9 @@ $('#client_name').val(actualLeadClientName); $('#gst').val(actual_lead_client_details.gst_number || ''); + if (actual_lead_client_details.client_type !== undefined && actual_lead_client_details.client_type !== null && actual_lead_client_details.client_type !== '') { + $('#client_type').val(String(actual_lead_client_details.client_type)); + } // existingShortName = actual_lead_client_details.short_name || ''; // if (existingShortName) { diff --git a/app/Views/leads_form_handler.php b/app/Views/leads_form_handler.php index 1e984f08..6665a52a 100644 --- a/app/Views/leads_form_handler.php +++ b/app/Views/leads_form_handler.php @@ -525,9 +525,13 @@ if (isset($selected_lead_type)) { } if(client_type == ""){ - toastr.warning('Please select the client type', 'Warning'); - $('#client_short_name').val('') - return; + var aid = $('#actual_lead_id').val(); + if (!aid || aid === '0') { + toastr.warning('Please select the client type', 'Warning'); + $('#client_short_name').val(''); + return; + } + // Actual-lead autofill: short name may be set before client type is chosen; do not clear it. } let value = $(input).val(); diff --git a/app/Views/leads_non_eb.php b/app/Views/leads_non_eb.php index 3fdbc536..7ee7ca64 100644 --- a/app/Views/leads_non_eb.php +++ b/app/Views/leads_non_eb.php @@ -853,8 +853,10 @@ var pageBackButton = '" class="topbar-icon $('#client_name').val(actualLeadClientName); $('#gst').val(actual_lead_client_details.gst_number || ''); - // existingShortName = actual_lead_client_details.short_name || ''; - // if (existingShortName) { - // // ── Short name EXISTS β€” just populate and validate ──────── - // $('#client_short_name').val(existingShortName); - // // validateInput($('#client_short_name')[0], 'clients', 'short_name'); - - // } else {} - // Auto-generate short name from company name - // Use a small delay to ensure DOM is ready + if (actual_lead_client_details.client_type !== undefined && actual_lead_client_details.client_type !== null && actual_lead_client_details.client_type !== '') { + $('#client_type').val(String(actual_lead_client_details.client_type)); + } + let existingShortName = actual_lead_client_details.short_name || ''; + if (existingShortName) { + // Prefer persisted short name while editing. + actualLeadShortName = existingShortName; + $('#client_short_name').val(existingShortName); + } else { + // Fallback: generate only when short name is unavailable. setTimeout(function () { let baseName = actual_lead_client_details.company_name .trim() @@ -1377,6 +1380,7 @@ var pageBackButton = ' Date: Sat, 18 Apr 2026 13:55:35 +0530 Subject: [PATCH 4/6] FIX_UI issues noted --- app/Controllers/TicketController.php | 2 + app/Views/batch_list.php | 212 ++++++++++++++++-- app/Views/claim_dump_file_list.php | 8 +- app/Views/client_basic_info.php | 4 +- app/Views/file_list.php | 2 +- app/Views/hr_file_upload.php | 2 +- app/Views/import_export.php | 2 +- app/Views/insurer_basic_info.php | 2 +- .../policy_transaction_endorsement_list.php | 2 +- .../policy_transaction_inception_form.php | 8 +- .../policy_transaction_inception_list.php | 2 +- .../policy_transaction_inception_list_2.php | 2 +- app/Views/pt_form_file_upload_tab.php | 1 + app/Views/ticket_feedback_list.php | 9 +- app/Views/ticket_form_gmc.php | 10 +- app/Views/ticket_form_gpa.php | 10 +- app/Views/ticket_form_motor.php | 10 +- app/Views/ticket_mail_template.php | 8 +- public/assets/css/custom.css | 28 +++ 19 files changed, 283 insertions(+), 41 deletions(-) diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 146b748e..4302a338 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -737,6 +737,8 @@ class TicketController extends BaseController public function ticket_form($ticket_type) { $data = $this->ticket_form_data($ticket_type); + $data['tab_name'] = "Claims"; + $data['page_name'] = "Claims"; // dd($data); return $this->loadLayout('ticket_form_handler', $data); } diff --git a/app/Views/batch_list.php b/app/Views/batch_list.php index f368adcd..be7b1e6a 100755 --- a/app/Views/batch_list.php +++ b/app/Views/batch_list.php @@ -1,15 +1,105 @@ + $file) { + $batch_col_max_len[0] = max($batch_col_max_len[0], mb_strlen((string) ($key + 1))); + $batch_col_max_len[1] = max($batch_col_max_len[1], mb_strlen((string) ($file['batch_code'] ?? ''))); + $batch_col_max_len[2] = max($batch_col_max_len[2], mb_strlen((string) ($file['file_name'] ?? ''))); + $batch_col_max_len[3] = max($batch_col_max_len[3], mb_strlen((string) ($file['client_short_name'] ?? ''))); + $batch_col_max_len[4] = max($batch_col_max_len[4], mb_strlen((string) ($file['branch_name'] ?? ''))); + $policy_display_len = trim( + (isset($file['policy_type']) ? $file['policy_type'] : '') + . ' - ' + . (isset($file['policy_no']) ? $file['policy_no'] : '') + ); + $batch_col_max_len[5] = max($batch_col_max_len[5], mb_strlen($policy_display_len)); + $batch_col_max_len[6] = max($batch_col_max_len[6], mb_strlen((string) ($file['event_type'] ?? ''))); + $insLabel = $insurer_or_tpa[$file['insurer_or_tpa'] ?? ''] ?? ''; + $batch_col_max_len[7] = max($batch_col_max_len[7], mb_strlen((string) $insLabel)); + $actKey = $file['actions'] ?? ''; + $actLabel = $import_or_export[$actKey] ?? ucfirst((string) $actKey); + $batch_col_max_len[8] = max($batch_col_max_len[8], mb_strlen((string) $actLabel)); + $countStr = ($file['count'] ?? null) === null ? '-' : (string) $file['count']; + $batch_col_max_len[9] = max($batch_col_max_len[9], mb_strlen($countStr)); + $batch_col_max_len[10] = max($batch_col_max_len[10], mb_strlen((string) format_indian_number($file['amount']))); + $userTime = change_date_format($file['created_at'] ?? '', 'Y-m-d H:i:s', 'd M Y h:i a') + . ' by ' + . get_username($file['created_by'] ?? ''); + $batch_col_max_len[11] = max($batch_col_max_len[11], mb_strlen($userTime)); + $batch_col_max_len[12] = max($batch_col_max_len[12], mb_strlen((string) ($file['status'] ?? ''))); + $batch_col_max_len[13] = max($batch_col_max_len[13], 2); + } +} + +$batch_col_min_px = [48, 72, 100, 72, 80, 120, 88, 96, 72, 56, 80, 160, 96, 52]; +$batch_col_max_px = [64, 220, 480, 240, 240, 640, 200, 200, 140, 110, 160, 560, 320, 64]; +$batch_col_width_px = []; +for ($i = 0; $i < $batch_col_count; $i++) { + $chars = max($batch_col_max_len[$i], mb_strlen($batch_header_labels[$i])); + $px = (int) round($chars * 7.0 + 26); + $batch_col_width_px[$i] = min( + $batch_col_max_px[$i], + max($batch_col_min_px[$i], $px) + ); +} +?>
@@ -130,7 +239,7 @@
- +
@@ -159,15 +268,25 @@ - - + + - + @@ -347,7 +466,7 @@
S.No 
+ -
diff --git a/app/Views/client_basic_info.php b/app/Views/client_basic_info.php index d2bae3a3..4cf5ab23 100755 --- a/app/Views/client_basic_info.php +++ b/app/Views/client_basic_info.php @@ -162,7 +162,7 @@ input:checked + .slider:before { - Allowed: PNG, JPG, JPEG. Size : 200KB Dimension : 100 X 100 Pixels + Allowed: JPG, JPEG, PNG. Size : 200KB Dimension : 100 X 100 Pixels
@@ -465,7 +465,7 @@ input:checked + .slider:before { $.each(res.data, function (index, item) { var row = ` -
${item.file_name}

Allowed: PNG, JPG, JPEG. +

Allowed: JPG, JPEG, PNG. diff --git a/app/Views/file_list.php b/app/Views/file_list.php index 759cdba6..1fcba673 100755 --- a/app/Views/file_list.php +++ b/app/Views/file_list.php @@ -220,7 +220,7 @@ - Allowed: XLS, XLSX. Size : 25MB Dimension : 100 X 100 + Allowed: XLS, XLSX. Size : 25MB diff --git a/app/Views/hr_file_upload.php b/app/Views/hr_file_upload.php index 62979743..50464d26 100644 --- a/app/Views/hr_file_upload.php +++ b/app/Views/hr_file_upload.php @@ -230,7 +230,7 @@ - Allowed: XLS, XLSX. Size : 25MB Dimension : 100 X 100 + Allowed: XLS, XLSX. Size : 25MB diff --git a/app/Views/import_export.php b/app/Views/import_export.php index 89584e0f..84fe0c7c 100755 --- a/app/Views/import_export.php +++ b/app/Views/import_export.php @@ -258,7 +258,7 @@ table.dataTable thead th {