diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 910b74d..8fb1ea0 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -1062,7 +1062,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; if ($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 6 || $policy_type_id == 7) { @@ -1194,6 +1194,8 @@ 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'); diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 4cb66d6..5f4e9b2 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -2140,6 +2140,8 @@ 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 @@ -2147,7 +2149,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 7eafb90..132488f 100755 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -977,6 +977,8 @@ 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 +1073,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']) { diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php index c6e0a75..c8ef144 100755 --- a/app/Helpers/excel_util_helper.php +++ b/app/Helpers/excel_util_helper.php @@ -534,7 +534,7 @@ 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) { $result = ['status' => true]; @@ -624,10 +624,13 @@ 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) + 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) ) diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index 73891ee..10ff476 100755 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -201,6 +201,15 @@ --> + +