FIX_EXCEL_WRONG_ROW_ID
This commit is contained in:
parent
9e14f7bf92
commit
af6d9c28e5
@ -190,7 +190,7 @@ class EmployeeController extends AdminController
|
|||||||
// print_r($this->request->getPost('upload-action-type'));
|
// print_r($this->request->getPost('upload-action-type'));
|
||||||
// die();
|
// die();
|
||||||
// $empServiceController = new EmployeeServiceController();
|
// $empServiceController = new EmployeeServiceController();
|
||||||
// $res = $empServiceController->excelFileFormatValidation(['file_id' => '42']);
|
// $res = $empServiceController->excelFileDataValidation(['file_id' => '933']);
|
||||||
// dd($res);
|
// dd($res);
|
||||||
|
|
||||||
// $empServiceController = new EmployeeServiceController();
|
// $empServiceController = new EmployeeServiceController();
|
||||||
|
|||||||
@ -566,6 +566,15 @@ if (!function_exists('check_dependent_conflict'))
|
|||||||
$allowed_parents_count = $temp['either-parents-pil'] == 0 ? $temp['parents'] : 0;
|
$allowed_parents_count = $temp['either-parents-pil'] == 0 ? $temp['parents'] : 0;
|
||||||
$allowed_parent_in_laws_count = $temp['either-parents-pil'] == 0 ? $temp['parents-in-law'] : 0;
|
$allowed_parent_in_laws_count = $temp['either-parents-pil'] == 0 ? $temp['parents-in-law'] : 0;
|
||||||
// dd($allowed_adults == 0);
|
// dd($allowed_adults == 0);
|
||||||
|
$firstNonTemp = null;
|
||||||
|
|
||||||
|
foreach ($family_data as $family) {
|
||||||
|
if (!isset($family['temp'])) {
|
||||||
|
$firstNonTemp = $family;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Kint::dump($firstNonTemp);
|
||||||
foreach ($family_data as $key => $row)
|
foreach ($family_data as $key => $row)
|
||||||
{
|
{
|
||||||
// dd($family_data[0][0]);
|
// dd($family_data[0][0]);
|
||||||
@ -580,7 +589,7 @@ if (!function_exists('check_dependent_conflict'))
|
|||||||
if($relationship == 'self')
|
if($relationship == 'self')
|
||||||
{
|
{
|
||||||
$self_gender = $row[4];
|
$self_gender = $row[4];
|
||||||
$self_emp_row_id = $row[0];
|
$self_emp_row_id = isset($row['temp']) ? null : $row[0];
|
||||||
}
|
}
|
||||||
if($relationship == 'spouse')
|
if($relationship == 'spouse')
|
||||||
{
|
{
|
||||||
@ -612,8 +621,9 @@ if (!function_exists('check_dependent_conflict'))
|
|||||||
$repeated_count = array_intersect($repeated_relationships_count,$temp_counts);
|
$repeated_count = array_intersect($repeated_relationships_count,$temp_counts);
|
||||||
if(is_array($repeated_count) && count($repeated_count))
|
if(is_array($repeated_count) && count($repeated_count))
|
||||||
{
|
{
|
||||||
|
// Kint::dump($firstNonTemp);die();
|
||||||
$result['status'] = false;
|
$result['status'] = false;
|
||||||
$result['error_data'][] = ['code' => 13,'col_name' => 'relationship','msg' => 'Rule conflict: Twofold relationship found within family','row_id' => $family_data[0][0]];
|
$result['error_data'][] = ['code' => 13,'col_name' => 'relationship','msg' => 'Rule conflict: Twofold relationship found within family','row_id' => $firstNonTemp[0]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// print_r($repeated_count);
|
// print_r($repeated_count);
|
||||||
@ -630,26 +640,26 @@ if (!function_exists('check_dependent_conflict'))
|
|||||||
if($self_gender && $spouse_gender && $self_gender == $spouse_gender)
|
if($self_gender && $spouse_gender && $self_gender == $spouse_gender)
|
||||||
{
|
{
|
||||||
$result['status'] = false;
|
$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])];
|
$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 : $firstNonTemp[0])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($allowed_spouse_count < $received_spouse_count) || ($allowed_child_count < $received_child_count) )
|
if(($allowed_spouse_count < $received_spouse_count) || ($allowed_child_count < $received_child_count) )
|
||||||
{
|
{
|
||||||
$result['status'] = false;
|
$result['status'] = false;
|
||||||
$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
|
$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 : $firstNonTemp[0])];//dependent count mismatch
|
||||||
}
|
}
|
||||||
|
|
||||||
// || ($allowed_parents_count < $received_parents_count) || ($allowed_parent_in_laws_count < $received_parent_in_laws_count)
|
// || ($allowed_parents_count < $received_parents_count) || ($allowed_parent_in_laws_count < $received_parent_in_laws_count)
|
||||||
if($allowed_adults == 1 && $received_parents_count && $received_parent_in_laws_count )
|
if($allowed_adults == 1 && $received_parents_count && $received_parent_in_laws_count )
|
||||||
{
|
{
|
||||||
$result['status'] = false;
|
$result['status'] = false;
|
||||||
$result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Parents and Parents in law both not allowed','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];
|
$result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Parents and Parents in law both not allowed','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $firstNonTemp[0])];
|
||||||
|
|
||||||
if((2 < $received_parents_count) || (2 < $received_parent_in_laws_count))
|
if((2 < $received_parents_count) || (2 < $received_parent_in_laws_count))
|
||||||
{
|
{
|
||||||
$result['status'] = false;
|
$result['status'] = false;
|
||||||
$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
|
$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 : $firstNonTemp[0])];//dependent count mismatch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//check for any cross parents but not more than two
|
//check for any cross parents but not more than two
|
||||||
@ -657,7 +667,7 @@ if (!function_exists('check_dependent_conflict'))
|
|||||||
{
|
{
|
||||||
// dd($allowed_adults);
|
// dd($allowed_adults);
|
||||||
$result['status'] = false;
|
$result['status'] = false;
|
||||||
$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
|
$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 : $firstNonTemp[0])];//dependent count mismatch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user