From 1c03df4848b1579ee8dda54ee6e878309cf205c9 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 21 Feb 2026 09:47:44 +0530 Subject: [PATCH 1/3] FIX_BDS_REPORT QUERY --- app/Controllers/EmployeeController.php | 4 +-- app/Models/PolicyTransactionModel.php | 28 +++++++++++-------- .../policy_transaction_inception_form.php | 10 +++---- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index e4a04375..fae64f2d 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -336,9 +336,9 @@ class EmployeeController extends AdminController //endof validation process if (isset($result['error_summary']) && count($result['error_summary'])) { if(!empty($post_data)){ - return ['status' => false, 'message' => 'file rejected with errors', 'file_id' => $file_id]; + return ['status' => false, 'message' => 'File rejected with errors', 'file_id' => $file_id]; }else{ - return $this->respond(['dataStatus' => false, 'code' => 404, 'message' => 'file rejected with errors'], 200); + return $this->respond(['dataStatus' => false, 'code' => 404, 'message' => 'File rejected with errors'], 200); } } } else //if file size greater than 1 add the file as job diff --git a/app/Models/PolicyTransactionModel.php b/app/Models/PolicyTransactionModel.php index fe7872f7..8c6d875d 100644 --- a/app/Models/PolicyTransactionModel.php +++ b/app/Models/PolicyTransactionModel.php @@ -3,6 +3,7 @@ namespace App\Models; use CodeIgniter\Model; + use Kint; class PolicyTransactionModel extends Model { @@ -3168,9 +3169,10 @@ pt.installment, nhance_branch.branch_name as nhance_branch, - DATE_FORMAT(pt.policy_issue_date, '%d %b %Y') AS policy_issue_date, + DATE_FORMAT(pcsd.pt_policy_issue_date, '%d %b %Y') AS policy_issue_date, DATE_FORMAT(pcsd.pt_policy_issue_date, '%b %Y') AS policy_issue_month, - pt.month as statement_month, + DATE_FORMAT(pcsd.pt_policy_issue_date, '%b %Y') AS statement_year_month, + pcsd.pt_policy_issue_date as statement_month, 'no statement uploaded' AS statement_uploaded, @@ -3331,8 +3333,9 @@ pt.installment, nhance_branch.branch_name as nhance_branch, - DATE_FORMAT(pt.policy_issue_date, '%d %b %Y') AS policy_issue_date, + DATE_FORMAT(pcsd.pt_policy_issue_date, '%d %b %Y') AS policy_issue_date, DATE_FORMAT(IF(insq.month IS NULL, pcsd.pt_policy_issue_date, insq.month),'%b %Y') AS policy_issue_month, + DATE_FORMAT(insq.month, '%b %Y') AS statement_year_month, insq.month as statement_month, 'statement uploaded' AS statement_uploaded, @@ -3392,7 +3395,7 @@ (pcsd.agreed_tp_per + pcsd.agreed_tep_per) AS agreed_tp_or_ter_per, CASE - WHEN insq.month = pt.month THEN pcsd.exp_amt + WHEN DATE_FORMAT(insq.month, '%Y-%m') = DATE_FORMAT(pcsd.pt_policy_issue_date, '%Y-%m') THEN pcsd.exp_amt ELSE 0 END AS total_irda_amt_2, @@ -3521,8 +3524,9 @@ pt.installment, nhance_branch.branch_name as nhance_branch, - DATE_FORMAT(pt.policy_issue_date, '%d %b %Y') AS policy_issue_date, + DATE_FORMAT(pcsd.pt_policy_issue_date, '%d %b %Y') AS policy_issue_date, DATE_FORMAT(IF(insq.month IS NULL, pcsd.pt_policy_issue_date, insq.month),'%b %Y') AS policy_issue_month, + DATE_FORMAT(insq.month, '%b %Y') AS statement_year_month, insq.month as statement_month, 'statement uploaded' AS statement_uploaded, @@ -3704,7 +3708,7 @@ // $countofalldata = count($result); - // dd($result); + // Kint::dump($result); // dd($this->db->getLastQuery()->getQuery()); $keys = []; @@ -3732,7 +3736,7 @@ // ✅ Stable key (NO reward flag) $key = implode('|', [ - $row['statement_month'], + $row['statement_year_month'], $row['insurer_name'], $row['policy_no'], $endorsement_number, @@ -3753,7 +3757,7 @@ // Reindex final output $result = array_values($filtered); - // dd($countofalldata, $result); + // dd($result); // -------------------------------------------------------------------------------------------------------- @@ -3776,7 +3780,7 @@ } } - // dd($totalIrdaMap); + // dd($totalBilled, $totalIrdaMap); $ptSeen = []; $final = []; @@ -3785,8 +3789,10 @@ $ptId = $row['pt_id'].'-'.$row['insurer_id']; if (!isset($ptSeen[$ptId])) { // First entry → set unbilled amount - $row['unbilled_amount'] = (float) (($totalIrdaMap[$ptId] ?? 0) - ($totalBilled[$ptId] ?? 0)) ?? '0.00'; - + $row['unbilled_amount'] = round( + (float) (($totalIrdaMap[$ptId] ?? 0) - ($totalBilled[$ptId] ?? 0)), + 2 + ); $ptSeen[$ptId] = true; } else { // Other entries → zero diff --git a/app/Views/policy_transaction_inception_form.php b/app/Views/policy_transaction_inception_form.php index 5f6ae488..84613a8d 100644 --- a/app/Views/policy_transaction_inception_form.php +++ b/app/Views/policy_transaction_inception_form.php @@ -2713,13 +2713,10 @@ if(allocg != 'EB'){ tp = parseFloat($('#tp_premium_' + input).val()) || 0; } - // do not remove this commented item - // if(bap == 'Motor'){ - // tp = parseFloat($('#tp_premium_' + input).val()) || 0; - // } var tep = 0; - if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){ + // if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){ + if(allocg != 'EB'){ tep = parseFloat($('#ter_premium_' + input).val()) || 0; } @@ -2732,7 +2729,8 @@ } var cotep = 0; - if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){ + // if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){ + if(allocg != 'EB'){ cotep = parseFloat($('#co_ter_premium_' + input).val()) || 0; } From d05c3b2be60315ce1314ac4c182e35048dc7d206 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 21 Feb 2026 10:06:33 +0530 Subject: [PATCH 2/3] FIX_CHNAGE_CLIENT_HEADING --- app/Views/client_basic_info.php | 2 ++ app/Views/client_onboarding.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Views/client_basic_info.php b/app/Views/client_basic_info.php index 055a0e33..a8de6ec7 100755 --- a/app/Views/client_basic_info.php +++ b/app/Views/client_basic_info.php @@ -287,6 +287,8 @@ input:checked + .slider:before { var message = (PrimaryKey === '') ? 'Client General Info Created successfully' : 'Client General Info Updated successfully'; toastr.success(message, 'Success'); $submitButton.prop('disabled', false); + let client_name = res.data.client_name ? (' - ' + res.data.client_name) : ''; + $('#client_heading').text(client_name); }, 1000); } diff --git a/app/Views/client_onboarding.php b/app/Views/client_onboarding.php index d8d5eb68..c63e00a6 100755 --- a/app/Views/client_onboarding.php +++ b/app/Views/client_onboarding.php @@ -273,9 +273,9 @@
-

Client Onboarding Client Onboarding

+ } ?>
"> From 05b12413aa7d5a9a3c9addb9e58728fbbd8de804 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 21 Feb 2026 10:44:12 +0530 Subject: [PATCH 3/3] FIX_CD_TRANSACTION_ADD_ISSUE --- app/Controllers/ClientController.php | 14 +++----------- app/Views/view_deposit.php | 27 ++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 19219b81..bbd52f5f 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -783,19 +783,11 @@ class ClientController extends AdminController ] ], - // 'cd_ac_no' => [ - // 'rules' => 'required|regex_match[/^[a-zA-Z0-9\/_\\-]+$/]', - // 'errors' => [ - // 'required' => 'Account number is required', - // 'regex_match' => 'Account number can only contain letters, numbers, slashes (/), underscores (_), and hyphens (-)', - // ] - // ], - 'cd_ac_no' => [ - 'rules' => 'required|numeric', + 'rules' => 'required|regex_match[/^[a-zA-Z0-9\/\-_]+$/]', 'errors' => [ - 'required' => 'CD Account number is required.', - 'numeric' => 'CD Account number must contain only numbers.', + 'required' => 'CD Account number is required.', + 'regex_match' => 'CD Account number can only contain letters, numbers, hyphens(-), underscores(_), and slashes(/).', ] ], diff --git a/app/Views/view_deposit.php b/app/Views/view_deposit.php index c0b9272e..3a290002 100755 --- a/app/Views/view_deposit.php +++ b/app/Views/view_deposit.php @@ -461,9 +461,34 @@ location.reload(); }, error: function(xhr, status, error) { - toastr.error("Transaction save failed", "Error"); + console.error(xhr.responseText); console.error(status, error); + + if (xhr.status === 400) { + let response = JSON.parse(xhr.responseText); + let errorMessages = ""; + let seenMessages = []; // Array to store unique messages + if (response.errors) { + $.each(response.errors, function (field, message) { + if (!seenMessages.includes(message)) { + errorMessages += `• ${message}
`; + seenMessages.push(message); // Mark this message as "seen" + } + }); + toastr.error(errorMessages, 'Validation Error', { "allowHtml": true }); + } else { + toastr.warning(response.message || 'Validation failed', 'Warning'); + } + } else if (xhr.status === 403) { + let response = JSON.parse(xhr.responseText); + toastr.error(response.message, 'Security Policy'); + } else if (xhr.status === 500) { + toastr.error('Something went wrong . Please try again later.', 'Server Error'); + } else { + toastr.error('An unexpected error occurred. Please try again later.', 'Error'); + } + location.reload(); // Uncomment if you need to reload the page on error } });