diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 1df4dc16..673f2933 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -279,7 +279,7 @@ class EmployeeController extends AdminController $data['fileList'] = $this->fileModel ->select([ - 'files.*', + 'files.id','files.file_name','files.created_by','files.created_at','files.is_active','files.status','files.client_id','files.policy_id','files.client_branch_id','files.action','files.uploaded_by', 'up.emp_code', 'up.first_name', 'c.short_name', @@ -301,9 +301,10 @@ class EmployeeController extends AdminController ->join('client_branch cb', 'files.client_branch_id = cb.id', 'left') ->join('policy_type', 'policy_type.id = cp.policy_type_id') ->join('clients c', 'files.client_id = c.id and files.client_id = cp.client_id', 'left') - ->where('files.created_by', get_session_userid()) + // ->where('files.created_by', get_session_userid()) ->orderBy('files.created_at', 'desc') - ->findAll(); + ->limit(100) + ->find(); // dd($data['fileList']); $data['batch_list'] = $this->batchFileModel->select( @@ -318,7 +319,8 @@ class EmployeeController extends AdminController ->join('policy_type', 'policy_type.id = client_policy.policy_type_id') ->join('clients', 'clients.id = client_policy.client_id') ->orderBy('batch_files.id', 'desc') - ->findAll(); + ->limit(100) + ->find(); // dd($data['fileList']);die(); diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index c13eb6ba..b0d07d2e 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -804,6 +804,7 @@ class EmployeeRestController extends AdminController 'basic_pay'=> $extra['11'][$index], 'unit'=> isset($extra['12'][$index]) ? $extra['12'][$index] : null, 'client_branch_id' => $client_branch_id + 'date_coverage' => $extra['13'][$index] ]; $basic_cover_si_value = null; @@ -840,6 +841,8 @@ class EmployeeRestController extends AdminController $count = 0; for ($a=0; $a employeeModel->checkExistingEmployee($dataToInsert[$a],$client_branch_id); $emp_id =0; @@ -891,6 +894,7 @@ class EmployeeRestController extends AdminController 'employee_id'=>$emp_id, 'client_policy_id'=>$policy_id, 'status'=> 'draft', + 'date_coverage' => $date_coverage 'basic_cover_si'=>isset($basic_cover_si[$a]) ? $basic_cover_si[$a] : null ]; diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index ef99ee20..b6236313 100755 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -594,6 +594,15 @@ class EmployeeServiceController extends AdminController 'data_type' => 'str', 'format' => null, 'allowed_values' => null + ], + 'doc' => [ + 'col_idx' => 13, + 'col_cell_name' => 'N', + 'col_name' => 'DOC', + 'is_mandatory' => false, + 'data_type' => 'str', + 'format' => 'd-M-Y', + 'allowed_values' => null ] ]; @@ -605,7 +614,7 @@ class EmployeeServiceController extends AdminController 4 => 4, // inception: gender (Gender) -> enrollment: gender (Gender) 5 => 5, // inception: relationship (RELATIONSHIP) -> enrollment: relationship (Relation) 6 => 9, // inception: basic_cover_si (BASIC COVER SI) -> enrollment: basic_cover_si (SI) - 7 => null, // inception: doc (Date of Coverage) -> No match in enrollment + 7 => 13, // inception: doc (Date of Coverage) 8 => 3, // inception: doj (DOJ) -> enrollment: doj (DOJ) 9 => 11, // inception: basic_pay (Basic Pay) -> enrollment: basic_pay (Basic Pay) 10 => 10, // inception: band_grade (Band/Grade) -> enrollment: band_grade (Grade) @@ -1249,7 +1258,7 @@ class EmployeeServiceController extends AdminController //get policy slab rates $slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($client_policy_id,$client_id); - $existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(client_id: $client_id,client_policy_id: $client_policy_id,emp_status: ['enrolled','draft'],policy_status:['enrolled','draft']); + $existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(client_id: $client_id,client_policy_id: $client_policy_id,emp_status: ['enrolled'],policy_status:['enrolled']); // $file = ['id' => null,'client_id' => $client_id,'policy_id' => $client_policy_id,'action' => 'inception']; $file = ['id' => null,'client_id' => $client_id,'policy_id' => $client_policy_id,'action' => 'inception','created_by' => get_session_userid(),'client_branch_id' => $params['client_branch_id']]; @@ -1613,6 +1622,7 @@ class EmployeeServiceController extends AdminController $value['emp_status'] = 'active'; $value['created_by'] = $file['created_by']; $value['client_branch_id'] = $file['client_branch_id']; + $value['family_floater_key'] = generate_family_floater_key($value['relationship']); $log_message = 'Insert Employee- '.$value['name'] .'('.$value['emp_code'] .') with PK '; // $this->myLogger->logme('error',('Insert - ' . $value['emp_code'] .' - '. $value['name'])); // echo 'update emp'; @@ -1983,7 +1993,7 @@ public function employeesEnrollmentInsert($params) $value['file_id'] = $file_id; $value['temp']['emp_id'] = null; // dummy value for using exisitng funciton in model - if (strtolower(trim($value['relationship'])) === 'mother' || strtolower(trim($value['relationship'])) === 'Father') { + if (strtolower(trim($value['relationship'])) === 'mother' || strtolower(trim($value['relationship'])) === 'father') { $relation = 'parent'; } else if(strtolower(trim($value['relationship'])) === 'son' || strtolower(trim($value['relationship'])) === 'daughter'){ $relation = 'child'; @@ -1997,6 +2007,7 @@ public function employeesEnrollmentInsert($params) $value['family_floater_key'] = $relation; $policy_data['basic_cover_si'] = $row[9]; + $policy_data['date_coverage'] = $row[13]; $policy_data['client_policy_id'] = $file['policy_id']; $employee = $this->employeeModel->checkExistingEmployee($value,$file['client_branch_id']); diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php index 6de54c74..bf911f77 100755 --- a/app/Helpers/excel_util_helper.php +++ b/app/Helpers/excel_util_helper.php @@ -1800,7 +1800,7 @@ if(!function_exists('transform_enrollment_row_to_inception_row')) $res[4] = $row[4]; // inception: gender (Gender) -> enrollment: gender (Gender) $res[5] = $row[5]; // inception: relationship (RELATIONSHIP) -> enrollment: relationship (Relation) $res[6] = $row[9]; // inception: basic_cover_si (BASIC COVER SI) -> enrollment: basic_cover_si (SI) - $res[7] = null; // inception: doc (Date of Coverage) -> No match in enrollment + $res[7] = $row[13]; // inception: doc (Date of Coverage) -> No match in enrollment $res[8] = $row[3]; // inception: doj (DOJ) -> enrollment: doj (DOJ) $res[9] = $row[11]; // inception: basic_pay (Basic Pay) -> enrollment: basic_pay (Basic Pay) $res[10] = $row[10]; // inception: band_grade (Band/Grade) -> enrollment: band_grade (Grade) @@ -2119,4 +2119,24 @@ if(!function_exists('group_slab_rates_basedon_name')) return $temp_slab_rates; } +} + + +//this key generating mandantory for display employee info in enrolment app w/o error +if(!function_exists('generate_family_floater_key')) +{ + function generate_family_floater_key($relationship) + { + if (strtolower(trim($relationship)) === 'mother' || strtolower(trim($relationship)) === 'father') { + $relation = 'parent'; + } else if(strtolower(trim($relationship)) === 'son' || strtolower(trim($relationship)) === 'daughter'){ + $relation = 'child'; + }else if(strtolower(trim($relationship)) === 'father in Law' || strtolower(trim($relationship)) === 'mother in Law'){ + $relation = 'parent_in_law'; + }else if(strtolower(trim($relationship)) === 'spouse'){ + $relation = 'spouse'; + }else{ + $relation = 'self'; + } + } } \ No newline at end of file diff --git a/app/Views/batch_list.php b/app/Views/batch_list.php index 00e5b465..a2c371b2 100755 --- a/app/Views/batch_list.php +++ b/app/Views/batch_list.php @@ -67,7 +67,7 @@ - by + by diff --git a/app/Views/file_list.php b/app/Views/file_list.php index 2cd80976..a504ad5f 100755 --- a/app/Views/file_list.php +++ b/app/Views/file_list.php @@ -53,7 +53,7 @@ - - ' . $file['first_name'] . '' ?> + ' . $file['first_name'] . '' ?>