diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 2539b119..10aac50d 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -656,7 +656,7 @@ class EmployeeRestController extends AdminController $file_name_with_path = WRITEPATH."/uploads/excel/".$filename; //make an entry in DB - $file_id = $this->fileModel->insert(['file_name' => $filename, 'client_id' => $client_id, 'policy_id' => $policy_id, 'created_by' => $loggedInUserID, 'status' => $status, 'action' => 'enrollment', 'client_branch_id' => $client_branch_id]); //here field policy_id have client_policy_id and not policy id from policy master + $file_id = $this->fileModel->insert(['file_name' => $filename, 'client_id' => $client_id, 'policy_id' => $policy_id, 'created_by' => $employee_id, 'status' => 'draft', 'action' => 'enrollment', 'client_branch_id' => $client_branch_id]); //here field policy_id have client_policy_id and not policy id from policy master $this->myLogger->logme("error", '{file_id} - client uploaded success', ['file_id' => $file_id]); $empServiceController = new EmployeeServiceController(); @@ -689,34 +689,34 @@ class EmployeeRestController extends AdminController $highestRowAndColumn = $sheet->getHighestRowAndColumn(); $data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); - $extractData['file_name']= $filename; - $extractData['client_id']= $client_id; - $extractData['client_branch_id']= $client_branch_id; - $extractData['status']= 'success'; - $extractData['policy_id']= $policy_id; - $extractData['action']= 'enrollment'; - $extractData['created_by']=$employee_id; + // $extractData['file_name']= $filename; + // $extractData['client_id']= $client_id; + // $extractData['client_branch_id']= $client_branch_id; + // $extractData['status']= 'success'; + // $extractData['policy_id']= $policy_id; + // $extractData['action']= 'enrollment'; + // $extractData['created_by']=$employee_id; - $file_data =$this->fileModel->insert($extractData); + // $file_data =$this->fileModel->insert($extractData); - $extra = []; - if (count($data[0]) == 11) { - $value = ['Sno','Emp_Code','Name','DOJ','Gender','Relation','DOB','Mail','Mobile','SI','Grade']; - $check_miss_match = []; - for ($i=0; $i 0) { - return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Column Name's are miss Match's!", 'data'=> $check_miss_match], 200); - } - } + // $extra = []; + // if (count($data[0]) == 11) { + // $value = ['Sno','Emp_Code','Name','DOJ','Gender','Relation','DOB','Mail','Mobile','SI','Grade']; + // $check_miss_match = []; + // for ($i=0; $i 0) { + // return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Column Name's are miss Match's!", 'data'=> $check_miss_match], 200); + // } + // } - if(count($data[0]) != 11){ - return json_encode($data[0]); - return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Uploaded file row count is Not Match!" ], 200); - } + // if(count($data[0]) != 11){ + // return json_encode($data[0]); + // return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Uploaded file row count is Not Match!" ], 200); + // } //this change the column name into index number for ($i = 0; $i < count($data[0]); $i++) { diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index d5b65670..9ba53688 100644 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -987,8 +987,7 @@ class EmployeeServiceController extends AdminController } } - //check self availbale in uploaded file - if(($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'enrollment') || ($policy_details['policy_type_id'] == 3 && $is_self_available_in_policy_terms)) // 3 is GMC parents dep addon) + if(($policy_details['base_policy'] == null && ($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'enrollment')) || ($policy_details['policy_type_id'] == 3 && $is_self_available_in_policy_terms)) // 3 is GMC parents dep addon) { $res = check_self_available_in_family($family,$file['action']); if(!$res['is_self_found'])