Merge remote-tracking branch 'origin/dev' into test
This commit is contained in:
commit
7aca71196c
@ -1111,6 +1111,10 @@ class ClientController extends AdminController
|
|||||||
$data['family_floaters']['parents'] =2;
|
$data['family_floaters']['parents'] =2;
|
||||||
$data['family_floaters']['parents-in-law'] =2;
|
$data['family_floaters']['parents-in-law'] =2;
|
||||||
$data['family_floaters']['either-parents-pil'] =0;
|
$data['family_floaters']['either-parents-pil'] =0;
|
||||||
|
}else{
|
||||||
|
$data['family_floaters']['parents'] =0;
|
||||||
|
$data['family_floaters']['parents-in-law'] =0;
|
||||||
|
$data['family_floaters']['either-parents-pil'] =0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -189,7 +189,12 @@ class EmployeeRestController extends AdminController
|
|||||||
$item->family_floater_key = $this->RelationshipMap($item->relationship);
|
$item->family_floater_key = $this->RelationshipMap($item->relationship);
|
||||||
$item->dob = $this->convertDateFormatYMD($item->dob);
|
$item->dob = $this->convertDateFormatYMD($item->dob);
|
||||||
$employee = $this->employeeModel->insert($item);
|
$employee = $this->employeeModel->insert($item);
|
||||||
|
|
||||||
if ($employee) {
|
if ($employee) {
|
||||||
|
if(!isset($item->is_addon_value))
|
||||||
|
{
|
||||||
|
$this->createEmployeePolicyData($employee,$item->emp_code,$item->client_id,$item->client_policy_id);
|
||||||
|
}
|
||||||
$Count++;
|
$Count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,6 +216,34 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createEmployeePolicyData($employee_id,$emp_code,$client_id,$client_policy_id)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$client_policy = $this->clientPolicyModel->where('id', $client_policy_id)->where('client_id', $client_id)->first();
|
||||||
|
$policy_terms = json_decode($client_policy['policy_terms']);
|
||||||
|
$basic_cover_si = $policy_terms->sum_insured;
|
||||||
|
|
||||||
|
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard($client_policy_id,$client_id);
|
||||||
|
$SlabRatesArray = $getSlabAndGridData['slab_rates'];
|
||||||
|
$premium = $this->findPremiumAmount($SlabRatesArray, $basic_cover_si);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$data['employee_id']= $employee_id;
|
||||||
|
$data['client_policy_id']= $client_policy_id;
|
||||||
|
$data['basic_cover_si']= $basic_cover_si;
|
||||||
|
$data['premium']= $premium;
|
||||||
|
|
||||||
|
$this->employeePolicyModel->insert($data);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function RelationshipMap($value){
|
public function RelationshipMap($value){
|
||||||
|
|
||||||
if ($value === 'Mother' || $value === 'Father') {
|
if ($value === 'Mother' || $value === 'Father') {
|
||||||
@ -274,9 +307,7 @@ class EmployeeRestController extends AdminController
|
|||||||
public function getEmployeeAndDependenceByClientId()
|
public function getEmployeeAndDependenceByClientId()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$empData = $this->employeePolicyModel->getEmployeePolicy( $this->request->getGet('client_id'), $this->request->getGet('client_policy_id'));
|
$empData = $this->employeePolicyModel->getEmployeePolicy( client_id:$this->request->getGet('client_id'),policy_id: $this->request->getGet('client_policy_id'),status:0);
|
||||||
// $empData = $this->employeeModel->where('client_id', $this->request->getGet('client_id'))
|
|
||||||
// ->where('relationship !=', null)
|
|
||||||
|
|
||||||
if ($empData) {
|
if ($empData) {
|
||||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $empData], 200);
|
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $empData], 200);
|
||||||
|
|||||||
@ -69,7 +69,7 @@ class EmployeePolicyModel extends Model
|
|||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
public function getEmployeePolicy($client_id,$policy_id,$status)
|
public function getEmployeePolicy($client_id,$policy_id,$status)
|
||||||
{
|
{
|
||||||
$result = $this->select(['employee_polices.*','pm.name as policy_name','im.short_name as insurer_short_name','ib.branch_name as insurer_branch_name','ib.branch_code as insurer_branch_code','tpam.name as tpa_name','tpam.short_name as tpa_short_name','tpab.branch_code as tpa_branch_code','cm.client_name','cm.short_name as client_short_name','emp.relationship','emp.relationship_code','emp.change_event','emp.emp_code','emp.name','emp.email_corporate','emp.dob','emp.gender','emp.emp_status','emp.is_active as emp_is_active'])
|
$result = $this->select(['employee_polices.*','pm.name as policy_name','im.short_name as insurer_short_name','ib.branch_name as insurer_branch_name','ib.branch_code as insurer_branch_code','tpam.name as tpa_name','tpam.short_name as tpa_short_name','tpab.branch_code as tpa_branch_code','cm.client_name','cm.short_name as client_short_name','emp.relationship','emp.relationship_code','emp.change_event','emp.emp_code','emp.name','emp.email_corporate','emp.dob','emp.gender','emp.emp_status','emp.is_active as emp_is_active','emp.mobile as mobile'])
|
||||||
->join('employees emp', 'employee_polices.employee_id = emp.id')
|
->join('employees emp', 'employee_polices.employee_id = emp.id')
|
||||||
->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy
|
->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy
|
||||||
->join('policies pm', 'cp.policy_id = pm.id') //pm - policy master
|
->join('policies pm', 'cp.policy_id = pm.id') //pm - policy master
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user