From 49ca11bdfb578c6f4fab8cda48601590c6e8b979 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 25 Feb 2026 17:37:48 +0530 Subject: [PATCH] FIX_ISSUE --- app/Helpers/utility_helper.php | 20 +++++++++++++++++++ .../policy_transaction_endorsement_form.php | 12 +++++------ .../policy_transaction_endorsement_list.php | 13 ++++++++++-- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/app/Helpers/utility_helper.php b/app/Helpers/utility_helper.php index ce6e6e4a..efc2842e 100755 --- a/app/Helpers/utility_helper.php +++ b/app/Helpers/utility_helper.php @@ -1316,4 +1316,24 @@ if (!function_exists('map_relationship')) { } + if(!function_exists('add_google_calender_event')){ + function add_google_calender_event($data){ + + $calendar = new \App\Libraries\GoogleCalendarService(); + + // Check if user is authenticated without passing tokens manually + if (!$calendar->isReady()) { + return ['status' => 'failed', 'code' => '404' , 'message' => 'Google Access Token Expired']; + } + + try { + $response = $calendar->createEvent($data); + return ['status' => 'success', 'code' => '200' , 'message' => 'Follow-up Saved', 'response' => $response]; + } catch (\Exception $e) { + return ['status' => 'failed', 'code' => '500' , 'message' => 'Error: ' . $e->getMessage()]; + } + } + } + + diff --git a/app/Views/policy_transaction_endorsement_form.php b/app/Views/policy_transaction_endorsement_form.php index 4b4ab0ba..0c9c579b 100644 --- a/app/Views/policy_transaction_endorsement_form.php +++ b/app/Views/policy_transaction_endorsement_form.php @@ -621,7 +621,7 @@ console.log('Business Team Logged in.'); } - getURLParamsForReport() + // getURLParamsForReport() }) $(document).ready(function(){ @@ -1086,10 +1086,10 @@ if(res.data.client_type == 2){ let data1 = policyListByClient[res.data.client_id]; - appendPolicies(data1, res.pt_id); + appendPolicies(data1, res.data.client_policy_id); }else{ let data2 = policy_list[res.data.client_branch_id]; - appendPolicies(data2, res.pt_id); + appendPolicies(data2, res.data.client_policy_id); } setTimeout(function(){ @@ -2957,9 +2957,9 @@ if (pt_id != 0) { hide_list_show_add(); - setTimeout(() => - getPolicyTransactionDataForEndorsementEdit(pt_id), - 1500); // Reduced timeout + // setTimeout(() => + getPolicyTransactionDataForEndorsementEdit(pt_id) + // 1500); // Reduced timeout } else { show_list_hide_add(); } diff --git a/app/Views/policy_transaction_endorsement_list.php b/app/Views/policy_transaction_endorsement_list.php index 0365496b..eed97902 100644 --- a/app/Views/policy_transaction_endorsement_list.php +++ b/app/Views/policy_transaction_endorsement_list.php @@ -460,7 +460,11 @@ table.dataTable thead th { // select2 document ready $(document).ready(function() { - getClientAndBranchAndPolicy() + // getClientAndBranchAndPolicy() + getClientAndBranchAndPolicy(function() { + getURLParamsForReport(); + }); + addHTMLInput(); has('create_failed')) : ?> @@ -632,7 +636,7 @@ table.dataTable thead th { } - function getClientAndBranchAndPolicy() { + function getClientAndBranchAndPolicy(callback) { $.ajax({ url: '', type: "GET", @@ -652,6 +656,11 @@ table.dataTable thead th { console.log('No data found'); } + // ✅ Data ellam set aanadhuku aparam callback call panrom + if (typeof callback === "function") { + callback(); + } + }, error: function(xhr, status, error) { console.error(xhr.responseText);