Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
fbb5e36f2e
@ -232,7 +232,6 @@ $routes->group("/api", ["filter" => "authJWT"], function($routes){
|
|||||||
$routes->get("/getEmployeeProfile", "EmployeeRestController::getEmployeeProfile/$1");
|
$routes->get("/getEmployeeProfile", "EmployeeRestController::getEmployeeProfile/$1");
|
||||||
$routes->post("/editEmployeeProfile", "EmployeeRestController::editEmployeeProfile");
|
$routes->post("/editEmployeeProfile", "EmployeeRestController::editEmployeeProfile");
|
||||||
|
|
||||||
|
|
||||||
$routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
$routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
||||||
$routes->post("employeeUpload", "EmployeeRestController::employeeUpload");
|
$routes->post("employeeUpload", "EmployeeRestController::employeeUpload");
|
||||||
$routes->get("relationshipList", "EmployeeRestController::relationshipList");
|
$routes->get("relationshipList", "EmployeeRestController::relationshipList");
|
||||||
@ -247,6 +246,7 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
|||||||
$routes->get("getClientPolicy", "EmployeeRestController::getClientPolicy");
|
$routes->get("getClientPolicy", "EmployeeRestController::getClientPolicy");
|
||||||
$routes->get("getClientDetails", "EmployeeRestController::getClientDetails");
|
$routes->get("getClientDetails", "EmployeeRestController::getClientDetails");
|
||||||
$routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy");
|
$routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy");
|
||||||
|
$routes->get("iAgreeForAddOn", "EmployeeRestController::iAgreeForAddOn");
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->post("sendEmail", "EmployeeRestController::send_email");
|
$routes->post("sendEmail", "EmployeeRestController::send_email");
|
||||||
|
|||||||
@ -127,7 +127,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' => '38']);
|
// $res = $empServiceController->excelFileFormatValidation(['file_id' => '42']);
|
||||||
// dd($res);
|
// dd($res);
|
||||||
|
|
||||||
// $empServiceController = new EmployeeServiceController();
|
// $empServiceController = new EmployeeServiceController();
|
||||||
@ -197,7 +197,7 @@ class EmployeeController extends AdminController
|
|||||||
//start validation process
|
//start validation process
|
||||||
|
|
||||||
$empServiceController = new EmployeeServiceController();
|
$empServiceController = new EmployeeServiceController();
|
||||||
$result = $empServiceController->excelFileFormatValidation($file_id);
|
$result = $empServiceController->excelFileFormatValidation(['file_id' => $file_id]);
|
||||||
//endof validation process
|
//endof validation process
|
||||||
if(isset($result['error_summary']) && count($result['error_summary']))
|
if(isset($result['error_summary']) && count($result['error_summary']))
|
||||||
{
|
{
|
||||||
@ -219,9 +219,9 @@ class EmployeeController extends AdminController
|
|||||||
$data['fileList'] = $this->fileModel
|
$data['fileList'] = $this->fileModel
|
||||||
->select(['files.*','up.emp_code','up.first_name','pm.name as policy_name','c.short_name'])
|
->select(['files.*','up.emp_code','up.first_name','pm.name as policy_name','c.short_name'])
|
||||||
->join('user_profiles up','files.created_by = up.id')
|
->join('user_profiles up','files.created_by = up.id')
|
||||||
->join('client_policy cp','files.policy_id = cp.id')
|
->join('client_policy cp','files.policy_id = cp.id','left')
|
||||||
->join('policies pm','cp.policy_id = pm.id')
|
->join('policies pm','cp.policy_id = pm.id','left')
|
||||||
->join('clients c','files.client_id = c.id and files.client_id = cp.client_id')
|
->join('clients c','files.client_id = c.id and files.client_id = cp.client_id','left')
|
||||||
->where('files.created_by',get_session_userid())->orderBy('files.created_at','desc')->findAll();
|
->where('files.created_by',get_session_userid())->orderBy('files.created_at','desc')->findAll();
|
||||||
|
|
||||||
$data['batch_list'] = $this->batchFileModel->select('batch_files.*, policies.name as policy_name, clients.short_name as client_short_name')
|
$data['batch_list'] = $this->batchFileModel->select('batch_files.*, policies.name as policy_name, clients.short_name as client_short_name')
|
||||||
|
|||||||
@ -294,14 +294,23 @@ class EmployeeRestController extends AdminController
|
|||||||
public function getClientPolicy()
|
public function getClientPolicy()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$ClientPolicyData = $this->clientPolicyModel->select('client_policy.id as client_policy_id , client_policy.client_id as client_id, policies.id as policy_id,policies.policy_type_id as policy_type_id, policies.name as policy_name')
|
$ClientPolicyData = $this->clientPolicyModel->select('client_policy.id as client_policy_id , client_policy.client_id as client_id, policies.id as policy_id,policies.policy_type_id as policy_type_id, policies.name as policy_name , client_policy.is_addon as is_addon')
|
||||||
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
||||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
||||||
->findAll();
|
->findAll();
|
||||||
|
$result = [];
|
||||||
|
foreach ($ClientPolicyData as $key => $value) {
|
||||||
|
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard( $value['client_policy_id'],$value['client_id']);
|
||||||
|
if($value['is_addon'] == 1){
|
||||||
|
$value['type'] = 'Add-On';
|
||||||
|
}else{
|
||||||
|
$value['type'] = $getSlabAndGridData['grid_master']['policy_type'];
|
||||||
|
}
|
||||||
|
|
||||||
$result[] = $ClientPolicyData[0];
|
array_push($result,$value);
|
||||||
$result[] = $ClientPolicyData[2];
|
|
||||||
// You probably meant to check $result, not $data
|
|
||||||
|
}
|
||||||
if ($ClientPolicyData) {
|
if ($ClientPolicyData) {
|
||||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result], 200);
|
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result], 200);
|
||||||
} else {
|
} else {
|
||||||
@ -1042,7 +1051,9 @@ public function getAddOnPolicy()
|
|||||||
$addOnEmployeeData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))->where('is_addon_value',1)->findAll();
|
$addOnEmployeeData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))->where('is_addon_value',1)->findAll();
|
||||||
$GMCEmployeeData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))->where('is_addon_value',0)->findAll();
|
$GMCEmployeeData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))->where('is_addon_value',0)->findAll();
|
||||||
|
|
||||||
|
|
||||||
$clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))->findAll();
|
$clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))->findAll();
|
||||||
|
// dd($clientPolicy);
|
||||||
if(count($clientPolicy))
|
if(count($clientPolicy))
|
||||||
{
|
{
|
||||||
$PolicyData = [];
|
$PolicyData = [];
|
||||||
@ -1055,7 +1066,7 @@ public function getAddOnPolicy()
|
|||||||
|
|
||||||
if($array['is_addon'] == 1)
|
if($array['is_addon'] == 1)
|
||||||
{
|
{
|
||||||
|
$responce['policy_name'] = $this->policesModel->where('id',$array['policy_id'])->get()->getRow()->name;
|
||||||
$responce['SlabRates'] = $getSlabAndGridData['slab_rates'];
|
$responce['SlabRates'] = $getSlabAndGridData['slab_rates'];
|
||||||
$responce['GridMaster'] = $getSlabAndGridData['grid_master'];
|
$responce['GridMaster'] = $getSlabAndGridData['grid_master'];
|
||||||
$responce['client_id'] = $array['client_id'];
|
$responce['client_id'] = $array['client_id'];
|
||||||
@ -1065,6 +1076,7 @@ public function getAddOnPolicy()
|
|||||||
$responce['policy_terms'] = $decodedArray;
|
$responce['policy_terms'] = $decodedArray;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Map family floaters that already exist in the employee table
|
// Map family floaters that already exist in the employee table
|
||||||
$familyFloates = $policy_terms->family_floaters;
|
$familyFloates = $policy_terms->family_floaters;
|
||||||
// Convert familyFloaters terms data to plain array
|
// Convert familyFloaters terms data to plain array
|
||||||
@ -1202,6 +1214,9 @@ public function getAddOnPolicy()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function iAgreeForAddOn()
|
||||||
|
{
|
||||||
|
return $this->respond(['status' => 'success','code' => 200,'data' => [] ], 200);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -89,9 +89,8 @@ class EmployeeServiceController extends AdminController
|
|||||||
$sheet = $spreadsheet->getActiveSheet();
|
$sheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
||||||
|
// dd($highestRowAndColumn);
|
||||||
|
|
||||||
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
|
||||||
// dd($this->si_enhance_excel_columns);
|
|
||||||
$columns_to_check = [];
|
$columns_to_check = [];
|
||||||
if($file['action'] == 'inception'){ $columns_to_check = $this->inception_excel_columns; }
|
if($file['action'] == 'inception'){ $columns_to_check = $this->inception_excel_columns; }
|
||||||
if($file['action'] == 'addition'){ $columns_to_check = $this->inception_excel_columns; }
|
if($file['action'] == 'addition'){ $columns_to_check = $this->inception_excel_columns; }
|
||||||
@ -100,6 +99,15 @@ class EmployeeServiceController extends AdminController
|
|||||||
if($file['action'] == 'correction'){ $columns_to_check = $this->correction_excel_columns; }
|
if($file['action'] == 'correction'){ $columns_to_check = $this->correction_excel_columns; }
|
||||||
if($file['action'] == 'si_enhancement'){ $columns_to_check = $this->si_enhance_excel_columns; }
|
if($file['action'] == 'si_enhancement'){ $columns_to_check = $this->si_enhance_excel_columns; }
|
||||||
|
|
||||||
|
|
||||||
|
$result = ['error_type' => 1,'error_summary' => [], 'error_data' => [] ];
|
||||||
|
$keys = array_keys($columns_to_check);
|
||||||
|
|
||||||
|
$allowedHighestColumn = end($columns_to_check);
|
||||||
|
// dd($allowedHighestColumn);
|
||||||
|
$excel_data = $sheet->rangeToArray('A1:' . $allowedHighestColumn['col_cell_name'] . $highestRowAndColumn['row']);
|
||||||
|
// !dd(array_chunk($excel_data,20)[0]);
|
||||||
|
|
||||||
//check no of columns in excel
|
//check no of columns in excel
|
||||||
$total_defined_columns = count($columns_to_check);
|
$total_defined_columns = count($columns_to_check);
|
||||||
$excel_columns = ($excel_data[0]);
|
$excel_columns = ($excel_data[0]);
|
||||||
@ -129,9 +137,7 @@ class EmployeeServiceController extends AdminController
|
|||||||
return array('error_summary' => [6], 'error_data' => $message);
|
return array('error_summary' => [6], 'error_data' => $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
//start other checks
|
|
||||||
$result = ['error_type' => 1,'error_summary' => [], 'error_data' => [] ];
|
|
||||||
$keys = array_keys($columns_to_check);
|
|
||||||
// dd($columns_to_check);die();
|
// dd($columns_to_check);die();
|
||||||
|
|
||||||
// get policy and rack details
|
// get policy and rack details
|
||||||
@ -268,8 +274,8 @@ class EmployeeServiceController extends AdminController
|
|||||||
//proceed next data level validation in JOB queue
|
//proceed next data level validation in JOB queue
|
||||||
$job_details = new Jobs();
|
$job_details = new Jobs();
|
||||||
$r = Jobs::addJob(['job_name' => 'excelFileDataValidation','payload' => ['file_id' => $file_id]]);
|
$r = Jobs::addJob(['job_name' => 'excelFileDataValidation','payload' => ['file_id' => $file_id]]);
|
||||||
$jobWorker = new JobWorker();
|
// $jobWorker = new JobWorker();
|
||||||
JobWorker::processJob($r);
|
// JobWorker::processJob($r);
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
@ -321,10 +327,11 @@ class EmployeeServiceController extends AdminController
|
|||||||
$sheet = $spreadsheet->getActiveSheet();
|
$sheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
||||||
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
|
||||||
// dd($excel_data);
|
|
||||||
$result = ['error_type' => 2,'error_summary' => [], 'error_data' => [] ];
|
$result = ['error_type' => 2,'error_summary' => [], 'error_data' => [] ];
|
||||||
$keys = array_keys($columns_to_check);
|
$keys = array_keys($columns_to_check);
|
||||||
|
|
||||||
|
$allowedHighestColumn = end($columns_to_check);
|
||||||
|
$excel_data = $sheet->rangeToArray('A1:' . $allowedHighestColumn['col_cell_name'] . $highestRowAndColumn['row']);
|
||||||
// print_r($keys);die();
|
// print_r($keys);die();
|
||||||
|
|
||||||
//remove header
|
//remove header
|
||||||
@ -493,7 +500,8 @@ class EmployeeServiceController extends AdminController
|
|||||||
$sheet = $spreadsheet->getActiveSheet();
|
$sheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
||||||
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
$allowedHighestColumn = end($columns_to_check);
|
||||||
|
$excel_data = $sheet->rangeToArray('A1:' . $allowedHighestColumn['col_cell_name'] . $highestRowAndColumn['row']);
|
||||||
unset($excel_data[0]);
|
unset($excel_data[0]);
|
||||||
|
|
||||||
|
|
||||||
@ -574,12 +582,13 @@ class EmployeeServiceController extends AdminController
|
|||||||
|
|
||||||
$file_name_with_path = WRITEPATH."/uploads/excel/".$file['file_name'];
|
$file_name_with_path = WRITEPATH."/uploads/excel/".$file['file_name'];
|
||||||
|
|
||||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path);
|
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path);
|
||||||
$sheet = $spreadsheet->getActiveSheet();
|
$sheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
||||||
|
$allowedHighestColumn = end($this->deletion_excel_columns);
|
||||||
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
$excel_data = $sheet->rangeToArray('A1:' . $allowedHighestColumn['col_cell_name'] . $highestRowAndColumn['row']);
|
||||||
|
// $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||||
|
|
||||||
unset($excel_data[0]);
|
unset($excel_data[0]);
|
||||||
// dd($excel_data);
|
// dd($excel_data);
|
||||||
@ -589,15 +598,16 @@ class EmployeeServiceController extends AdminController
|
|||||||
//make closure funciton which is going to use only by this method
|
//make closure funciton which is going to use only by this method
|
||||||
$endorsement = function($data,$file,$row){
|
$endorsement = function($data,$file,$row){
|
||||||
|
|
||||||
|
$group_key = rand(100000, 999999);
|
||||||
//for emp table
|
//for emp table
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$data['emp_id'],'emp_code' => $data['emp_code'],'table_name' => 'employees','actions' => 'd','name' => $data['name'],'field_name' => 'emp_status','old_value' => $data['emp_status'],'new_value' => 'deactivate','created_by' => $file['created_by'],'remarks' => 'general deletion']);
|
$this->empEndorsementModel->save(['pk' => (int)$data['emp_id'],'emp_code' => $data['emp_code'],'table_name' => 'employees','actions' => 'd','name' => $data['name'],'field_name' => 'emp_status','old_value' => $data['emp_status'],'new_value' => 'deactivate','created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key]);
|
||||||
// dd( $this->empEndorsementModel->getLastQuery());
|
// dd( $this->empEndorsementModel->getLastQuery());
|
||||||
// $this->empEndorsementModel->save(['pk' => (int)$data['emp_id'],'emp_code' => $data['emp_code'],'table_name' => 'employees','actions' => 'd','name' => $data['name'],'field_name' => 'change_event','old_value' => $data['change_event'],'new_value' => 'deletion','created_by' => $file['created_by'],'remarks' => 'general deletion']);
|
// $this->empEndorsementModel->save(['pk' => (int)$data['emp_id'],'emp_code' => $data['emp_code'],'table_name' => 'employees','actions' => 'd','name' => $data['name'],'field_name' => 'change_event','old_value' => $data['change_event'],'new_value' => 'deletion','created_by' => $file['created_by'],'remarks' => 'general deletion']);
|
||||||
|
|
||||||
// for employee policy table
|
// for employee policy table
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'date_of_exit','old_value' => $data['date_of_exit'],'new_value' => change_date_format($row[4],'d-M-Y','Y-m-d'),'created_by' => $file['created_by'],'remarks' => 'general deletion']);
|
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'date_of_exit','old_value' => $data['date_of_exit'],'new_value' => change_date_format($row[4],'d-M-Y','Y-m-d'),'created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key]);
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'reason_for_exit','old_value' => $data['reason_for_exit'],'new_value' => $row[5],'created_by' => $file['created_by'],'remarks' => 'general deletion']);
|
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'reason_for_exit','old_value' => $data['reason_for_exit'],'new_value' => $row[5],'created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key]);
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'status','old_value' => $data['status'],'new_value' => 'deactivate','created_by' => $file['created_by'],'remarks' => 'general deletion']);
|
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'status','old_value' => $data['status'],'new_value' => 'deactivate','created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key]);
|
||||||
};
|
};
|
||||||
//iterate each row
|
//iterate each row
|
||||||
foreach ($excel_data as $col_key => $row)
|
foreach ($excel_data as $col_key => $row)
|
||||||
@ -671,8 +681,9 @@ class EmployeeServiceController extends AdminController
|
|||||||
$sheet = $spreadsheet->getActiveSheet();
|
$sheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
||||||
|
$allowedHighestColumn = end($this->correction_excel_columns);
|
||||||
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
$excel_data = $sheet->rangeToArray('A1:' . $allowedHighestColumn['col_cell_name'] . $highestRowAndColumn['row']);
|
||||||
|
// $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||||
|
|
||||||
unset($excel_data[0]);
|
unset($excel_data[0]);
|
||||||
// dd($excel_data);
|
// dd($excel_data);
|
||||||
@ -702,7 +713,8 @@ class EmployeeServiceController extends AdminController
|
|||||||
//make entry in endorsement table
|
//make entry in endorsement table
|
||||||
if(!count($existing_endorsements))
|
if(!count($existing_endorsements))
|
||||||
{
|
{
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employees','actions' => 'c','name' => $employee['name'],'field_name' => $field_name,'old_value' => $employee[ $field_name ],'new_value' => $field_value,'created_by' => $file['created_by'],'remarks' => $row[7],'date_of_correction' => change_date_format($row[5],'d-M-Y','Y-m-d')]);
|
$group_key = rand(100000, 999999);
|
||||||
|
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employees','actions' => 'c','name' => $employee['name'],'field_name' => $field_name,'old_value' => $employee[ $field_name ],'new_value' => $field_value,'created_by' => $file['created_by'],'remarks' => $row[7],'date_of_correction' => change_date_format($row[5],'d-M-Y','Y-m-d'),'group_key' => $group_key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -727,8 +739,9 @@ class EmployeeServiceController extends AdminController
|
|||||||
$sheet = $spreadsheet->getActiveSheet();
|
$sheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
||||||
|
$allowedHighestColumn = end($this->si_enhance_excel_columns);
|
||||||
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
$excel_data = $sheet->rangeToArray('A1:' . $allowedHighestColumn['col_cell_name'] . $highestRowAndColumn['row']);
|
||||||
|
// $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||||
|
|
||||||
unset($excel_data[0]);
|
unset($excel_data[0]);
|
||||||
// dd($excel_data);
|
// dd($excel_data);
|
||||||
@ -763,9 +776,10 @@ class EmployeeServiceController extends AdminController
|
|||||||
{
|
{
|
||||||
if($slab_value['si'] == $row[3])
|
if($slab_value['si'] == $row[3])
|
||||||
{
|
{
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'basic_cover_si','old_value' => $employee_policy['basic_cover_si'],'new_value' => $row[3],'created_by' => $file['created_by'],'remarks' => 'general si enhancement']);
|
$group_key = rand(100000, 999999);
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'premium','old_value' => $employee_policy['premium'],'new_value' => $slab_value['premium'],'created_by' => $file['created_by'],'remarks' => 'general si enhancement']);
|
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'basic_cover_si','old_value' => $employee_policy['basic_cover_si'],'new_value' => $row[3],'created_by' => $file['created_by'],'remarks' => 'general si enhancement','group_key' => $group_key]);
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'si_enhancement_date','old_value' => null,'new_value' => change_date_format($row[4],'d-M-Y','Y-m-d'),'created_by' => $file['created_by'],'remarks' => 'general si enhancement']);
|
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'premium','old_value' => $employee_policy['premium'],'new_value' => $slab_value['premium'],'created_by' => $file['created_by'],'remarks' => 'general si enhancement','group_key' => $group_key]);
|
||||||
|
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'si_enhancement_date','old_value' => null,'new_value' => change_date_format($row[4],'d-M-Y','Y-m-d'),'created_by' => $file['created_by'],'remarks' => 'general si enhancement','group_key' => $group_key]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -797,10 +811,11 @@ class EmployeeServiceController extends AdminController
|
|||||||
|
|
||||||
$employee = $this->employeeModel->checkExistingEmp($value);
|
$employee = $this->employeeModel->checkExistingEmp($value);
|
||||||
$policy_data = $value['policy_details'];
|
$policy_data = $value['policy_details'];
|
||||||
|
$temp = $value['temp'];
|
||||||
unset($value['policy_details']);
|
unset($value['policy_details']);
|
||||||
unset($value['temp']);
|
unset($value['temp']);
|
||||||
|
|
||||||
if($file['id'] == null && (strtolower($value['relationship']) == 'self' && $value['temp']['source'] == 'db' && $value['temp']['emp_id'] != null && $value['temp']['emp_policy_id'] != null))
|
if($file['id'] == null && (strtolower($value['relationship']) == 'self' && $temp['source'] == 'db' && $temp['emp_id'] != null && $temp['emp_policy_id'] != null))
|
||||||
{
|
{
|
||||||
//check existing si and new si
|
//check existing si and new si
|
||||||
$employee_policy = $this->employeePolicyModel->where('employee_id',$employee['id'])->where('client_policy_id',$file['policy_id'])->first();
|
$employee_policy = $this->employeePolicyModel->where('employee_id',$employee['id'])->where('client_policy_id',$file['policy_id'])->first();
|
||||||
@ -824,10 +839,11 @@ class EmployeeServiceController extends AdminController
|
|||||||
{
|
{
|
||||||
if($slab_value['si'] == $policy_data['si'])
|
if($slab_value['si'] == $policy_data['si'])
|
||||||
{
|
{
|
||||||
|
$group_key = rand(100000, 999999);
|
||||||
//add new premimum details in endorsement table
|
//add new premimum details in endorsement table
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'basic_cover_si','old_value' => $employee_policy['basic_cover_si'],'new_value' => $policy_data['premium'],'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement']);
|
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'basic_cover_si','old_value' => $employee_policy['basic_cover_si'],'new_value' => $policy_data['premium'],'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement','group_key' => $group_key]);
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'premium','old_value' => $employee_policy['premium'],'new_value' => $slab_value['premium'],'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement']);
|
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'premium','old_value' => $employee_policy['premium'],'new_value' => $slab_value['premium'],'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement','group_key' => $group_key]);
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'si_enhancement_date','old_value' => null,'new_value' => ($policy_data['date_coverage']),'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement']);
|
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'si_enhancement_date','old_value' => null,'new_value' => ($policy_data['date_coverage']),'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement','group_key' => $group_key]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class JobWorker extends AdminController
|
|||||||
//sleep(1);
|
//sleep(1);
|
||||||
|
|
||||||
SELF::processjob(['id' => $job->id,'uuid' => $job->uuid]);
|
SELF::processjob(['id' => $job->id,'uuid' => $job->uuid]);
|
||||||
usleep( 500000 );
|
// usleep( 500000 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -347,6 +347,7 @@ if (!function_exists('check_dependent_conflict'))
|
|||||||
|
|
||||||
// $temp_string = implode(" ",$policy_terms['family_floaters']);
|
// $temp_string = implode(" ",$policy_terms['family_floaters']);
|
||||||
$temp = $policy_terms['family_floaters'];
|
$temp = $policy_terms['family_floaters'];
|
||||||
|
$temp = is_array($temp) ? $temp : (is_object($temp) ? (array)$temp : []);
|
||||||
$allowed_child_count = $temp['childrens'];
|
$allowed_child_count = $temp['childrens'];
|
||||||
$allowed_spouse_count = $temp['spouse'];
|
$allowed_spouse_count = $temp['spouse'];
|
||||||
$allowed_adults = $temp['either-parents-pil'];
|
$allowed_adults = $temp['either-parents-pil'];
|
||||||
@ -902,3 +903,18 @@ if (!function_exists('transform_db_data_to_excel'))
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//comparre excel cell names and return range of chars between them
|
||||||
|
if (!function_exists('compare_excel_cell_range'))
|
||||||
|
{
|
||||||
|
function compare_excel_cell_range($highestColumnAllowed, $highestColumnReceivedInExcel) {
|
||||||
|
$highestColumnAllowed = strtoupper($highestColumnAllowed);
|
||||||
|
$highestColumnReceivedInExcel = strtoupper($highestColumnReceivedInExcel);
|
||||||
|
|
||||||
|
if ($highestColumnAllowed < $highestColumnReceivedInExcel) {
|
||||||
|
$range = range($highestColumnAllowed, $highestColumnReceivedInExcel);
|
||||||
|
return $range;
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -50,10 +50,10 @@ class CheckDependentConflictTest extends CIUnitTestCase
|
|||||||
$this->assertTrue($result['status']);
|
$this->assertTrue($result['status']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testIsNull()
|
// public function testIsNull()
|
||||||
{
|
// {
|
||||||
$i = null;
|
// $i = null;
|
||||||
$this->assertTrue($i);
|
// $this->assertTrue($i);
|
||||||
|
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user