From 95e109199c3dc78fbc60554e01ac92e3bae6cd53 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Thu, 12 Mar 2026 17:37:35 +0530 Subject: [PATCH 1/4] FIX_EXPENSE_RELATED_ISSUE --- app/Controllers/ExpenseController.php | 7 +- app/Views/expense_list.php | 126 ++++++++++++++++++++++++-- 2 files changed, 122 insertions(+), 11 deletions(-) diff --git a/app/Controllers/ExpenseController.php b/app/Controllers/ExpenseController.php index c734284d..525c16d0 100644 --- a/app/Controllers/ExpenseController.php +++ b/app/Controllers/ExpenseController.php @@ -34,8 +34,7 @@ class ExpenseController extends AdminController try { $data['tab_name'] = 'Expense'; $data['page_name'] = 'Expense'; - $descriptionPattern = '/^[a-zA-Z0-9\s\.\,\-\(\)\/\&\+]+$/u'; - + $descriptionPattern = '/^[a-zA-Z0-9\s\.\,\-\(\)\/\&\+\'"]+$/u'; // Raw GET filters $rawFilters = $this->request->getGet() ?? []; $rawFilters = is_array($rawFilters) ? $rawFilters : []; @@ -97,6 +96,7 @@ class ExpenseController extends AdminController // Clients for dropdown $data['clients'] = $this->clientModel ->select('id, client_name, short_name') + ->where('client_type', 1) ->where('is_active', 1) ->orderBy('client_name', 'ASC') ->findAll(); @@ -228,11 +228,12 @@ class ExpenseController extends AdminController ], ], 'amount' => [ - 'rules' => 'required|numeric|greater_than_equal_to[0]', + 'rules' => 'required|numeric|greater_than_equal_to[0]|less_than_equal_to[100000000]', 'errors' => [ 'required' => 'Amount is required', 'numeric' => 'Amount must be numeric', 'greater_than_equal_to' => 'Amount cannot be negative', + 'less_than_equal_to' => 'Amount cannot be greater than 100 Cr.', ], ], ]; diff --git a/app/Views/expense_list.php b/app/Views/expense_list.php index 2dedb059..8d2e2751 100644 --- a/app/Views/expense_list.php +++ b/app/Views/expense_list.php @@ -1,3 +1,35 @@ + +
@@ -80,7 +112,18 @@
- +
@@ -126,7 +169,16 @@ - + + + + + + @@ -213,8 +265,13 @@ if (!amount) { errors.push('Amount is required.'); - } else if (isNaN(amount) || Number(amount) < 0) { - errors.push('Amount must be a non-negative number.'); + } else { + const amountNum = Number(amount); + if (isNaN(amountNum) || amountNum < 0) { + errors.push('Amount must be a non-negative number.'); + } else if (amountNum > 100000000) { + errors.push('Amount cannot be greater than 100 Cr.'); + } } if (!expenseDate) { @@ -261,8 +318,11 @@ } if (amount) { - if (isNaN(amount) || Number(amount) < 0) { + const amountNum = Number(amount); + if (isNaN(amountNum) || amountNum < 0) { errors.push('Amount filter must be a non-negative number.'); + } else if (amountNum > 100000000) { + errors.push('Amount filter cannot be greater than 100 Cr.'); } } @@ -430,10 +490,12 @@ window.expenseDatePicker = flatpickr('#expense_date', { dateFormat: 'd-m-Y', - allowInput: true + allowInput: false, + maxDate: new Date(), }); $('#expense-table').DataTable({ + scrollX: true, dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" + "<'row'<'col-sm-12'tr>>" + "<'row align-items-center'<'col-5 text-start'i><'col-7 d-flex justify-content-end align-items-center'<'me-2'l>p>>", @@ -450,7 +512,18 @@ title: 'Expense List', className: 'app-btn-primary ', exportOptions: { - columns: ':not(:last-child)' + columns: ':not(:last-child)', + format: { + body: function (data, row, column, node) { + // Column index 2 is "Policy No" (S.No=0, Client=1, Policy No=2) + if (column === 2) { + // Prefix with apostrophe to force Excel treat as text and preserve long numbers + var text = $(node).text ? $(node).text() : data; + return "'" + text; + } + return data; + } + } } }, { @@ -461,7 +534,16 @@ className: 'app-btn-primary ', exportOptions: { orthogonal: 'sort', - columns: ':not(:last-child)' + columns: ':not(:last-child)', + format: { + body: function (data, row, column, node) { + if (column === 2) { + var text = $(node).text ? $(node).text() : data; + return "'" + text; + } + return data; + } + } } }, { @@ -581,6 +663,34 @@ $('#btnResetExpense, #btnCancelExpense').on('click', function () { resetExpenseForm(); }); + + // Show small popup near the info icon on hover (no tooltip) + let $popup = $('#expense-desc-popup'); + if (!$popup.length) { + $popup = $('
').appendTo('body'); + } + + $(document).on('mouseenter', '.expense-desc-icon', function () { + const desc = $(this).data('description') || ''; + if (!desc) { + return; + } + + $popup.text(desc); + + const offset = $(this).offset(); + const iconHeight = $(this).outerHeight() || 16; + + $popup.css({ + top: offset.top + iconHeight + 4, + left: offset.left, + display: 'block' + }); + }); + + $(document).on('mouseleave', '.expense-desc-icon', function () { + $popup.hide(); + }); }); From ef5982b4d1867bf0516a92f8806aac1af2b1ab9f Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Thu, 12 Mar 2026 18:03:43 +0530 Subject: [PATCH 2/4] FIX_VALIDATION_RULES --- app/Controllers/TicketController.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 986579e6..ce11e595 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -1178,9 +1178,9 @@ class TicketController extends BaseController ], 'tpa_no' => [ 'label' => 'TPA ID', - 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9\/]+$/]', + 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9\/\-_]+$/]', 'errors' => [ - 'regex_match' => 'TPA ID can only contain letters, numbers, and /.' + 'regex_match' => 'TPA ID can only contain letters, numbers, /, -, and _.' ] ], 'emp_mobile' => ['label' => 'Employee Mobile No','rules' => 'required|numeric|exact_length[10]', @@ -1233,9 +1233,9 @@ class TicketController extends BaseController ], 'hospital_address' => [ 'label' => 'Hospital Address', - 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9\s\-_.,#\/]+$/]', + 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9\s.,#\/_-]+$/]', 'errors' => [ - 'regex_match' => 'The {field} contains invalid characters (Allowed: letters, numbers, spaces, dashes, commas, dots, # and /).' + 'regex_match' => 'The {field} contains invalid characters (Allowed: letters, numbers, spaces, -, _, ., ,, # and /).' ], ], 'hospital_state' => [ @@ -1531,9 +1531,9 @@ class TicketController extends BaseController ], 'tpa_no' => [ 'label' => 'TPA ID', - 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9\/]+$/]', + 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9\/\-_]+$/]', 'errors' => [ - 'regex_match' => 'TPA ID can only contain letters, numbers, and /.' + 'regex_match' => 'TPA ID can only contain letters, numbers, /, -, and _.' ] ], 'emp_mobile' => ['label' => 'Employee Mobile No','rules' => 'required|numeric|exact_length[10]', @@ -1586,9 +1586,9 @@ class TicketController extends BaseController ], 'hospital_address' => [ 'label' => 'Hospital Address', - 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9\s\-_.,#\/]+$/]', + 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9\s.,#\/_-]+$/]', 'errors' => [ - 'regex_match' => 'The {field} contains invalid characters (Allowed: letters, numbers, spaces, dashes, commas, dots, # and /).' + 'regex_match' => 'The {field} contains invalid characters (Allowed: letters, numbers, spaces, -, _, ., ,, # and /).' ], ], 'hospital_state' => [ From d253ce0beda3e66ad112576d5f43997df827bc96 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Fri, 13 Mar 2026 11:00:12 +0530 Subject: [PATCH 3/4] CHANGE_CLAIMP_DUP_LIST_ADD_CLIT_NAME_AND_POLICY_NUMBER --- app/Controllers/TicketController.php | 6 +++++- app/Views/claim_dump_file_list.php | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index ce11e595..a0df4c9d 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -3549,9 +3549,13 @@ class TicketController extends BaseController claim_dump_files.file_name, claim_dump_files.status, claim_dump_files.created_at, - up.first_name as user_name + up.first_name as user_name, + c.client_name, + cp.policy_no ') ->join('user_profiles as up', 'claim_dump_files.created_by = up.id', 'left') + ->join('client_policy as cp', 'claim_dump_files.client_policy_id = cp.id', 'left') + ->join('clients as c', 'cp.client_id = c.id', 'left') ->where('claim_dump_files.is_active', 1) ->orderBy('claim_dump_files.id', 'desc') ->findAll(); diff --git a/app/Views/claim_dump_file_list.php b/app/Views/claim_dump_file_list.php index 9ba0451b..f9b14f6d 100644 --- a/app/Views/claim_dump_file_list.php +++ b/app/Views/claim_dump_file_list.php @@ -135,6 +135,8 @@ S.No  + Client + Policy File name User/Time Status @@ -150,6 +152,8 @@ + + @@ -740,13 +744,18 @@ })); $.each(data, function(index, item) { - var option = $('