From a3d7007f10324de55782ceafa8563d5a4728e599 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Wed, 8 Jan 2025 10:55:17 +0530 Subject: [PATCH 1/6] FIX_ROW_ON_CLICK_TABLE_ALIGNMENT --- app/Views/insurer_list.php | 53 +++--------------- app/Views/insurer_statement_list.php | 55 ++----------------- app/Views/kyc_list.php | 53 +++--------------- app/Views/leads_list.php | 53 +++--------------- .../policy_transaction_inception_list.php | 53 ++---------------- app/Views/tpa_list.php | 54 +++--------------- 6 files changed, 40 insertions(+), 281 deletions(-) diff --git a/app/Views/insurer_list.php b/app/Views/insurer_list.php index 933ed3b4..150f9be2 100755 --- a/app/Views/insurer_list.php +++ b/app/Views/insurer_list.php @@ -1,70 +1,31 @@
diff --git a/app/Views/insurer_statement_list.php b/app/Views/insurer_statement_list.php index 2772907a..83dee914 100644 --- a/app/Views/insurer_statement_list.php +++ b/app/Views/insurer_statement_list.php @@ -108,75 +108,32 @@ table.dataTable tbody td { color: gray; } -custom-dropdown-menu { + .custom-dropdown-menu { display: none; - position: fixed; + position: absolute; background-color: #ffffff !important; - border: 1px solid rgba(0,0,0,.15); + border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 0.25rem; padding: 0.5rem 0; min-width: 10rem; z-index: 9999; - box-shadow: 0 0 10px rgba(0,0,0,0.1); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .custom-dropdown-menu .dropdown-item { display: block !important; width: 100% !important; padding: 0.5rem 1rem !important; - clear: both !important; - font-weight: 400 !important; color: #212529 !important; - text-align: inherit !important; - white-space: nowrap !important; - background-color: transparent !important; - border: 0 !important; text-decoration: none !important; - position: relative !important; + background-color: transparent !important; } .custom-dropdown-menu .dropdown-item:hover { background-color: #f8f9fa !important; color: #16181b !important; cursor: pointer !important; -} - -.custom-dropdown-menu .dropdown-item i { - margin-right: 8px !important; - vertical-align: middle !important; -} - -.table tbody tr { - cursor: pointer; -} - -/* Ensure the dropdown menu has a solid background */ -.custom-dropdown-menu::before { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: #ffffff; - z-index: -1; -} - -/* Add a subtle backdrop effect */ -.custom-dropdown-menu::after { - content: ''; - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: rgba(0,0,0,0.05); - z-index: -2; - pointer-events: none; -} - - - +}
diff --git a/app/Views/kyc_list.php b/app/Views/kyc_list.php index a28b2dfe..e6c0870f 100755 --- a/app/Views/kyc_list.php +++ b/app/Views/kyc_list.php @@ -1,70 +1,31 @@
diff --git a/app/Views/leads_list.php b/app/Views/leads_list.php index 78665e91..ddf4d238 100644 --- a/app/Views/leads_list.php +++ b/app/Views/leads_list.php @@ -37,72 +37,33 @@ table.dataTable tbody td { margin-bottom: 10px; } -custom-dropdown-menu { + +.custom-dropdown-menu { display: none; - position: fixed; + position: absolute; background-color: #ffffff !important; - border: 1px solid rgba(0,0,0,.15); + border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 0.25rem; padding: 0.5rem 0; min-width: 10rem; z-index: 9999; - box-shadow: 0 0 10px rgba(0,0,0,0.1); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .custom-dropdown-menu .dropdown-item { display: block !important; width: 100% !important; padding: 0.5rem 1rem !important; - clear: both !important; - font-weight: 400 !important; color: #212529 !important; - text-align: inherit !important; - white-space: nowrap !important; - background-color: transparent !important; - border: 0 !important; text-decoration: none !important; - position: relative !important; + background-color: transparent !important; } .custom-dropdown-menu .dropdown-item:hover { background-color: #f8f9fa !important; color: #16181b !important; cursor: pointer !important; -} - -.custom-dropdown-menu .dropdown-item i { - margin-right: 8px !important; - vertical-align: middle !important; -} - -.table tbody tr { - cursor: pointer; -} - -/* Ensure the dropdown menu has a solid background */ -.custom-dropdown-menu::before { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: #ffffff; - z-index: -1; -} - -/* Add a subtle backdrop effect */ -.custom-dropdown-menu::after { - content: ''; - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: rgba(0,0,0,0.05); - z-index: -2; - pointer-events: none; -} +} diff --git a/app/Views/policy_transaction_inception_list.php b/app/Views/policy_transaction_inception_list.php index 80f9fe62..0db12415 100644 --- a/app/Views/policy_transaction_inception_list.php +++ b/app/Views/policy_transaction_inception_list.php @@ -45,73 +45,32 @@ table.dataTable tbody td { .addbtnStyle{ margin-left: 20px !important; } -custom-dropdown-menu { +.custom-dropdown-menu { display: none; - position: fixed; + position: absolute; background-color: #ffffff !important; - border: 1px solid rgba(0,0,0,.15); + border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 0.25rem; padding: 0.5rem 0; min-width: 10rem; z-index: 9999; - box-shadow: 0 0 10px rgba(0,0,0,0.1); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .custom-dropdown-menu .dropdown-item { display: block !important; width: 100% !important; padding: 0.5rem 1rem !important; - clear: both !important; - font-weight: 400 !important; color: #212529 !important; - text-align: inherit !important; - white-space: nowrap !important; - background-color: transparent !important; - border: 0 !important; text-decoration: none !important; - position: relative !important; + background-color: transparent !important; } .custom-dropdown-menu .dropdown-item:hover { background-color: #f8f9fa !important; color: #16181b !important; cursor: pointer !important; -} - -.custom-dropdown-menu .dropdown-item i { - margin-right: 8px !important; - vertical-align: middle !important; -} - -.table tbody tr { - cursor: pointer; -} - -/* Ensure the dropdown menu has a solid background */ -.custom-dropdown-menu::before { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: #ffffff; - z-index: -1; -} - -/* Add a subtle backdrop effect */ -.custom-dropdown-menu::after { - content: ''; - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: rgba(0,0,0,0.05); - z-index: -2; - pointer-events: none; -} - +} +}
From a2ccebf83e70e767acd25b940b5a1b19305569ea Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Fri, 17 Jan 2025 18:15:46 +0530 Subject: [PATCH 2/6] FIX_ZEPTO_MAIL_BCC_CC_NOT_SEND_ISSUE_SRINIVAS --- app/Helpers/MailHelper.php | 224 +++++++++++++++++++++---------------- 1 file changed, 127 insertions(+), 97 deletions(-) diff --git a/app/Helpers/MailHelper.php b/app/Helpers/MailHelper.php index 91e955b0..ecee92da 100755 --- a/app/Helpers/MailHelper.php +++ b/app/Helpers/MailHelper.php @@ -194,6 +194,11 @@ class MailHelper } else { $bcc = ''; } + if(isset($params['cc'])){ + $cc = $params['cc']; + }else{ + $cc = ''; + } $from_address = getenv('email.fromEmail'); @@ -255,7 +260,7 @@ class MailHelper } $apiResponse = json_decode($response, true); - + log_message('error',$apiResponse); if ($httpCode === 200) { return json_encode(['status' => 'success', 'code' => 200, 'message' => 'Email Sent Successfully...', 'data' => $emaill], 200); } else { @@ -289,116 +294,141 @@ class MailHelper } public static function send_email($params) - { - $myLogger = \Config\Services::mylogger(); +{ + $myLogger = \Config\Services::mylogger(); + + $emaill = $params['mail']; + $subject = $params['subject']; + $message = $params['message']; + $attachments = isset($params['attachments']) ? $params['attachments'] : []; + $common = isset($params['common']) ? $params['common'] : ''; + $bcc = isset($params['bcc']) ? $params['bcc'] : ''; + $cc = isset($params['cc']) ? $params['cc'] : ''; + + $from_address = getenv('email.fromEmail'); + try { + $curl = curl_init(); - $emaill = $params['mail']; - $subject = $params['subject']; - $message = $params['message']; - $attachments = isset($params['attachments']) ? $params['attachments'] : []; - $common = isset($params['common']) ? $params['common'] : ''; - - $from_address = getenv('email.fromEmail'); - try { - $curl = curl_init(); - - $postData = [ - 'from' => [ - 'address' => $from_address - ], - 'to' => [ - [ - 'email_address' => [ - 'address' => $emaill - ] + $postData = [ + 'from' => [ + 'address' => $from_address + ], + 'to' => [ + [ + 'email_address' => [ + 'address' => $emaill ] - ], - 'subject' => $subject, - 'htmlbody' => $message - ]; + ] + ], + 'subject' => $subject, + 'htmlbody' => $message + ]; - // Handle attachments - if (!empty($attachments)) { - $postData['attachments'] = []; - foreach ($attachments as $attachment) { - if (isset($attachment['filePath']) && file_exists($attachment['filePath'])) { - // Determine MIME type dynamically - $fileMimeType = mime_content_type($attachment['filePath']); - - $postData['attachments'][] = [ - 'content' => base64_encode(file_get_contents($attachment['filePath'])), - 'name' => $attachment['fileName'], - 'mime_type' => $fileMimeType, // Add mime_type field - ]; - } + // Add CC recipients if provided + if (!empty($cc)) { + $postData['cc'] = []; + // Handle both string and array inputs for CC + $ccEmails = is_array($cc) ? $cc : [$cc]; + foreach ($ccEmails as $ccEmail) { + $postData['cc'][] = [ + 'email_address' => [ + 'address' => $ccEmail + ] + ]; + } + } + + // Add BCC recipients if provided + if (!empty($bcc)) { + $postData['bcc'] = []; + // Handle both string and array inputs for BCC + $bccEmails = is_array($bcc) ? $bcc : [$bcc]; + foreach ($bccEmails as $bccEmail) { + $postData['bcc'][] = [ + 'email_address' => [ + 'address' => $bccEmail + ] + ]; + } + } + + // Handle attachments + if (!empty($attachments)) { + $postData['attachments'] = []; + foreach ($attachments as $attachment) { + if (isset($attachment['filePath']) && file_exists($attachment['filePath'])) { + // Determine MIME type dynamically + $fileMimeType = mime_content_type($attachment['filePath']); + + $postData['attachments'][] = [ + 'content' => base64_encode(file_get_contents($attachment['filePath'])), + 'name' => $attachment['fileName'], + 'mime_type' => $fileMimeType, + ]; } } - + } - curl_setopt_array($curl, [ - CURLOPT_URL => "https://api.zeptomail.in/v1.1/email", - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => "", - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 30, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => "POST", - CURLOPT_POSTFIELDS => json_encode($postData), - CURLOPT_HTTPHEADER => [ - "accept: application/json", - "authorization: Zoho-enczapikey " . getenv('ZEPTO_API_KEY'), - "cache-control: no-cache", - "content-type: application/json", - ], - ]); + curl_setopt_array($curl, [ + CURLOPT_URL => "https://api.zeptomail.in/v1.1/email", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "POST", + CURLOPT_POSTFIELDS => json_encode($postData), + CURLOPT_HTTPHEADER => [ + "accept: application/json", + "authorization: Zoho-enczapikey " . getenv('ZEPTO_API_KEY'), + "cache-control: no-cache", + "content-type: application/json", + ], + ]); - $mail_result = curl_exec($curl); - $err = curl_error($curl); - curl_close($curl); - // log_message('error','inside mail helper'); - // log_message('error', $response.' error->'.$err);die(); - $res['params'] = $params; - $MailDataHelper = new GmailResponseHandler(); - $apiResponse = json_decode($mail_result, true); - $res['zepto_api'] = $apiResponse; - if (isset($apiResponse['error'])) { - $response = $res; - $MailDataHelper->receive_and_distribute_param_to_functions($response); - return json_encode([ - 'status' => 'failed', - 'code' => 404, - 'message' => 'Email Sent Failed...' . $emaill, - 'data' => $res - ], 404); - } + $mail_result = curl_exec($curl); + $err = curl_error($curl); + curl_close($curl); - // $apiResponse = json_decode($response, true); - - // Check if request_id exists in response (indicates success) - if (isset($apiResponse['data'])) { - $response = $res; - $MailDataHelper->receive_and_distribute_param_to_functions($response); - return json_encode([ - 'status' => 'success', - 'code' => 200, - 'message' => 'Email Sent Successfully...' . $emaill, - 'data' => $res - ], 200); - } - - } catch (\Exception $e) { - $msg['error'] = $e->getMessage(); - $msg['params'] = $params; + $res['params'] = $params; + $MailDataHelper = new GmailResponseHandler(); + $apiResponse = json_decode($mail_result, true); + $res['zepto_api'] = $apiResponse; + + if (isset($apiResponse['error'])) { $response = $res; $MailDataHelper->receive_and_distribute_param_to_functions($response); return json_encode([ 'status' => 'failed', - 'code' => 500, - 'data' => $msg - ], 500); + 'code' => 404, + 'message' => 'Email Sent Failed...' . $emaill, + 'data' => $res + ], 404); } - } + if (isset($apiResponse['data'])) { + $response = $res; + $MailDataHelper->receive_and_distribute_param_to_functions($response); + return json_encode([ + 'status' => 'success', + 'code' => 200, + 'message' => 'Email Sent Successfully...' . $emaill, + 'data' => $res + ], 200); + } + + } catch (\Exception $e) { + $msg['error'] = $e->getMessage(); + $msg['params'] = $params; + $response = $res; + $MailDataHelper->receive_and_distribute_param_to_functions($response); + return json_encode([ + 'status' => 'failed', + 'code' => 500, + 'data' => $msg + ], 500); + } +} public static function bulk_mail(array $mails = []) { $model = new JobModel(); From 35def0111196a1f73d9657c7304be08399696bd6 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Fri, 17 Jan 2025 18:21:56 +0530 Subject: [PATCH 3/6] FIX_TYPO_SEND_MAIL_HELPER_SRINIVAS --- app/Helpers/MailHelper.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Helpers/MailHelper.php b/app/Helpers/MailHelper.php index ecee92da..c55c2796 100755 --- a/app/Helpers/MailHelper.php +++ b/app/Helpers/MailHelper.php @@ -260,7 +260,6 @@ class MailHelper } $apiResponse = json_decode($response, true); - log_message('error',$apiResponse); if ($httpCode === 200) { return json_encode(['status' => 'success', 'code' => 200, 'message' => 'Email Sent Successfully...', 'data' => $emaill], 200); } else { From 03a00ecccd50eb4babc8cf8c922308c4aa63474a Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Mon, 20 Jan 2025 10:45:26 +0530 Subject: [PATCH 4/6] CHANGE_AGE_BAND_LGBTQ_EMAIL_MOBILE_EDIT_: RV --- app/Config/Routes.php | 1 + app/Controllers/ClientController.php | 208 +++++++++++++++--- app/Controllers/EmployeeController.php | 5 +- app/Controllers/EmployeeServiceController.php | 9 +- app/Controllers/LeadsController.php | 189 +++++----------- app/Controllers/MasterController.php | 1 + app/Helpers/excel_util_helper.php | 37 +++- app/Models/ClientPolicyModel.php | 3 +- app/Models/EmployeePolicyModel.php | 13 +- app/Views/client_policy.php | 28 ++- app/Views/employee_data_list.php | 13 +- 11 files changed, 311 insertions(+), 196 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 83992845..a0c418f7 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -14,6 +14,7 @@ $routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']); $routes->get("reminder_mail", "NotificationController::reminder_mail"); $routes->get("getClientData", "ClientController::getClientData"); $routes->get("testing_for_review_mail/(:any)", "ClientController::testingForReviewMail/$1"); +$routes->get("sendMemberReviewConfirmationMail/(:any)", "ClientController::sendMemberReviewConfirmationMail/$1"); $routes->get("update-policy-terms-for-corrections", "ClientController::updatePolicyTermsForCorrections"); $routes->get("update_rack_rate_json", "ClientController::updateRackRateJson"); $routes->get("updatajson", "EmpDataServiceController::updatajson"); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 9e964863..cfe2a5e9 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -44,8 +44,7 @@ use App\Controllers\EmpDataServiceController; use App\Controllers\GoogleDriveController; use App\Helpers\sendMailNotification; - - +use App\Models\RFQModel; class ClientController extends AdminController { @@ -183,9 +182,12 @@ class ClientController extends AdminController print_rr($attachments); } + //Function for Testing Member Review and Summery Confirmation Mail public function testingForReviewMail($client_id = 77, $emp_code = 'EMP001-K1', $mail_active = 0) //this function for only tsesting some logics not use for business logic { + // dd($client_id, $emp_code, $mail_active); + $client_policy_ids = $this->employeeModel ->select('employee_polices.client_policy_id') ->join('employee_polices', 'employees.id = employee_polices.employee_id') @@ -213,7 +215,7 @@ class ClientController extends AdminController { $empData = $this->employeeModel->where('emp_code', $emp_code )->where('client_id', $client_id ) ->where('is_active', 1 )->findAll(); - + // dd($empData); $filteredEmpData = array_filter($empData, fn($item) => $item['relationship'] === 'Self'); // dd($filteredEmpData); @@ -254,7 +256,7 @@ class ClientController extends AdminController // print_r($wholeData); die; if($mail_active > 0){ - $mail_send_return = MailHelper::send_email($wholeData[0]); + // $mail_send_return = MailHelper::send_email($wholeData[0]); $this->myLogger->logme("info", $mail_send_return); } @@ -269,7 +271,7 @@ class ClientController extends AdminController if($mail_active > 0){ foreach ($account_manager_wholeData as $key => $value) { - $mail_send_return1 = MailHelper::send_email($value); + // $mail_send_return1 = MailHelper::send_email($value); $this->myLogger->logme("info", $mail_send_return1); } @@ -288,7 +290,7 @@ class ClientController extends AdminController if($mail_active > 0){ foreach ($client_hr_wholeData as $key => $value) { - $mail_send_return2 = MailHelper::send_email($value); + // $mail_send_return2 = MailHelper::send_email($value); $this->myLogger->logme("info", $mail_send_return2); } } @@ -317,6 +319,123 @@ class ClientController extends AdminController // return $this->respond(['status' => 'success','code' => 200,'data' => [] ], 200); } + //Function for Send Member Review and Summery Confirmation Mail + public function sendMemberReviewConfirmationMail($client_id = 77, $emp_code = 'EMP001-K1', $mail_active = 0) + { + $client_policy_ids = $this->employeeModel + ->select('employee_polices.client_policy_id') + ->join('employee_polices', 'employees.id = employee_polices.employee_id') + ->where('employees.client_id', $client_id) + ->where('employees.emp_code', $emp_code) + ->where('employee_polices.is_active', 1) + ->where('employees.is_active', 1) + ->findAll(); + + $client_policy_ids2 = array_column($client_policy_ids, 'client_policy_id'); + $client_policy_id = array_unique($client_policy_ids2); + + if (!is_null($client_policy_id) && is_array($client_policy_id)) { + + $empData = $this->employeeModel + ->where('emp_code', $emp_code) + ->where('client_id', $client_id) + ->where('is_active', 1) + ->findAll(); + + $filteredEmpData = array_filter($empData, fn($item) => $item['relationship'] === 'Self'); + + if (empty($filteredEmpData)) { + return $this->respond([ + 'status' => 'error', + 'code' => 404, + 'message' => 'No active employee data found for the given criteria.', + ], 404); + } + + $array_list = []; + foreach ($client_policy_id as $value) { + $find = $this->employeeModel->getEmpFamilybyEmpCode( + client_policy_id: $value, + emp_code: $emp_code, + client_id: $client_id, + emp_status: ['draft', 'enrolled'], + policy_status: ['draft', 'enrolled'] + ); + + if (count($find) > 0) { + $array_list[] = $find; + } + } + + $notification = $this->notificationModel + ->where('client_id', $client_id) + ->where('template_name', 'member_review_and_summary_mail') + ->first(); + + if ($notification && $notification['enabled'] == 1) { + + $params = [ + 'array_list' => $array_list, + 'client_policy_id' => $client_policy_id, + 'emp_code' => $emp_code, + 'client_id' => $client_id, + 'notification' => $notification, + 'common' => [ + 'client_id' => $filteredEmpData[0]['client_id'], + 'client_branch_id' => $filteredEmpData[0]['client_branch_id'], + 'client_policy_id' => null, + 'employee_policy_id' => null, + 'employee_id' => $filteredEmpData[0]['id'], + 'mail_type' => 'member_review_and_summary_mail', + ], + ]; + + $wholeData = sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params); + + if ($mail_active > 0) { + + $mail_send_result = MailHelper::send_email($wholeData[0]); + + if ($mail_send_result['status'] === 'success') { + return $this->respond([ + 'status' => 'success', + 'code' => 200, + 'message' => 'Email sent successfully.', + 'response' => $mail_send_result, + ], 200); + } else { + return $this->respond([ + 'status' => 'error', + 'code' => 500, + 'message' => 'Failed to send email.', + 'details' => $mail_send_result, + ], 500); + } + } + + return $this->respond([ + 'status' => 'success', + 'code' => 200, + 'message' => 'Notification prepared but email not sent as mail_active is 0.', + 'data' => $wholeData, + ], 200); + } + + return $this->respond([ + 'status' => 'error', + 'code' => 400, + 'message' => 'Member Review Mail configuration is not enabled for this client.', + ], 400); + } + + return $this->respond([ + 'status' => 'error', + 'code' => 404, + 'message' => 'No active client policy IDs found.', + ], 404); + } + + //-------------------------------------------------------------------------------------------------------- public function index() @@ -1056,6 +1175,7 @@ class ClientController extends AdminController $data['disclaimer'] = $this->request->getPost('disclaimer'); $data['is_member_modify_allowed'] = $this->request->getPost('is_member_modify_allowed') ? 1 : 0; $data['enrolment_visibility'] = $this->request->getPost('enrolment_visibility') ? 1 : 0; + $data['is_lgbtq'] = $this->request->getPost('is_lgbtq') ? 1 : 0; @@ -1188,6 +1308,7 @@ class ClientController extends AdminController $data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d'); $data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d'); $data['is_member_modify_allowed'] = $this->request->getPost('is_member_modify_allowed') ? 1 : 0; + $data['is_lgbtq'] = $this->request->getPost('is_lgbtq') ? 1 : 0; if ($data['inception_type'] == 2) { $data['open_date'] = change_date_format($this->request->getPost('open_date'), 'd-m-Y', 'Y-m-d'); $data['close_date'] = change_date_format($this->request->getPost('close_date'), 'd-m-Y', 'Y-m-d'); @@ -3831,24 +3952,27 @@ class ClientController extends AdminController public function sendextraparam() { - $batch_data = [ - 'client_id' => 17, - 'client_policy_id' => 30, - 'client_branch_id' => 18, - 'event_type' => "inception", - ]; - - // $batch_data['insurer_or_tpa'] = 'insurer'; - $batch_data['insurer_or_tpa'] = 'tpa'; + // ---------- EMP SERVICE CONTROLLER -------------------------------------------------------------------------------- - // dd($this->request); - // $employeeRestController = new EmployeeServiceController(); - // $employeeRestController->employeesOnboardPreprocess(['file_id' => 721]); - + $employeeRestController = new EmployeeServiceController(); + // $employeeRestController->excelFileDataValidation(['file_id' => 823]); + // $employeeRestController->employeesOnboardPreprocess(['file_id' => 823]); // $r = Jobs::addJob(['job_name' => 'employeesEnrollmentInsert','payload' => ['file_id' => 721]]); + // ----------EMP DATA SERVICE CONTROLLER-------------------------------------------------------------------------------- + + // $batch_data = [ + // 'client_id' => 17, + // 'client_policy_id' => 30, + // 'client_branch_id' => 18, + // 'event_type' => "inception", + // ]; + + // $batch_data['insurer_or_tpa'] = 'insurer'; + // $batch_data['insurer_or_tpa'] = 'tpa'; + // $dashBoardController = new DashboardController(); // $client_policy_data = $this->clientPolicyModel->getPolicyDetailsForRemainder($client_id=159, $client_branch_id=126); // $dashBoardController->sendRemainderMail($client_policy_data); @@ -3877,33 +4001,47 @@ class ClientController extends AdminController // $EmpDataServiceController = new EmpDataServiceController(); // $EmpDataServiceController->importInceptionFileValidation(['file_id' => 160]); - $EmpDataServiceController = new EmpDataServiceController(); + // $EmpDataServiceController = new EmpDataServiceController(); // $EmpDataServiceController->importInceptionUpdateTPAandUHID(['file_id' => 162]); // $EmpDataServiceController->importInceptionFileValidation(['file_id' => 162]); // $EmpDataServiceController->importDeletionValidation(['file_id' => 171]); // $EmpDataServiceController->importDeletionUpdateEndorsementID(['file_id' => 171]); // $EmpDataServiceController->importCorrectionUpdateEndorsementID(['file_id' => 188]); - $array = [ - "employeeIds" => ["12800", "12798", "12797", "12799"], - "client_id" => "159", - "client_policy_id" => "336", - "client_branch_id" => "126", - "cd_ac_no" => "Apple_123", - "endorsement_no" => "ENDORSEMENT_ID", - "count" => 4, - "event_name" => "deletion", - "policy_name" => "GMC", - "user_id" => "1" - ]; + + // $array = [ + // "employeeIds" => ["12800", "12798", "12797", "12799"], + // "client_id" => "159", + // "client_policy_id" => "336", + // "client_branch_id" => "126", + // "cd_ac_no" => "Apple_123", + // "endorsement_no" => "ENDORSEMENT_ID", + // "count" => 4, + // "event_name" => "deletion", + // "policy_name" => "GMC", + // "user_id" => "1" + // ]; // $EmpDataServiceController->cashDepositCalculationForDeletion($array); - // $employeeRestController = new EmployeeServiceController(); - // $employeeRestController->employeesOnboardPreprocess(['file_id' => 757]); - // $result = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($batch_data); // dd(db_connect()->getLastQuery()); + // ------------- LEADS CONTROLLER ---------------------------------------------------------- + + // $LeadsController = new LeadsController(); + // $RFQModel = new RFQModel(); + + // $data = $RFQModel->where('is_active', 1)->where('lead_id', 40)->first(); + // // dd($data); + // $policy_type = 2; + // $proposel_name = "Proposal 2"; + // $insurer_name = "ICICI-P-ICICI002-V1"; + // $jsonArray = json_decode($data['json'], true); + // // dd($jsonArray); + + // $returndata = $LeadsController->convertQCRJsonToPolicyTerms($jsonArray, $policy_type, $proposel_name, $insurer_name); + // dd($returndata); + } // ------------------------------------------------------------------------------------------------------- diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index b031e487..b479f5ff 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -2177,6 +2177,9 @@ class EmployeeController extends AdminController //get policy details $policy_details = $this->clientPolicyModel->getPolicyDetails($client_id,$policy_id); $policy_terms = (array)$policy_details[0]; + $is_lgbtq = $policy_terms['is_lgbtq']; + + // dd($policy_terms); $policy_terms = json_decode($policy_terms['policy_terms']); $policy_terms = (array) $policy_terms;// convert obj to array @@ -2184,7 +2187,7 @@ class EmployeeController extends AdminController //get file array or construnct dummy file array here $file = ['id' => null,'client_id' => $client_id,'policy_id' => $policy_id,'action' => 'inception','client_branch_id' => $branch_id,'created_by' => 1]; //get familiy details in inception file format array from post method - $result = check_dependent_conflict($family_details, $policy_terms, $file['action']); + $result = check_dependent_conflict($family_details, $policy_terms, $file['action'],$is_lgbtq); return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => ['policy_terms' => $policy_terms['family_floaters'],'result' => $result] ], 200); diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index 7eafb908..d7674712 100755 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -977,6 +977,9 @@ class EmployeeServiceController extends AdminController // get policy and rack details $policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']); $policy_details = (array)$policy_terms[0]; + $is_lgbtq = $policy_details['is_lgbtq']; + + // dd($this->clientPolicyModel->getLastQuery()); $policy_terms = json_decode($policy_terms[0]->policy_terms); $policy_terms = (array) $policy_terms;// convert obj to array @@ -1071,7 +1074,7 @@ class EmployeeServiceController extends AdminController if($file['action'] == 'dependent_addition' || $file['action'] == 'addition' || $file['action'] == 'inception'|| $file['action'] == 'missed_inception' || $file['action'] == 'enrollment') { - $res = check_dependent_conflict($family,$policy_terms,$file['action']); + $res = check_dependent_conflict($family,$policy_terms,$file['action'],$is_lgbtq); // dd($res); if(!$res['status']) { @@ -1159,7 +1162,6 @@ class EmployeeServiceController extends AdminController } - // calculate data points and premium public function employeesOnboardPreprocess($params) { @@ -1240,8 +1242,9 @@ class EmployeeServiceController extends AdminController // dd($family); } - // Kint::dump($family);die(); + // Kint::dump($family); $data = calculate_premium_new(family_data:$family,policy_terms: $policy_terms,slab_details : $slab_details,fileArr: $file, existing_units:$existing_units); + // dd($data); $employee_data_group_by_family[$emp_id] = $data; $this->employeesOnboardProcess(['familiy_data' => $data,'file' => $file]); } diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index 6140f45e..0a9c444c 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -461,7 +461,8 @@ class LeadsController extends BaseController $this->loadLayout('view_rfq.php', $data); } - public function createRFQ(){ + public function createRFQ() + { // print_r($this->request->getPost('json')); die(); @@ -1542,7 +1543,8 @@ class LeadsController extends BaseController } } - public function transformProposelData($data, $proposel, $insurer){ + public function transformProposelData($data, $proposel, $insurer) + { // print_r($data['premium_data']['data']); die; @@ -1933,107 +1935,23 @@ class LeadsController extends BaseController return $this->convertQCRJsonToPolicyTerms($converted_json, $data['policy_type_id'], $proposel_data['proposel_name'], $proposel_data['insurer_name']); } - private function convertQCRJsonToPolicyTerms($data, $policy_type, $proposel_name, $insurer_name) - { - $GMC_Keys = [ - "sum_insured", - "family_floater", - "family_floaters", - "age_ratio", - "waiverofpreexistingdiseases", - "maternitycoverage", - "twindelivery", - "preandpostnatal", - "babyday1cover", - "9monthwaitingperiodwaived", - "coverfromthedateofjoining", - "waiverof1,2,3&4thyearexclusions", - "waiverof30dayswaitingperiod", - "prehospitalizationcover", - "congenitaldiseasesinternal", - "copayzonewisecopay", - "bioabsorbablestenttoriclensmultifocallens", - "roomrentlimit", - "proportionatedeductionclause", - "ailmentcapping", - "ambulancecharges", - "airambulance", - "familytransportationbenefit", - "reasonableandcustomarycharges", - "ayudhtreatmentcover", - "congenitaldiseasesexternal", - "optionalparentalcopay", - "posthospitalizationcover", - "corporatebuffer", - "sublimitofcorporatebuffer", - "ayushTreatmentCoverData", - "armdcovered", - "suminsuredenhancement", - "automaticsuminsuredreinstatement", - "additionalsicknessbenefit", - "lasiksurgery", - "midterminclusion", - "capd", - "organdonorexpenses", - "moderntreatmentsasperirdai", - "Wellness", - "days_of_discharge", - "days_from_dod", - "special_condition_label", - "special_condition_input", - "multiple_sum_insured", - "cataract", - "cataractData" - ]; - - $GPA_Keys = [ - "sumInsured2", - "totalSumInsured", - "age_ratio", - "accidentalDeathBenefit", - "permanentTotalDisablement", - "permanentPartialDisablement", - "temporaryTotalDisablementBenefit", - "accidentalHospitalizationExpenses", - "childrenEducationWelfareFund", - "compassionateVisitExpenses", - "compassionateVisitExpensesData", - "brokenBoneExpenses", - "brokenBoneExpensesData", - "ambulanceCharges", - "ambulanceChargesData", - "burnExpenses", - "burnExpensesData", - "carriageOfDeadBody", - "carriageOfDeadBodyData", - "animalSnakeInsectBite", - "terrorism", - "worldwideCover", - "gpa_special_condition_label", - "gpa_special_condition_input", - "multiple_sum_insured" - ]; - - // Select keys based on policy type - $termsKey = $policy_type == 1 ? $GPA_Keys : $GMC_Keys; - - // Initialize terms_array with default empty values - $terms_array = array_fill_keys($termsKey, ""); - $specialKeys = ['special_condition_label', 'special_condition_input', 'gpa_special_condition_label', 'gpa_special_condition_input', 'multiple_sum_insured']; - foreach ($specialKeys as $key) { - $terms_array[$key] = []; - } + //Function for convert the RFQ and QCR Json to Policy Terms Json + public function convertQCRJsonToPolicyTerms($data, $policy_type, $proposel_name, $insurer_name) + { + //transform the data into the currernt proposel and insurere ( get single proposel ) + $data = $this->transformProposelData($data, $proposel_name, $insurer_name); // Initialize age_ratio based on policy type - $terms_array['age_ratio'] = $policy_type == 2 ? [ - "self" => ["min" => "18", "max" => "60"], - "spouse" => ["min" => 0, "max" => 0], - "child" => ["min" => 0, "max" => "25"], - "elders" => ["min" => 0, "max" => 0], - ] : ["self" => ["min" => "18", "max" => "60"]]; + $age_ratio = $policy_type == 2 ? [ + 'self' => ['min' => '18', 'max' => '60'], + 'spouse' => ['min' => 0, 'max' => 0], + 'child' => ['min' => 0, 'max' => '25'], + 'elders' => ['min' => 0, 'max' => 0], + ] : [ + 'self' => ['min' => '18', 'max' => '60'] + ]; foreach ($data['table_data']['data'] as $dataRow) { - $item = $dataRow['items'] ?? ''; foreach ($dataRow['data'] as $cellData) { @@ -2043,45 +1961,52 @@ class LeadsController extends BaseController $value = $cellData['value'] ?? ''; // Skip unwanted keys - if ( - in_array($parentth, ['Sno', 'Item Key', 'Particulars', 'Action']) || - in_array($subth, ['Quote Asked']) - ) { + if (in_array($parentth, ['Sno', 'Item Key', 'Particulars', 'Action']) || in_array($subth, ['Quote Asked'])) { continue; } - // Handle special conditions - if (str_starts_with($item, "special_condition") && $parentth === $proposel_name && $subth === $insurer_name) { + switch (true) { - $parts = explode("-", $input_value); - $question = $parts[0] ?? ''; - $answer = $parts[1] ?? ''; - $labelKey = $policy_type == 1 ? 'gpa_special_condition_label' : 'special_condition_label'; - $inputKey = $policy_type == 1 ? 'gpa_special_condition_input' : 'special_condition_input'; + // CASE 1: Handle special conditions + case str_starts_with($item, 'special_condition') && $parentth === $proposel_name && $subth === $insurer_name: + $parts = explode('-', $input_value); + $labelKey = $policy_type == 1 ? 'gpa_special_condition_label' : 'special_condition_label'; + $inputKey = $policy_type == 1 ? 'gpa_special_condition_input' : 'special_condition_input'; - $terms_array[$labelKey][] = $question; - $terms_array[$inputKey][] = $answer; - continue; + $terms_array[$labelKey][] = $parts[0] ?? ''; + $terms_array[$inputKey][] = $parts[1] ?? ''; + break; + + // CASE 2: Handle sum insured + case in_array($item, ['sum_insured', 'sumInsured2']): + $si_amt = explode(',', $value); + $terms_array[$item] = $si_amt[0] ?? ''; + $terms_array['multiple_sum_insured'] = array_slice($si_amt, 1); + + // Add age_ratio after Sum insured + if ($policy_type == 1) { + $terms_array['age_ratio'] = $age_ratio; + } + + break; + + // CASE 3: Handle family floaters + case $item === 'family_composition': + $terms_array['family_floaters'] = isJsonString($input_value) ? json_decode($input_value, true) : $input_value; + + // Add age_ratio after family floaters + if ($policy_type == 2) { + $terms_array['age_ratio'] = $age_ratio; + } + + break; + + // DEFAULT CASE : + default: + // $terms_array[$item] = isJsonString($input_value) ? (json_decode($input_value, true)['key'] ?? '') : $value; + $terms_array[$item] = $value; + break; } - - // Handle sum insured - if (in_array($item, ['sum_insured', 'sumInsured2'])) { - $si_amt = explode(",", $value); - $terms_array[$item] = $si_amt[0] ?? ""; - $terms_array['multiple_sum_insured'] = array_slice($si_amt, 1); - continue; - } - - // Handle family floaters - if ($item === 'family_composition') { - $terms_array['family_floaters'] = isJsonString($input_value) ? json_decode($input_value, true) : $input_value; - continue; - } - - // Decode JSON if valid - $terms_array[$item] = isJsonString($input_value) ? - (json_decode($input_value, true)['key'] ?? '') : - $input_value; } } diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index 4b5c9032..d7f9628a 100755 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -225,6 +225,7 @@ class MasterController extends AdminController 'New Basic Cover SI' => 'new_basic_cover_si', 'New SI Premium' => 'new_si_premium', 'Date of Coverage' => 'date_of_coverage', + 'Age Band' => 'age_band', ]; diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php index 436ae854..0b6a3a7b 100755 --- a/app/Helpers/excel_util_helper.php +++ b/app/Helpers/excel_util_helper.php @@ -532,8 +532,10 @@ if (!function_exists('name_and_empid_check_in_db')) if (!function_exists('check_dependent_conflict')) { - function check_dependent_conflict($family_data,$policy_terms,$actionArr) - { + function check_dependent_conflict($family_data,$policy_terms,$actionArr,$is_lgbtq) + { + // dd($family_data,$policy_terms,$actionArr,$is_lgbtq); + $result = ['status' => true]; $self_gender = null; @@ -622,10 +624,14 @@ if (!function_exists('check_dependent_conflict')) // print_r(array_values(array_count_values($overall_famility_relationships))); // print_r(in_array(2,array_values(array_count_values($overall_famility_relationships)))); - if($self_gender && $spouse_gender && $self_gender == $spouse_gender) + //check if this policy is allowed LGBTQ + if($is_lgbtq == 0) { - $result['status'] = false; - $result['error_data'][] = ['code' => 4,'col_name' => 'gender','msg' => 'Rule conflict: Self and Spouse cannot be same gender','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])]; + if($self_gender && $spouse_gender && $self_gender == $spouse_gender) + { + $result['status'] = false; + $result['error_data'][] = ['code' => 4,'col_name' => 'gender','msg' => 'Rule conflict: Self and Spouse cannot be same gender','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])]; + } } if(($allowed_spouse_count < $received_spouse_count) || ($allowed_child_count < $received_child_count) ) @@ -1072,7 +1078,9 @@ if (!function_exists('transform_excel_data_to_db')) if (!function_exists('premium_calculation_manager')) { function premium_calculation_manager($emp_data,$policy_terms,$slab_details,$default_si = null) - { + { + // dd($emp_data,$policy_terms,$slab_details,$default_si); + $myLogger = \Config\Services::mylogger(); // grid type // 1 = premium => si @@ -1238,6 +1246,7 @@ if (!function_exists('premium_calculation_manager')) $emp_data['policy_details']['premium'] = $slab_value['premium']; $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($emp_data['policy_details']['premium'],$emp_data['policy_details']['days'],(calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days + 1)); $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * ($gst/100)),2,'.',''); + $emp_data['policy_details']['age_band'] = $slab_value['age_from'].'-'.$slab_value['age_to']; $is_match_found = true; break; } @@ -1246,12 +1255,12 @@ if (!function_exists('premium_calculation_manager')) case "5": //GMC - Employees Age + SI $employee_received_si = $default_si == null ? $emp_data['policy_details']['basic_cover_si'] : $default_si; - $temp_date = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']); - $age = calculate_days_bw_dates(from_date: $emp_data['dob'],to_date: $temp_date)->y; - + $temp_date = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']); + $age = calculate_days_bw_dates(from_date: $emp_data['dob'],to_date: $temp_date)->y; + // kint::dump($age); foreach ($temp_slab_rates as $skey => $slab_value) { - + // dd($slab_value); if($slab_value['si'] == $employee_received_si && $slab_value['unit'] == $emp_data['unit'] && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['acting_self'] ) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null || $slab_value['premium_type'] == 3 ) )) { $emp_data['policy_details']['basic_cover_si'] = $slab_value['si']; @@ -1261,6 +1270,7 @@ if (!function_exists('premium_calculation_manager')) $emp_data['policy_details']['premium'] = $slab_value['premium']; $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($emp_data['policy_details']['premium'],$emp_data['policy_details']['days'],(calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days + 1)); $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * ($gst/100)),2,'.',''); + $emp_data['policy_details']['age_band'] = $slab_value['age_from'].'-'.$slab_value['age_to']; $is_match_found = true; break; } @@ -1276,7 +1286,7 @@ if (!function_exists('premium_calculation_manager')) if($slab_value['si'] == $employee_received_si && $slab_value['unit'] == $emp_data['unit'] && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['acting_self'] ) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null || $slab_value['premium_type'] == 3) )) { - // echo $emp_data['name']; + // echo $emp_data['name']; die; $emp_data['policy_details']['basic_cover_si'] = $slab_value['si']; $emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']); $emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date']; @@ -1284,6 +1294,7 @@ if (!function_exists('premium_calculation_manager')) $emp_data['policy_details']['premium'] = $slab_value['premium']; $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($emp_data['policy_details']['premium'],$emp_data['policy_details']['days'],(calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days + 1)); $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * ($gst/100)),2,'.',''); + $emp_data['policy_details']['age_band'] = $slab_value['age_from'].'-'.$slab_value['age_to']; $is_match_found = true; break; } @@ -1307,6 +1318,7 @@ if (!function_exists('premium_calculation_manager')) $emp_data['policy_details']['premium'] = $slab_value['premium']; $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($emp_data['policy_details']['premium'],$emp_data['policy_details']['days'],(calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days + 1)); $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * ($gst/100)),2,'.',''); + $emp_data['policy_details']['age_band'] = $slab_value['age_from'].'-'.$slab_value['age_to']; $is_match_found = true; break; @@ -1378,6 +1390,8 @@ if (!function_exists('premium_calculation_manager')) $emp_data['policy_details']['premium'] = $slab_value['premium']; $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($emp_data['policy_details']['premium'],$emp_data['policy_details']['days'],(calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days + 1)); $emp_data['policy_details']['gst'] = ((float) number_format(($emp_data['policy_details']['rata_premimum'] * ($gst/100)),2,'.','')); + $emp_data['policy_details']['age_band'] = $slab_value['age_from'].'-'.$slab_value['age_to']; + $is_match_found = true; break; } @@ -1459,6 +1473,7 @@ if (!function_exists('premium_calculation_manager')) $emp_data['policy_details']['premium'] = $slab_value['premium']; $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($emp_data['policy_details']['premium'],$emp_data['policy_details']['days'],calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days); $emp_data['policy_details']['gst'] = ((float) number_format(($emp_data['policy_details']['rata_premimum'] * ($gst/100)),2,'.','')); + $emp_data['policy_details']['age_band'] = $slab_value['age_from'].'-'.$slab_value['age_to']; $is_match_found = true; break; } diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php index 6e9cc897..3f0d7a43 100755 --- a/app/Models/ClientPolicyModel.php +++ b/app/Models/ClientPolicyModel.php @@ -52,7 +52,8 @@ class ClientPolicyModel extends Model "disclaimer", "is_active", "is_member_modify_allowed", - "cd_ac_pk" + "cd_ac_pk", + "is_lgbtq", ]; // Callbacks diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 2c23c619..6a8d590d 100755 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -35,7 +35,8 @@ class EmployeePolicyModel extends Model "claim_status", 'ecard_sent_status', 'payable_employee', - 'file_id' + 'file_id', + "age_band", ]; // Callbacks @@ -285,7 +286,10 @@ class EmployeePolicyModel extends Model employee_polices.premium, employee_polices.rata_premimum as pro_rata_premium, employee_polices.gst, + employee_polices.age_band, (employee_polices.rata_premimum + employee_polices.gst) AS total, + + batch_data.emp_policy_id, batch_data.bl AS batch_list_batch_code, batch_data.bf AS batch_files_batch_code, @@ -482,10 +486,13 @@ class EmployeePolicyModel extends Model employee_polices.pre_existing_alignments, employee_polices.policy_end_date, employee_polices.basic_cover_si as old_basic_cover_si, - employee_polices.rata_premimum as old_si_premium, + employee_polices.rata_premimum as old_si_premium, + employee_polices.age_band, + batch_data.emp_policy_id, batch_data.bl AS batch_list_batch_code, batch_data.bf AS batch_files_batch_code, + sidata.new_basic_cover_si, sidata.new_si_premium, sidata.date_of_coverage, @@ -814,6 +821,8 @@ class EmployeePolicyModel extends Model employee_polices.uhid as uhid, employee_polices.rata_premimum as premium, employee_polices.claim_status, + employee_polices.age_band, + batch_data.emp_policy_id AS emp_policy_id, batch_data.bl AS batch_list_batch_code, diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index cf219b6c..a4accd6b 100755 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -175,14 +175,14 @@
- + +
@@ -825,6 +825,13 @@ $('#policy_visibility').prop('checked', false); } + if (res.data.is_lgbtq == 1) { + $('#is_lgbtq').prop('checked', true); + } else { + $('#is_lgbtq').prop('checked', false); + } + + // Member Modify Data Enable or Disable // if (res.data.is_member_modify_allowed == 1) { // $('#is_member_modify_allowed').prop('checked', true); @@ -1886,6 +1893,19 @@ $('#policy_visibility').prop('checked', false); } + console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') + + console.log(res.data.is_lgbtq) + + if (res.data.is_lgbtq == 1) { + $('#is_lgbtq').prop('checked', true); + } else { + $('#is_lgbtq').prop('checked', false); + } + + console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') + + if (res.data.policy_type_id == '4' || res.data.policy_type_id == '5') { diff --git a/app/Views/employee_data_list.php b/app/Views/employee_data_list.php index 5e555ef2..d985fea1 100755 --- a/app/Views/employee_data_list.php +++ b/app/Views/employee_data_list.php @@ -147,13 +147,12 @@