diff --git a/app/Config/Routes.php b/app/Config/Routes.php index dd81efc5..f8d085da 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -12,7 +12,8 @@ $routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']); // Reminder Mail Notification $routes->get("reminder_mail", "NotificationController::reminder_mail"); -$routes->get("testing", "ClientController::Testing"); +// $routes->get("testing", "ClientController::Testing"); +$routes->get("testing_for_review_mail/(:any)", "ClientController::testingForReviewMail/$1"); $routes->get("update-policy-terms-for-corrections", "ClientController::updatePolicyTermsForCorrections"); $routes->get("update_rack_rate_json", "ClientController::updateRackRateJson"); $routes->get("updatajson", "EmpDataServiceController::updatajson"); @@ -312,6 +313,10 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) { $routes->get("get_client_policy_data_using_policy_no_and_endo_no/(:any)", "ClientController::get_client_policy_data_using_policy_no_and_endo_no/$1"); $routes->get("checkInvoiceStatus/(:any)", "PolicyTransactionController::checkInvoiceStatus/$1"); $routes->get("base_policy_for_policy_inception/(:any)", "PolicyTransactionController::getBasePolicy/$1"); + $routes->get("sentTestMail/(:any)", "NotificationController::sentTestMail/$1"); + $routes->get("send_manual_reminder/(:any)", "DashboardController::sendManualReminder/$1"); + $routes->get("get_client_policy_list_for_remainder/(:any)", "EmployeeController::get_client_policy_list_for_remainder/$1"); + }); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 683cc3c1..6bad026d 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -115,72 +115,121 @@ class ClientController extends AdminController $this->vehicleModel = new VehicleModel(); } - public function Testing() //this function for only tsesting some logics not use for business logic + public function testingForReviewMail($client_id = 77, $emp_code = 'MGL-004', $mail_active = 0) //this function for only tsesting some logics not use for business logic { - $emp_code = 'MGL-004'; - $client_id = 77; - $client_policy_id = 206; - $array_list = []; - $find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $client_policy_id, emp_code: $emp_code, client_id: $client_id, emp_status: ['draft', 'enrolled'], policy_status: ['draft', 'enrolled']); - if (count($find) > 0) { - $array_list[] = $find; - } + $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(); - // dd($array_list); + $client_policy_ids2 = array_column($client_policy_ids, 'client_policy_id'); - $notification = $this->notificationModel->where('client_id', $client_id)->where('template_name', 'member_review_and_summary_mail')->first(); + $client_policy_id = array_unique($client_policy_ids2); - // dd($notification); + // echo '
';
+        // dd($client_policy_id);
+        // print_r($unique_policy_ids); die;
+        // sort($client_policy_id);
 
-        if (isset($notification) && $notification['enabled'] == 1) {
+        $wholeData = '';
+        $mail_send_return = '';
+        $mail_send_return1 = '';
+        $mail_send_return2 = '';
 
-            $params['array_list'] = $array_list;
-            $params['client_policy_id'] = $client_policy_id;
-            $params['emp_code'] = $emp_code;
-            $params['client_id'] = $client_id;
-            $params['notification'] = $notification;
-
-            // print_r($params);die;
-
-            $wholeData = sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
-
-            // print_r($wholeData); die;
-
-            $mail_send_return =  MailHelper::send_email($wholeData[0]);
-            $this->myLogger->logme("info", $mail_send_return);
-
-            if (isset($wholeData[0])) {
-
-                $account_manager_wholeData = sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
-
-                // print_r($account_manager_wholeData); die;
-
-                if ($account_manager_wholeData) {
-
-                    foreach ($account_manager_wholeData as $key => $value) {
-                        $mail_send_return1 =  MailHelper::send_email($value);
-                        $this->myLogger->logme("info", $mail_send_return1);
-                        $this->myLogger->logme("info", $mail_send_return1);
-                    }
-                }
-
-                $client_hr_wholeData = sendMailNotification::sendMailNotification('client_hr_summary_mail', $params);
-
-                // print_r($client_hr_wholeData); die;
-
-                if ($client_hr_wholeData) {
-
-                    foreach ($client_hr_wholeData as $key => $value) {
-                        $mail_send_return2 = MailHelper::send_email($value);
-                        $this->myLogger->logme("info", $mail_send_return2);
-                    }
+        if (!is_null($client_policy_id) && is_array($client_policy_id))
+        {
+            $array_list = [];
+            foreach ($client_policy_id as $key => $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;
                 }
             }
+
+            // dd($array_list);
+
+            $notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first();
+
+
+            if (isset($notification) && $notification['enabled'] == 1) {
+
+                $params ['array_list'] = $array_list;
+                $params ['client_policy_id'] = $client_policy_id;
+                $params ['emp_code'] = $emp_code;
+                $params ['client_id'] = $client_id;
+                $params ['notification'] = $notification;
+
+                // dd($params);
+
+                $wholeData =sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
+                // print_r($wholeData); die;
+
+                if($mail_active > 0){
+                    $mail_send_return =  MailHelper::send_email($wholeData[0]);
+                    $this->myLogger->logme("info", $mail_send_return);
+                }
+
+                if (isset($wholeData[0])) {
+                    
+                    $account_manager_wholeData =sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
+                    // print_r($account_manager_wholeData); die;
+
+                    if($account_manager_wholeData != null && $account_manager_wholeData != '' && count($account_manager_wholeData))
+                    {   
+                        if($mail_active > 0){
+
+                            foreach ($account_manager_wholeData as $key => $value) {
+                                $mail_send_return1 =  MailHelper::send_email($value);
+                                $this->myLogger->logme("info", $mail_send_return1);
+                            }
+
+                        }
+
+                    }else{
+                        $this->myLogger->logme("error", 'Account Manager Mail Configuration not Enable for this client');
+                    }
+
+                    $client_hr_wholeData =sendMailNotification::sendMailNotification('client_hr_summary_mail', $params);
+                    // print_r($client_hr_wholeData); die;
+
+                    if($client_hr_wholeData != null && $client_hr_wholeData != '' &&count($client_hr_wholeData))
+                    {  
+                        if($mail_active > 0){
+
+                            foreach ($client_hr_wholeData as $key => $value) {
+                                $mail_send_return2 = MailHelper::send_email($value);
+                                $this->myLogger->logme("info", $mail_send_return2);
+                            }
+                        }
+                        
+                    }else{
+                        $this->myLogger->logme("error", 'Client HR Mail Configuration not Enable for this client');
+                    }
+                }
+
+            }else{
+                $this->myLogger->logme("error", 'Member Review Mail Configuration not Enable for this client');
+            }
+
         }
+    
+        print_r($wholeData);
 
+        echo '
';
+        echo '

member_review_and_summary_mail



'; + print_r($mail_send_return); + echo '

account_maneger_summary_mail



'; + print_r($mail_send_return1); + echo '

client_hr_summary_mail



'; + print_r($mail_send_return2); - return $this->respond(['status' => 'success', 'code' => 200, 'data' => []], 200); + // return $this->respond(['status' => 'success','code' => 200,'data' => [] ], 200); } public function index() @@ -915,6 +964,7 @@ class ClientController extends AdminController $data['client_branch_id'] = $this->request->getPost('client_branch_id'); $data['cd_ac_no'] = $this->request->getPost('cd_ac_no'); $data['gst'] = $this->request->getPost('gst'); + $data['disclaimer'] = $this->request->getPost('disclaimer'); if ($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 6 || $policy_type_id == 7) { @@ -1041,6 +1091,7 @@ class ClientController extends AdminController $data['client_branch_id'] = $this->request->getPost('client_branch_id'); $data['cd_ac_no'] = $this->request->getPost('cd_ac_no'); $data['gst'] = $this->request->getPost('gst'); + $data['disclaimer'] = $this->request->getPost('disclaimer'); $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'); diff --git a/app/Controllers/DashboardController.php b/app/Controllers/DashboardController.php index 079e4d35..38b727a2 100755 --- a/app/Controllers/DashboardController.php +++ b/app/Controllers/DashboardController.php @@ -467,7 +467,7 @@ class DashboardController extends AdminController } - public function sendManualRemainder($client_id, $client_branch_id) + public function sendManualReminder($client_id, $client_branch_id) { $this->myLogger->logme('error', "sendManualRemainder called with client_id: {$client_id}, client_branch_id: {$client_branch_id}"); diff --git a/app/Filters/CloseDbConnection.php b/app/Filters/CloseDbConnection.php index ad49eb86..0ce482c9 100755 --- a/app/Filters/CloseDbConnection.php +++ b/app/Filters/CloseDbConnection.php @@ -19,7 +19,7 @@ class CloseDbConnection implements FilterInterface // Get all database configurations $db = \Config\Database::connect(); $log = \Config\Services::mylogger(); - $log->logme('error','CloseDbConnections....!'); + // $log->logme('error','CloseDbConnections....!'); $db->close(); } } diff --git a/app/Helpers/MailHelper.php b/app/Helpers/MailHelper.php index bddd1a49..f94d6419 100755 --- a/app/Helpers/MailHelper.php +++ b/app/Helpers/MailHelper.php @@ -118,7 +118,7 @@ class MailHelper try { - $res = $gmailapi->sendMessage($emaill, $subject, $message, 'info@nhanceindia.in', $reply_to, $cc, $bcc); + $res = $gmailapi->sendMessage($emaill, $subject, $message, 'no-reply@nhanceindia.in', $reply_to, $cc, $bcc); if($res['status']) { diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index 91907824..c8d65de8 100755 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -3,10 +3,13 @@ namespace App\Helpers; use App\Models\ClientModel; +use App\Models\ClientPolicyModel; use App\Models\ClientRMModel; use App\Models\NotificationModel; use App\Models\UserModel; use App\Models\EmployeeModel; +use App\Models\PolicyPremium1Model; +use App\Models\PolicyPremium2Model; class sendMailNotification { @@ -169,6 +172,10 @@ class sendMailNotification $clientModel = new ClientModel(); $notificationModel = new NotificationModel(); + $clientPolicyModel = new ClientPolicyModel(); + $PolicyPremium1Model = new PolicyPremium1Model(); + $PolicyPremium2Model = new PolicyPremium2Model(); + $client_data =$clientModel->where('id', $client_id)->first(); $notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first(); @@ -200,32 +207,59 @@ class sendMailNotification $name = ''; $emp_code = ''; + // echo '
';
+                // print_r($array_list); die;
+
                 foreach ($array_list as $item) {
+                    
+
                     if (count($item) != 0) {
-                        $table_content .= '

Policy Name : '; + + $table_content .= '

Policy Type :'; $temp_data = ''; $policy_name = ''; $is_addon = ''; foreach ($item as $inner_item) { + + //getting policy premium data + $client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first(); + if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){ + $policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first(); + }else{ + $policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first(); + } + //end of getting policy premium data + $policy_name = $inner_item['policy_name']; if ($inner_item['relationship'] == 'Self') { $emp_code = ' (' . $inner_item['emp_code'] . ')'; + $mail = $inner_item['email_corporate']; } else { $emp_code = ''; } + + + $si = ''; + $premium = ''; + $gst_forself = ''; + if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){ + $si = '₹ ' .format_indian_number($inner_item['basic_cover_si']); + $premium = '₹ ' .format_indian_number(round($inner_item['premium'])); + $gst_forself = '₹ ' .format_indian_number(round($inner_item['gst'])); + } $temp_data .= ''; $temp_data .= '' . $inner_item['name'] . $emp_code . ''; $temp_data .= '' . $inner_item['relationship'] . ''; $temp_data .= '' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . ''; - $temp_data .= '₹' . format_indian_number($inner_item['basic_cover_si']) . ''; + $temp_data .= '' . $si . ''; // Only Display SI Topup and Dependent Addon if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) { - $temp_data .= '₹' . format_indian_number(round($inner_item['premium'])) . ''; - $temp_data .= '₹' . format_indian_number(round($inner_item['gst'])) . ''; + $temp_data .= '' . $premium . ''; + $temp_data .= '' . $gst_forself . ''; } $temp_data .= ''; @@ -237,8 +271,13 @@ class sendMailNotification $gst = $inner_item['gst'] + $gst; } } + + $policy_name_for_policy_type = $inner_item['policy_name']; + if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){ + $policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents'; + } - $table_content .= $policy_name . '

'; + $table_content .= $policy_name_for_policy_type . '

'; $table_content .= ''; // Add text-align: center to the table head @@ -264,7 +303,7 @@ class sendMailNotification if ($is_addon == 2 || $is_addon == 3) { $addon_list_array = [ - 'policy_name' => $policy_name, + 'policy_name' => $policy_name_for_policy_type, 'addtional_premium' => round($addtional_premium), 'gst' => round($gst) ]; @@ -316,8 +355,6 @@ class sendMailNotification // $table_content .= '
' . $sum_total_words . '
'; } - - // print_r($table_content); die; $mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content); @@ -337,10 +374,15 @@ class sendMailNotification } else if($action == 'account_maneger_summary_mail'){ $client_id = $params['client_id']; + $client_policy_id = $params['client_policy_id']; $clientModel = new ClientModel(); $notificationModel = new NotificationModel(); $clientRMModel =new ClientRMModel(); + $clientPolicyModel = new ClientPolicyModel(); + $PolicyPremium1Model = new PolicyPremium1Model(); + $PolicyPremium2Model = new PolicyPremium2Model(); + $client_data =$clientModel->where('id', $client_id)->first(); $notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first(); @@ -381,12 +423,22 @@ class sendMailNotification foreach ($array_list as $item) { if (count($item) != 0) { - $table_content .= '

Policy Name : '; + $table_content .= '

Policy Type :'; $temp_data = ''; $policy_name = ''; $is_addon = ''; foreach ($item as $inner_item) { + + //getting policy premium data + $client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first(); + if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){ + $policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first(); + }else{ + $policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first(); + } + //end of getting policy premium data + $policy_name = $inner_item['policy_name']; if ($inner_item['relationship'] == 'Self') { @@ -394,17 +446,26 @@ class sendMailNotification } else { $emp_code = ''; } + + $si = ''; + $premium = ''; + $gst_forself = ''; + if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){ + $si = '₹ ' .format_indian_number($inner_item['basic_cover_si']); + $premium = '₹ ' .format_indian_number(round($inner_item['premium'])); + $gst_forself = '₹ ' .format_indian_number(round($inner_item['gst'])); + } $temp_data .= '

'; $temp_data .= ''; $temp_data .= ''; $temp_data .= ''; - $temp_data .= ''; + $temp_data .= ''; // Only Display SI Topup and Dependent Addon if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) { - $temp_data .= ''; - $temp_data .= ''; + $temp_data .= ''; + $temp_data .= ''; } $temp_data .= ''; @@ -416,8 +477,13 @@ class sendMailNotification $gst = $inner_item['gst'] + $gst; } } + + $policy_name_for_policy_type = $inner_item['policy_name']; + if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){ + $policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents'; + } - $table_content .= $policy_name . ''; + $table_content .= $policy_name_for_policy_type . ''; $table_content .= '
' . $inner_item['name'] . $emp_code . '' . $inner_item['relationship'] . '' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '₹' . format_indian_number($inner_item['basic_cover_si']) . '' . $si . '₹' . format_indian_number(round($inner_item['premium'])) . '₹' . format_indian_number(round($inner_item['gst'])) . '' . $premium . '' . $gst_forself . '
'; // Add text-align: center to the table head @@ -443,7 +509,7 @@ class sendMailNotification if ($is_addon == 2 || $is_addon == 3) { $addon_list_array = [ - 'policy_name' => $policy_name, + 'policy_name' => $policy_name_for_policy_type, 'addtional_premium' => round($addtional_premium), 'gst' => round($gst) ]; @@ -513,8 +579,12 @@ class sendMailNotification } else if($action == 'client_hr_summary_mail'){ $client_id = $params['client_id']; + $client_policy_id = $params['client_policy_id']; $clientModel = new ClientModel(); + $clientPolicyModel = new ClientPolicyModel(); + $PolicyPremium1Model = new PolicyPremium1Model(); + $PolicyPremium2Model = new PolicyPremium2Model(); $client_data =$clientModel->where('id', $client_id)->first(); $notificationModel = new NotificationModel(); @@ -522,6 +592,7 @@ class sendMailNotification $clientRMModel =new ClientRMModel(); if (isset($notification_data['enabled']) && $notification_data['enabled'] == 1) { + $client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll(); $user_list= []; foreach ($client_rm_data as $key => $value) { @@ -558,12 +629,22 @@ class sendMailNotification foreach ($array_list as $item) { if (count($item) != 0) { - $table_content .= '

Policy Name : '; + $table_content .= '

Policy Type :'; $temp_data = ''; $policy_name = ''; $is_addon = ''; foreach ($item as $inner_item) { + + //getting policy premium data + $client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first(); + if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){ + $policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first(); + }else{ + $policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first(); + } + //end of getting policy premium data + $policy_name = $inner_item['policy_name']; if ($inner_item['relationship'] == 'Self') { @@ -571,17 +652,29 @@ class sendMailNotification } else { $emp_code = ''; } + + $si = ''; + $premium = ''; + $gst_forself = ''; + + // dd($policy_premium_data, $client_policy_data, $inner_item); + + if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){ + $si = '₹ ' .format_indian_number($inner_item['basic_cover_si']); + $premium = '₹ ' .format_indian_number(round($inner_item['premium'])); + $gst_forself = '₹ ' .format_indian_number(round($inner_item['gst'])); + } $temp_data .= '

'; $temp_data .= ''; $temp_data .= ''; $temp_data .= ''; - $temp_data .= ''; + $temp_data .= ''; // Only Display SI Topup and Dependent Addon if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) { - $temp_data .= ''; - $temp_data .= ''; + $temp_data .= ''; + $temp_data .= ''; } $temp_data .= ''; @@ -594,7 +687,12 @@ class sendMailNotification } } - $table_content .= $policy_name . ''; + $policy_name_for_policy_type = $inner_item['policy_name']; + if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){ + $policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents'; + } + + $table_content .= $policy_name_for_policy_type . ''; $table_content .= '
' . $inner_item['name'] . $emp_code . '' . $inner_item['relationship'] . '' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '₹' . format_indian_number($inner_item['basic_cover_si']) . '' . $si . '₹' . format_indian_number(round($inner_item['premium'])) . '₹' . format_indian_number(round($inner_item['gst'])) . '' . $premium . '' . $gst_forself . '
'; // Add text-align: center to the table head @@ -620,7 +718,7 @@ class sendMailNotification if ($is_addon == 2 || $is_addon == 3) { $addon_list_array = [ - 'policy_name' => $policy_name, + 'policy_name' => $policy_name_for_policy_type, 'addtional_premium' => round($addtional_premium), 'gst' => round($gst) ]; @@ -685,7 +783,7 @@ class sendMailNotification } return $wholeData; - } + } } } @@ -836,7 +934,7 @@ class sendMailNotification if (!empty($array_list)) { - $table_content .= '

Policy Name : '; + $table_content .= '

Policy Type :'; $policy_name = $array_list['policy_name']; @@ -985,7 +1083,7 @@ class sendMailNotification $emp_code = ''; if (!empty($array_list)) { - $table_content .= '

Policy Name : '; + $table_content .= '

Policy Type :'; $policy_name = $array_list['policy_name']; @@ -1133,7 +1231,7 @@ class sendMailNotification if (!empty($array_list)) { - $table_content .= '

Policy Name : '; + $table_content .= '

Policy Type :'; $policy_name = $array_list['policy_name']; diff --git a/app/Helpers/utility_helper.php b/app/Helpers/utility_helper.php index e0e8ef06..6e627287 100755 --- a/app/Helpers/utility_helper.php +++ b/app/Helpers/utility_helper.php @@ -375,7 +375,34 @@ if (!function_exists('excelFileGDriveUpload')) { } } +if(!function_exists('checkFamilyFloaters')){ + function checkFamilyFloaters($policy_premium_data, $client_policy_data, $emp_data){ + + if($policy_premium_data['premium_type'] == 1){ + + //only family floater + if ($emp_data['relationship'] == 'Self') { + return true; + } + + if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){ + if($emp_data['rata_premimum'] > 0){ + return true; + }else{ + return false; + } + } + + return false; + + }else{ + //individual + return true; + } + + } +} function numberToWords($number) diff --git a/app/Models/EmployeeModel.php b/app/Models/EmployeeModel.php index 086dbd88..b84b96a9 100755 --- a/app/Models/EmployeeModel.php +++ b/app/Models/EmployeeModel.php @@ -161,7 +161,7 @@ class EmployeeModel extends Model // for EMP rest API process do not change public function checkExistingEmployee($arr,$client_branch_id) { - return $this->where('emp_code',$arr['emp_code'])->where('name',$arr['name'])->where('client_id', $arr['client_id'])->where('client_branch_id', $client_branch_id)->first(); + return $this->where('emp_code',$arr['emp_code'])->where('name',$arr['name'])->where('client_id', $arr['client_id'])->where('client_branch_id', $client_branch_id)->where('emp_status !=', 'truncated')->first(); } diff --git a/app/Views/employee_upload.php b/app/Views/employee_upload.php index 5ad5ea73..7f1ae499 100755 --- a/app/Views/employee_upload.php +++ b/app/Views/employee_upload.php @@ -103,7 +103,7 @@ option:disabled { diff --git a/app/Views/enrollment_list.php b/app/Views/enrollment_list.php index 4052ecb5..8459974c 100755 --- a/app/Views/enrollment_list.php +++ b/app/Views/enrollment_list.php @@ -714,12 +714,12 @@ } $.ajax({ - url: '' + client_id + '/' + client_branch_id, + url: '' + client_id + '/' + client_branch_id, type: "GET", dataType: 'json', success: function(res) { - console.log('send_manual_remainder', res) + console.log('send_manual_reminder', res) $('.loader').fadeOut(); $('.loader-mask').delay(350).fadeOut('slow'); diff --git a/app/Views/policy_grid.php b/app/Views/policy_grid.php index 80351506..46f33c80 100755 --- a/app/Views/policy_grid.php +++ b/app/Views/policy_grid.php @@ -14,7 +14,7 @@ } .radio-group .form-check { - margin-right: -110px; + margin-right: -335px; } .radioalign{ @@ -2882,186 +2882,214 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p } $relationshipElement.empty(); + let html = ` -
-
- `; + +
+ +

+ `; + if (obj['self'] > 0) { let selfValue = additional_relationship['self'] || '1'; console.log('selfValue', selfValue); html += ` -
- -
- - -
-
- - -
-
- - -
-
- - -
-
`; + + + + `; } if (obj['spouse'] > 0) { let spouseValue = additional_relationship['spouse'] || 'any'; html += ` -
- -
- - -
-
- - -
-
- - -
-
- - -
-
`; + + + + `; } if (obj['childrens'] > 0) { - let childrensValue = additional_relationship['childrens'] || 'any'; html += ` -
- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
`; + + + + `; } if (obj['parents'] > 0) { let parentsValue = additional_relationship['parents'] || 'any'; html += ` -
- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
`; + + + + `; } if (obj['parents-in-law'] > 0) { let parentsInLawValue = additional_relationship['parents-in-law'] || 'any'; html += ` -
- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
`; + + + + `; } html += ` + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
- `; + + `; - $relationshipElement.append(html); + console.log(html); - if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { - $('.radio-group .form-check').css('margin-right', '-60px'); - } else if (obj['self'] == 0 && obj['spouse'] > 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { - $('.radio-group .form-check').css('margin-right', '-110px'); - } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] == 0) { - $('.radio-group .form-check').css('margin-right', '-60px'); - } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] == 0 && obj['parents-in-law'] > 0) { - $('.radio-group .form-check').css('margin-right', '-60px'); - } else if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { - $('.radio-group .form-check').css('margin-right', '-110px'); - } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { - $('.radio-group .form-check').css('margin-right', '-110px'); - } else if (obj['self'] > 0 && obj['spouse'] > 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0){ - $('.radio-group .form-check').css('margin-right', '-60px'); - } else if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0){ - $('.radio-group .form-check').css('margin-right', '-60px'); - } else { - $('.radio-group .form-check').css('margin-right', '-60px'); - } + $relationshipElement.append(html); - if(policy_type == 1 || policy_type == 6 || policy_type == 7){ - $('.radio-group .form-check').css('margin-right', '-50px'); - } + // if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } else if (obj['self'] == 0 && obj['spouse'] > 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { + // $('.radio-group .form-check').css('margin-right', '-110px'); + // } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] == 0) { + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] == 0 && obj['parents-in-law'] > 0) { + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } else if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { + // $('.radio-group .form-check').css('margin-right', '-110px'); + // } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { + // $('.radio-group .form-check').css('margin-right', '-110px'); + // } else if (obj['self'] > 0 && obj['spouse'] > 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0){ + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } else if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0){ + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } else { + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } + + // if(policy_type == 1 || policy_type == 6 || policy_type == 7){ + // $('.radio-group .form-check').css('margin-right', '-50px'); + // } } diff --git a/app/Views/policy_transaction_endorsement_form.php b/app/Views/policy_transaction_endorsement_form.php index 8d2d529d..543f2863 100644 --- a/app/Views/policy_transaction_endorsement_form.php +++ b/app/Views/policy_transaction_endorsement_form.php @@ -361,66 +361,74 @@ Total - - Agreed BP % - - - Agreed TP % - - - Agreed TEP % - - - Agreed Amount - - - Standard BP % - - - Standard TP % - - - Standard TEP % - - - Actual BP Amount - - - Actual TP Amount - - - Actual TEP Amount - - - Actual BP % - - - Actual TP % - - - Actual TEP % - - - Actual BP
Remuneration Amount - - - Actual TP
Remuneration Amount - - - Actual TEP
Remuneration Amount - - - Expected Amount - - - Variance - - - Reward - + + + + + Agreed BP % + + + Agreed TP % + + + Agreed TEP % + + + Agreed Amount + + + Standard BP % + + + Standard TP % + + + Standard TEP % + + + Actual BP Amount + + + Actual TP Amount + + + Actual TEP Amount + + + Actual BP % + + + Actual TP % + + + Actual TEP % + + + Actual BP
Remuneration Amount + + + Actual TP
Remuneration Amount + + + Actual TEP
Remuneration Amount + + + Expected Amount + + + Variance + + + Reward + + + + + + @@ -451,9 +459,21 @@