DEBUG_EMPLOYEEREST_API
This commit is contained in:
parent
250725c035
commit
a5a5b6f9fc
@ -227,6 +227,8 @@ class EmployeeRestController extends AdminController
|
|||||||
try {
|
try {
|
||||||
$data = $this->request->getJSON();
|
$data = $this->request->getJSON();
|
||||||
|
|
||||||
|
// dd($data);
|
||||||
|
|
||||||
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($data[0]->client_policy_id);
|
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($data[0]->client_policy_id);
|
||||||
if($openForEnrollment == false){ return $this->respond(['status' => 'failed','code' => 404,'data' => 'Enrollment closed'], 404); }
|
if($openForEnrollment == false){ return $this->respond(['status' => 'failed','code' => 404,'data' => 'Enrollment closed'], 404); }
|
||||||
|
|
||||||
@ -252,7 +254,7 @@ class EmployeeRestController extends AdminController
|
|||||||
$item->gender = $this->GenderMap($item->relationship , $item->emp_code);
|
$item->gender = $this->GenderMap($item->relationship , $item->emp_code);
|
||||||
$item->dob = $this->convertDateFormatYMD($item->dob);
|
$item->dob = $this->convertDateFormatYMD($item->dob);
|
||||||
$item->emp_status = 'draft';
|
$item->emp_status = 'draft';
|
||||||
|
// dd($item);
|
||||||
$employee = $this->employeeModel->insert($item);
|
$employee = $this->employeeModel->insert($item);
|
||||||
|
|
||||||
if ($employee) {
|
if ($employee) {
|
||||||
@ -348,6 +350,7 @@ class EmployeeRestController extends AdminController
|
|||||||
$data['status']= 'draft';
|
$data['status']= 'draft';
|
||||||
$data['date_coverage'] = $this->getEmployeeCoverageDate($emp_code, $client_policy_id);
|
$data['date_coverage'] = $this->getEmployeeCoverageDate($emp_code, $client_policy_id);
|
||||||
|
|
||||||
|
dd($data);
|
||||||
$this->employeePolicyModel->insert($data);
|
$this->employeePolicyModel->insert($data);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -513,6 +516,9 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
$requestData = $this->request->getJSON();
|
$requestData = $this->request->getJSON();
|
||||||
|
|
||||||
|
// print_r($requestData);
|
||||||
|
// dd($requestData);
|
||||||
|
|
||||||
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($requestData[0]->client_policy_id);
|
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($requestData[0]->client_policy_id);
|
||||||
if($openForEnrollment == false){ return $this->respond(['status' => 'failed','code' => 404,'data' => 'Enrollment closed'], 404); }
|
if($openForEnrollment == false){ return $this->respond(['status' => 'failed','code' => 404,'data' => 'Enrollment closed'], 404); }
|
||||||
|
|
||||||
@ -524,7 +530,7 @@ class EmployeeRestController extends AdminController
|
|||||||
->where('is_active', 1 )
|
->where('is_active', 1 )
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
|
// dd($checkIfExist);
|
||||||
if ($checkIfExist) {
|
if ($checkIfExist) {
|
||||||
|
|
||||||
$empPolicy = $this->employeePolicyModel->updateSiAndPremium($value->client_policy_id, $value->employee_id, $value->basic_cover_si);
|
$empPolicy = $this->employeePolicyModel->updateSiAndPremium($value->client_policy_id, $value->employee_id, $value->basic_cover_si);
|
||||||
@ -2254,7 +2260,7 @@ class EmployeeRestController extends AdminController
|
|||||||
// print_r($slab_details);die();
|
// print_r($slab_details);die();
|
||||||
|
|
||||||
$existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(client_id: $client_id,client_policy_id: $client_policy_id,emp_code: $emp_code,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']);
|
$existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(client_id: $client_id,client_policy_id: $client_policy_id,emp_code: $emp_code,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']);
|
||||||
// kint::dump($existing_famility_details);
|
// kint::dump($existing_famility_decalculatePremiumtails);
|
||||||
|
|
||||||
//get the Auto SI amount
|
//get the Auto SI amount
|
||||||
$auto_si_data = update_si_with_auto_si($client_id, $client_policy_id, $emp_code, $client_branch_id, $existing_famility_details);
|
$auto_si_data = update_si_with_auto_si($client_id, $client_policy_id, $emp_code, $client_branch_id, $existing_famility_details);
|
||||||
@ -2274,8 +2280,8 @@ class EmployeeRestController extends AdminController
|
|||||||
{
|
{
|
||||||
//get basepolicy id then pull emplist from base policy if only current policy is DA addon policy and emplist is zero
|
//get basepolicy id then pull emplist from base policy if only current policy is DA addon policy and emplist is zero
|
||||||
// echo 'inside';
|
// echo 'inside';
|
||||||
$client_policy_id = $base_policy;
|
// $client_policy_id = $base_policy;
|
||||||
$existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(client_id: $client_id,client_policy_id: $client_policy_id,emp_code: $emp_code,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']);
|
$existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(client_id: $client_id,client_policy_id: $base_policy,emp_code: $emp_code,emp_status:['draft','enrolled'],policy_status:['draft','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'];
|
||||||
@ -2292,10 +2298,25 @@ class EmployeeRestController extends AdminController
|
|||||||
$transformed_famility_details = transform_db_data_to_excel($family);
|
$transformed_famility_details = transform_db_data_to_excel($family);
|
||||||
|
|
||||||
$data = calculate_premium_new(family_data: $transformed_famility_details,policy_terms:$policy_terms,slab_details:$slab_details,fileArr: $file,existing_units: $existing_units,default_si : $default_si);
|
$data = calculate_premium_new(family_data: $transformed_famility_details,policy_terms:$policy_terms,slab_details:$slab_details,fileArr: $file,existing_units: $existing_units,default_si : $default_si);
|
||||||
|
// print_r($data);
|
||||||
$employee_data_group_by_family[$emp_id] = $data;
|
$employee_data_group_by_family[$emp_id] = $data;
|
||||||
|
|
||||||
|
foreach ($data as $value) {
|
||||||
|
$newData = [];
|
||||||
|
$newData['employee_id'] = $value['temp']['emp_id'];
|
||||||
|
$newData['client_policy_id'] = $value['policy_details']['client_policy_id'];
|
||||||
|
$newData['status'] = "draft";
|
||||||
|
$newData['basic_cover_si'] = $value['policy_details']['basic_cover_si'];
|
||||||
|
$newData['date_coverage'] = $value['policy_details']['date_coverage'];
|
||||||
|
$newData['policy_end_date'] = $value['policy_details']['policy_end_date'];
|
||||||
|
$newData['days'] = $value['policy_details']['days'];
|
||||||
|
|
||||||
|
$this->employeePolicyModel->insert($newData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// die();
|
||||||
if($clientPolicyId != null && $empCode != null)
|
if($clientPolicyId != null && $empCode != null)
|
||||||
{ // dd ($employee_data_group_by_family);
|
{ // dd ($employee_data_group_by_family);
|
||||||
return $employee_data_group_by_family;
|
return $employee_data_group_by_family;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user