FIX_SELF_CHECK&CROSS_PARENTS_HANDLED

This commit is contained in:
velz 2024-06-20 11:28:08 +05:30
parent 5115cfcb7b
commit 5fc9d3a1f2
2 changed files with 7 additions and 6 deletions

View File

@ -359,7 +359,10 @@ class EmployeeServiceController extends AdminController
{
$temp = $policy_terms['family_floaters'];
$temp = is_array($temp) ? $temp : (is_object($temp) ? (array)$temp : []);
$is_self_available_in_policy_terms = isset($temp['self']) ? true : false;
$is_self_available_in_policy_terms = isset($temp['self']) && $temp['self'] == 1 ? true : false;
// Kint::dump($temp['self']);
// dd($is_self_available_in_policy_terms);
}
// dd($employee_data_group_by_family);
foreach ($employee_data_group_by_family as $emp_id => $family)
@ -415,7 +418,7 @@ class EmployeeServiceController extends AdminController
if(!count($self_details))
{
array_push($result['error_summary'],14); // Self not found
$result['error_data'][ $family[0][0] ]['sno']['error'][] = "Self not found in System";
$result['error_data'][ $family[0][0] ]['sno']['error'][] = "Self not found in Database";
}
}

View File

@ -603,10 +603,8 @@ if (!function_exists('check_dependent_conflict'))
$result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: As per policy, count of dependents has exceeded configured count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch
}
}
// var_dump($allowed_adults == 0);
// dd($allowed_adults == 0 && (($allowed_parents_count < $received_parents_count) || ($allowed_parent_in_laws_count < $received_parent_in_laws_count)));
if($allowed_adults == 0 && (($allowed_parents_count < $received_parents_count) || ($allowed_parent_in_laws_count < $received_parent_in_laws_count) ))
//check for any cross parents but not more than two
if($allowed_adults == 0 && $allowed_parents_count == 1 && $allowed_parent_in_laws_count == 1 && (2 < ($received_parents_count + $received_parent_in_laws_count)))
{
// dd($allowed_adults);
$result['status'] = false;