From d9bd488f2abce5b0ccce35bb34cc2c9631117abe Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Tue, 25 Feb 2025 14:55:33 +0530 Subject: [PATCH 1/9] FIX_POLICY_TRANSACTION_INCEPTION_EDIT/DELETE_SRI --- .../policy_transaction_inception_list.php | 135 +++++++++--------- 1 file changed, 70 insertions(+), 65 deletions(-) diff --git a/app/Views/policy_transaction_inception_list.php b/app/Views/policy_transaction_inception_list.php index 6509a81f..173a128a 100644 --- a/app/Views/policy_transaction_inception_list.php +++ b/app/Views/policy_transaction_inception_list.php @@ -319,7 +319,7 @@ table.dataTable tbody td { Edit - + Delete @@ -370,25 +370,25 @@ table.dataTable tbody td { document.addEventListener("DOMContentLoaded", function () { const table = document.getElementById("tickets-table"); - // Create custom dropdown function createCustomDropdown(row) { - // Get the original dropdown items const originalDropdown = row.querySelector('.dropdown-menu'); if (!originalDropdown) return null; - // Create new dropdown with proper background and spacing const customDropdown = document.createElement('div'); customDropdown.className = 'custom-dropdown-menu'; - // Copy inner content while maintaining icon alignment - customDropdown.innerHTML = originalDropdown.innerHTML; + const items = originalDropdown.querySelectorAll('.dropdown-item'); + items.forEach(item => { + const newItem = item.cloneNode(true); + newItem.removeAttribute('onclick'); + customDropdown.appendChild(newItem); + }); return customDropdown; } let activeDropdown = null; - // Add click event listener to rows table.querySelectorAll("tbody tr").forEach(row => { const customDropdown = createCustomDropdown(row); if (!customDropdown) return; @@ -401,51 +401,56 @@ document.addEventListener("DOMContentLoaded", function () { return; } - // Hide any active dropdown - if (activeDropdown) { + // Close any existing dropdown + if (activeDropdown && activeDropdown !== customDropdown) { activeDropdown.style.display = 'none'; } - // Get click position const rect = event.target.getBoundingClientRect(); - // Position the dropdown with some offset customDropdown.style.display = 'block'; customDropdown.style.position = 'fixed'; customDropdown.style.left = `${rect.left}px`; - customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap + customDropdown.style.top = `${rect.bottom + 5}px`; - // Set as active dropdown activeDropdown = customDropdown; - event.stopPropagation(); }); - // Preserve click handlers and add auto-close + // Handle clicks on dropdown items customDropdown.querySelectorAll('.dropdown-item').forEach(item => { item.addEventListener('click', function(e) { - const onclickAttr = this.getAttribute('onclick'); - if (onclickAttr) { - eval(onclickAttr); - } + e.preventDefault(); + e.stopPropagation(); + + const id = this.getAttribute('data-id'); - const href = this.getAttribute('href'); - if (href && href !== '#') { - window.location.href = href; + // Handle edit button + if (this.classList.contains('btnEdit') && id) { + getPolicyTransactionDataForEdit(id); + } + // Handle delete button + else if (this.classList.contains('delete') && id) { + removePolicyTransaction(this, id); + } + // Handle other links + else { + const href = this.getAttribute('href'); + if (href && href !== '#' && href !== 'javascript: void(0);') { + window.location.href = href; + } } - // Close the dropdown after handling the click + // Close dropdown if (activeDropdown) { activeDropdown.style.display = 'none'; activeDropdown = null; } - - e.stopPropagation(); - }); + }, { once: true }); }); }); - // Close dropdown when clicking outside + // Close dropdown on outside click document.addEventListener("click", function() { if (activeDropdown) { activeDropdown.style.display = 'none'; @@ -1486,7 +1491,7 @@ function onlyNumbers(event) \ No newline at end of file diff --git a/app/Views/ticket_edit_onbording.php b/app/Views/ticket_edit_onbording.php index 96064eb9..835a252f 100644 --- a/app/Views/ticket_edit_onbording.php +++ b/app/Views/ticket_edit_onbording.php @@ -24,28 +24,28 @@ diff --git a/app/Views/ticket_form_gmc.php b/app/Views/ticket_form_gmc.php index 31a7c964..23c8151c 100644 --- a/app/Views/ticket_form_gmc.php +++ b/app/Views/ticket_form_gmc.php @@ -294,6 +294,12 @@ value="" name="settle_letter"> + + - + +
@@ -363,6 +373,7 @@ $(document).ready(function() { flatpickr("#denial_date", { dateFormat: "d/m/Y", allowInput: false }); flatpickr("#approved_date", { dateFormat: "d/m/Y", allowInput: false }); flatpickr("#settled_date", { dateFormat: "d/m/Y", allowInput: false }); + flatpickr("#pay_initiate_date", { dateFormat: "d/m/Y", allowInput: false }); // updateClaimStatusDisplay("") var extraFields = ; @@ -408,7 +419,7 @@ $(document).ready(function() { function updateClaimStatusDisplay(value) { // Hide all sections and remove required attribute from their inputs and textareas - let sections = $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned'); + let sections = $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned, .payment, .non_id'); sections.hide().find('input, textarea').removeAttr('required'); // Determine which section to show @@ -429,11 +440,22 @@ function updateClaimStatusDisplay(value) { showClass = '.canceled'; } else if (value == 14) { // RETURNED showClass = '.returned'; + } else if (value == 1) { // NON ID + showClass = '.non_id'; + } else if (value == 10) { // PAYMENT INITIATED + showClass = '.payment'; } // Show the relevant section and enable required attributes if (showClass) { - $(showClass).show().find('input, textarea').attr('required', true); + // $(showClass).show().find('input, textarea').attr('required', true); + $(showClass).show().find('input, textarea').attr('required', true).each(function() { + var $label = $("label[for='" + $(this).attr('id') + "']"); + if ($label.length && !$label.find('.text-danger').length) { + $label.append(' *'); + } + }); + } } @@ -455,7 +477,7 @@ function claimStatusFieldChanges(fields) { var $label = $parentDiv.find("label[for='" + fieldId + "']"); if ($label.length && !$label.find(".text-danger").length) { - $label.append(' *'); + // $label.append(' *'); } } }); @@ -477,7 +499,7 @@ function claimStatusFieldRemoveREquired(fields, remove_or_add, thirdClass) { var $label = $parentDiv.find("label[for='" + fieldId + "']"); // if(remove_or_add == false){ // $parentDiv.find("label[for='" + fieldId + "'] .text-danger").remove(); - // console.log('one', remove_or_add); + // // console.log('one', remove_or_add); // }else{ // if ($label.length && !$label.find(".text-danger").length) { // $label.append(' *'); @@ -512,10 +534,14 @@ $(document).on("input", function (event) { if (thirdClass) { claimStatusFieldRemoveREquired(fields, false, thirdClass); - let $label = $(thirdClass).find("label"); - if ($label.length && !$label.find(".text-danger").length) { - $label.append(' *'); - } + $(thirdClass).each(function() { + let $label = $(this).find("label"); + $label.each(function() { + if (!$(this).find(".text-danger").length) { + $(this).append(' *'); + } + }); + }); } else { claimStatusFieldRemoveREquired($field, false, ''); } diff --git a/app/Views/ticket_history.php b/app/Views/ticket_history.php index 05534579..7ee087e1 100644 --- a/app/Views/ticket_history.php +++ b/app/Views/ticket_history.php @@ -5,7 +5,7 @@ - + diff --git a/app/Views/ticket_list.php b/app/Views/ticket_list.php index 65885cd1..a51706fd 100644 --- a/app/Views/ticket_list.php +++ b/app/Views/ticket_list.php @@ -74,11 +74,11 @@ table.dataTable tbody td { title=" From 93fc0a23075e00678802abc1a9b519f61e13a304 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Tue, 25 Feb 2025 17:02:20 +0530 Subject: [PATCH 3/9] FEAT_CLAIM_STATUS_FOR_MAIL_TEMPLATE --- app/Controllers/TicketController.php | 26 + app/Views/ticket_mail_template.php | 909 ++++++++++++++------------- 2 files changed, 492 insertions(+), 443 deletions(-) diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 60394874..36007889 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -593,6 +593,17 @@ class TicketController extends BaseController $data['policy_type'] = $this->ticketType; $data['placeHolders'] = $this->placeHolders; $data['ticket_data'] = $this->ticketMailTemplateModel->where('is_active', 1)->findAll(); + + foreach ($data['ticket_data'] as $key => $ticket_data) { + + $tooltip_array = $this->claimStatus->select('claim_status')->where('ticket_type',$data['ticket_data'][$key]['ticket_type'])->where('trigger_type',$data['ticket_data'][$key]['trigger_type'])->where('is_active',1)->first(); + if (isset($tooltip_array) && $tooltip_array != null){ + $data['ticket_data'][$key]['tool_tip'] = $tooltip_array['claim_status']; + }else{ + $data['ticket_data'][$key]['tool_tip'] =$data['ticket_data'][$key]['template_name']; + } + } + // dd($data['ticket_data']); $data['ticket_type'] = $this->ticketType; $data['trigger_type'] = $this->triggerType; return $this->loadLayout('ticket_mail_template', $data); @@ -621,6 +632,21 @@ class TicketController extends BaseController } elseif ($action == 2) { $table_id = (int)$this->request->getPost('id'); $data = $this->ticketMailTemplateModel->where('id', $table_id)->where('is_active', 1)->first(); + if ($data && isset($data['ticket_type']) && isset($data['trigger_type'])) { + $tooltip_array = $this->claimStatus->select('claim_status') + ->where('ticket_type', $data['ticket_type']) + ->where('trigger_type', $data['trigger_type']) + ->where('is_active', 1) + ->first(); + + $data['tool_tip'] = (isset($tooltip_array['claim_status'])) + ? $tooltip_array['claim_status'] + : $data['template_name']; + } else { + // Handle case where $data is null or missing required fields + $data = $data ?: []; // Ensure $data is an array if null + $data['tool_tip'] = $data['template_name']; + } if ($data) { return $this->respond(['status' => true, 'data' => $data], 200); } else { diff --git a/app/Views/ticket_mail_template.php b/app/Views/ticket_mail_template.php index 511cf300..213312b4 100644 --- a/app/Views/ticket_mail_template.php +++ b/app/Views/ticket_mail_template.php @@ -1,56 +1,56 @@
@@ -75,28 +75,37 @@ table.dataTable tbody td {
- $row){ ?> - - - - - - - - + $row) { ?> + + + + + + + + +
FieldLabel Change
- -
  + + + + +
@@ -135,11 +144,11 @@ table.dataTable tbody td {
@@ -149,11 +158,11 @@ table.dataTable tbody td { @@ -171,6 +180,12 @@ table.dataTable tbody td { +
+ + +
+ +
@@ -191,12 +206,15 @@ table.dataTable tbody td {
@@ -216,392 +234,397 @@ table.dataTable tbody td { - + \ No newline at end of file From abe568882c68d7ce3db869dae5a132f939715dd1 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 25 Feb 2025 18:15:17 +0530 Subject: [PATCH 4/9] CHANGE_CLAIM_MODULE : RV --- app/Controllers/ClientController.php | 16 +- app/Controllers/TicketController.php | 17 +- app/Models/EmployeeModel.php | 6 +- app/Views/ticket_form_gmc.php | 199 +++++++++++--------- app/Views/ticket_form_handler.php | 266 ++++++++++++++++----------- 5 files changed, 306 insertions(+), 198 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 023acd31..15533b25 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -4834,7 +4834,7 @@ class ClientController extends AdminController return $this->respond([ 'status' => false, 'code' => 404, - 'message' => 'No data found', + 'message' => 'No Employee found', 'param' => $param, 'type' => $type, 'dataForClientAndInsurer' => $dataForClientAndInsurer, @@ -4843,7 +4843,7 @@ class ClientController extends AdminController } } - public function getTheEmpDataForClaimSearchByMobile($param, $type = 'mobile', $client_policy_id = null) + public function getTheEmpDataForClaimSearchByMobile($param, $type = 'mobile', $client_policy_id = null, $client_id = null) { $field_name = 'employees.' . $type; @@ -4866,8 +4866,8 @@ class ClientController extends AdminController 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('insurers', 'client_policy.insurer_id = insurers.id', 'left') + ->join('clients', 'client_policy.client_id = clients.id') + ->join('insurers', 'client_policy.insurer_id = insurers.id') ->join('tpa', 'client_policy.tpa_id = tpa.id', 'left') ->join('employees', 'clients.id = employees.client_id') ->join('employee_polices', 'employees.id = employee_polices.employee_id') @@ -4879,6 +4879,10 @@ class ClientController extends AdminController ->where('employee_polices.is_active', 1) ->where($field_name, $param); + if (!empty($client_id)) { + $query->where('employees.client_id', $client_id); + } + if (!empty($client_policy_id)) { $query->where('employee_polices.client_policy_id', $client_policy_id); } @@ -4902,7 +4906,7 @@ class ClientController extends AdminController if(!empty($data) && count($data) > 0){ - $memberData = $this->employeeModel->getEmployeeByEmployeeCode($data['emp_code'], $data['policy_id']); + $memberData = $this->employeeModel->getEmployeeByEmployeeCode($data['emp_code'], $data['policy_id'], $client_id); $acms = $this->clientRMModel ->select('user_profiles.id, user_profiles.first_name') @@ -4935,7 +4939,7 @@ class ClientController extends AdminController return $this->respond([ 'status' => false, 'code' => 404, - 'message' => 'No data found', + 'message' => 'No Employee found', 'param' => $param, 'client_policy_id' => $client_policy_id, 'type' => $type, diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 3061f378..55672be7 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -34,6 +34,7 @@ class TicketController extends BaseController public $claimStatus; public $placeHolders; public $extraFields; + public $nonIDReason; protected $clientModel; protected $ticketMasterModel; @@ -138,6 +139,13 @@ class TicketController extends BaseController 53 => ['cancel_remark'], 58 => ['cancel_remark'], ]; + $this->nonIDReason = [ + "Newborn Baby" => "Newborn Baby", + "Newly Wedded Spouse" => "Newly Wedded Spouse", + "Policy Pending" => "Policy Pending", + "New Joinee" => "New Joinee", + "Exceptional Case" => "Exceptional Case" + ]; $this->ticketMasterModel = new TicketMasterModel(); $this->claimStatus = new TicketClaimStatusModel(); @@ -297,7 +305,8 @@ class TicketController extends BaseController 'ticket_type' => $this->ticketType, 'priorityType' => $this->priorityType, 'relationshipType' => $this->relationshipType, - 'modeOFIntimate' => $this->modeOFIntimate + 'modeOFIntimate' => $this->modeOFIntimate, + 'nonIDReason' => $this->nonIDReason ]; switch ($ticket_type) { @@ -529,6 +538,12 @@ class TicketController extends BaseController $ticket_data['settled_date'] = change_date_format($ticket_data['settled_date'], null, $out_put_format); } + if (empty($ticket_data['pay_initiate_date'])) { + $ticket_data['pay_initiate_date'] = null; + } else { + $ticket_data['pay_initiate_date'] = change_date_format($ticket_data['pay_initiate_date'], null, $out_put_format); + } + return $ticket_data; } diff --git a/app/Models/EmployeeModel.php b/app/Models/EmployeeModel.php index 58cf6010..14ec368d 100755 --- a/app/Models/EmployeeModel.php +++ b/app/Models/EmployeeModel.php @@ -240,7 +240,7 @@ class EmployeeModel extends Model return $results; } - public function getEmployeeByEmployeeCode($emp_code, $client_policy_id = null) + public function getEmployeeByEmployeeCode($emp_code, $client_policy_id = null, $client_id = null) { $query = $this->select(" employees.id AS emp_id, @@ -257,6 +257,10 @@ class EmployeeModel extends Model ->where('employee_polices.is_active', 1) ->where('employees.emp_code', $emp_code); + if(!empty($client_id)){ + $query->where('employees.client_id', $client_id); + } + if(!empty($client_policy_id)){ $query->where('employee_polices.client_policy_id', $client_policy_id); } diff --git a/app/Views/ticket_form_gmc.php b/app/Views/ticket_form_gmc.php index 23c8151c..b4fe84be 100644 --- a/app/Views/ticket_form_gmc.php +++ b/app/Views/ticket_form_gmc.php @@ -23,78 +23,13 @@
+ +
Employee Details
+
+ +
-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - - -
- -
- - - -
- -
- - - -
-
-
- - -
-
@@ -140,6 +68,20 @@
+
+ + +
+ +
+ + +
+
+
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + +
+ +
+ + +
Claim Details
+
+ + +
+ +
+ + +
+ +
+ + +
+
@@ -221,6 +235,15 @@ name="pod_no">
+
+ + +
Additional Details
+
+ + +
+ + - + +
@@ -348,7 +384,6 @@ // } // }); - \ No newline at end of file diff --git a/app/Views/ticket_form_gpa.php b/app/Views/ticket_form_gpa.php index 42b916cb..9a546bd4 100644 --- a/app/Views/ticket_form_gpa.php +++ b/app/Views/ticket_form_gpa.php @@ -399,9 +399,10 @@ console.log('fields', fields); console.log('$field id', $field); let $parentDiv = $field.closest("div"); console.log('$parentDiv', $parentDiv); - + // addRequiredFieldSymbol(targetId); if ($parentDiv.length) { let thirdClass = $parentDiv.attr("class").split(" ")[2] || ""; + addRequiredFieldSymbolByClass(thirdClass); console.log('thirdClass', thirdClass); if (thirdClass) { @@ -416,5 +417,61 @@ console.log('fields', fields); } } }); +// function addRequiredFieldSymbol(field_name) { +// // Find the field with the given name +// var $field = $(`[name="${field_name}"]`); + +// if ($field.length) { +// // Find the parent div of this field +// var $parentDiv = $field.closest('div'); + +// if ($parentDiv.length) { +// // Get the classes as an array +// var classes = $parentDiv.attr('class') ? $parentDiv.attr('class').split(/\s+/) : []; + +// if (classes.length > 0) { +// // Get the last class in the array +// var lastClass = classes[classes.length - 1]; + +// // Find all divs with this last class +// var $allDivsWithClass = $(`.${lastClass}`); + +// // Add asterisk to all labels within these divs +// $allDivsWithClass.each(function() { +// var $label = $(this).find('label'); +// if ($label.length && !$label.find('.text-danger').length) { +// $label.append(' *'); +// } +// }); + +// console.log(`Added required symbol to ${$allDivsWithClass.length} labels with class "${lastClass}"`); +// } else { +// console.warn(`Parent div for field "${field_name}" has no classes`); +// } +// } else { +// console.warn(`No parent div found for field name="${field_name}"`); +// } +// } else { +// console.warn(`No field found with name="${field_name}"`); +// } +// } +function addRequiredFieldSymbolByClass(className) { + // Find all divs with the specified class + var $divsWithClass = $(`.${className}`); + + if ($divsWithClass.length) { + // Add asterisk to all labels within these divs + $divsWithClass.each(function() { + var $label = $(this).find('label'); + if ($label.length && !$label.find('.text-danger').length) { + $label.append(' *'); + } + }); + + console.log(`Added required symbol to ${$divsWithClass.length} labels with class "${className}"`); + } else { + console.warn(`No divs found with class="${className}"`); + } +} \ No newline at end of file From 283de4d276ed6e1a4dd39b4da8a4ae37fdd83f3a Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 26 Feb 2025 11:14:01 +0530 Subject: [PATCH 7/9] FIX_CLAIM_ARRAY : RV --- app/Controllers/TicketController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index a1209efc..f98e0192 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -115,7 +115,8 @@ class TicketController extends BaseController '((AUTO_QUERY_CONTENT))' => 'auto_query_content', ]; $this->extraFields = [ - + 1 => ['non_id_reason'], + 10 => ['pay_initiate_date'], 3 => ['raised_date'], 4 => ['raised_date'], 5 => ['claim_number', 'registration_date'], From 042fcc068b5c690d80c82da3e476cc04435b4080 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 26 Feb 2025 11:58:43 +0530 Subject: [PATCH 8/9] CHANGE_TRIGGER_TYPE_8 : RV --- app/Controllers/TicketController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index f98e0192..6da26715 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -99,7 +99,8 @@ class TicketController extends BaseController 4 => "Trigger 4", 5 => "Trigger 5", 6 => "Trigger 6", - 7 => "Trigger 7" + 7 => "Trigger 7", + 8 => "Trigger 8", ]; $this->placeHolders = [ From 2c0f1dabd3036bdcc5fef7e25b70b2910fff7223 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 26 Feb 2025 12:32:21 +0530 Subject: [PATCH 9/9] CHANGE_CLAIM_MAIL_TRIGGER : RV --- app/Views/ticket_mail_template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Views/ticket_mail_template.php b/app/Views/ticket_mail_template.php index 213312b4..00413062 100644 --- a/app/Views/ticket_mail_template.php +++ b/app/Views/ticket_mail_template.php @@ -83,7 +83,7 @@ aria-hidden="true" data-toggle="tooltip" data-placement="top" - title=""> + title="">