Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
19c25711d2
@ -84,10 +84,12 @@ class EmployeeRestController extends AdminController
|
|||||||
try {
|
try {
|
||||||
$emp_code = $this->request->getGet('emp_code');
|
$emp_code = $this->request->getGet('emp_code');
|
||||||
$client_id = $this->request->getGet('client_id');
|
$client_id = $this->request->getGet('client_id');
|
||||||
|
$client_branch_id = $this->request->getGet('client_branch_id');
|
||||||
if ($emp_code) {
|
if ($emp_code) {
|
||||||
$relationship = 'self';
|
$relationship = 'self';
|
||||||
$employee = $this->employeeModel->where('emp_code', $emp_code)
|
$employee = $this->employeeModel->where('emp_code', $emp_code)
|
||||||
->where('client_id', $client_id)
|
->where('client_id', $client_id)
|
||||||
|
->where('client_branch_id', $client_branch_id)
|
||||||
->where('is_active', 1 )
|
->where('is_active', 1 )
|
||||||
->where('relationship', $relationship)
|
->where('relationship', $relationship)
|
||||||
->first();
|
->first();
|
||||||
@ -102,7 +104,7 @@ class EmployeeRestController extends AdminController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//not in use
|
||||||
public function editEmployeeProfile()
|
public function editEmployeeProfile()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -125,7 +127,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//not in use
|
||||||
public function getEmployeeAndDependence()
|
public function getEmployeeAndDependence()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -152,7 +154,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//not in use
|
||||||
public function editEmployeeAndDependence()
|
public function editEmployeeAndDependence()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -372,6 +374,7 @@ class EmployeeRestController extends AdminController
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteDependence()
|
public function deleteDependence()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -400,11 +403,78 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the RelationShip list
|
||||||
|
public function createOrUpdateEmployeePolicySiAmount()
|
||||||
|
{
|
||||||
|
|
||||||
|
try {
|
||||||
|
$requestData = $this->request->getJSON();
|
||||||
|
|
||||||
|
foreach ($requestData as $key => $value) {
|
||||||
|
|
||||||
|
|
||||||
|
$checkIfExist = $this->employeePolicyModel->where('employee_id', $value->employee_id)
|
||||||
|
->where('client_policy_id', $value->client_policy_id)
|
||||||
|
->where('is_active', 1 )
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
|
// dd($checkIfExist);
|
||||||
|
if ($checkIfExist) {
|
||||||
|
|
||||||
|
$empPolicy = $this->employeePolicyModel->updateSiAndPremium($value->client_policy_id, $value->employee_id, $value->basic_cover_si);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
$data['employee_id']= $value->employee_id;
|
||||||
|
$data['client_policy_id']= $value->client_policy_id;
|
||||||
|
$data['basic_cover_si']= $value->basic_cover_si;
|
||||||
|
$data['status'] = 'draft';
|
||||||
|
|
||||||
|
$this->employeePolicyModel->insert($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->updatePremiumAmount($requestData[0]->client_policy_id , $requestData[0]->emp_code);
|
||||||
|
|
||||||
|
return $this->respond(['status' => 'success','code' => 200,'data' => []], 200);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findPremiumAmount($slabArray,$siAmount)
|
||||||
|
{
|
||||||
|
foreach ($slabArray as $key => $value) {
|
||||||
|
if($value['si'] == $siAmount){
|
||||||
|
return $value['premium'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function relationshipList()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$relation_ships= $this->relationshipModel->findAll();
|
||||||
|
|
||||||
|
if(count($relation_ships) > 0){
|
||||||
|
return $this->respond(['status' => 'success','code' => 200,'data' => $relation_ships], 200);
|
||||||
|
}else{
|
||||||
|
return $this->respond(['status' => 'success','code' => 200,'data' => "No Data..!"], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getEmployeeAndDependenceByClientId()
|
public function getEmployeeAndDependenceByClientId()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$empData = $this->employeePolicyModel->getEmployeePolicy( client_id:$this->request->getGet('client_id'),policy_id: $this->request->getGet('client_policy_id'),status:0);
|
$empData = $this->employeePolicyModel->getEmployeePolicy( client_id:$this->request->getGet('client_id'),policy_id: $this->request->getGet('client_policy_id'),status:0,branch_id:$this->request->getGet('client_branch_id'));
|
||||||
|
|
||||||
if ($empData) {
|
if ($empData) {
|
||||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $empData], 200);
|
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $empData], 200);
|
||||||
@ -419,11 +489,11 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function exportDataByClientPolicyId()
|
public function exportDataByClientPolicyId()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$empData = $this->employeePolicyModel->getEmployeePolicy( client_id:$this->request->getGet('client_id'),policy_id: $this->request->getGet('client_policy_id'),status:0);
|
|
||||||
|
$empData = $this->employeePolicyModel->getEmployeePolicy( client_id:$this->request->getGet('client_id'),policy_id: $this->request->getGet('client_policy_id'),status:0,branch_id:$this->request->getGet('client_branch_id'));
|
||||||
|
|
||||||
if(count($empData))
|
if(count($empData))
|
||||||
{
|
{
|
||||||
@ -496,6 +566,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//not in use
|
||||||
public function getClientPolicy()
|
public function getClientPolicy()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -534,73 +605,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Get the RelationShip list
|
|
||||||
|
|
||||||
public function createOrUpdateEmployeePolicySiAmount()
|
|
||||||
{
|
|
||||||
|
|
||||||
try {
|
|
||||||
$requestData = $this->request->getJSON();
|
|
||||||
|
|
||||||
foreach ($requestData as $key => $value) {
|
|
||||||
|
|
||||||
|
|
||||||
$checkIfExist = $this->employeePolicyModel->where('employee_id', $value->employee_id)
|
|
||||||
->where('client_policy_id', $value->client_policy_id)
|
|
||||||
->where('is_active', 1 )
|
|
||||||
->findAll();
|
|
||||||
|
|
||||||
|
|
||||||
// dd($checkIfExist);
|
|
||||||
if ($checkIfExist) {
|
|
||||||
|
|
||||||
$empPolicy = $this->employeePolicyModel->updateSiAndPremium($value->client_policy_id, $value->employee_id, $value->basic_cover_si);
|
|
||||||
|
|
||||||
}else{
|
|
||||||
|
|
||||||
$data['employee_id']= $value->employee_id;
|
|
||||||
$data['client_policy_id']= $value->client_policy_id;
|
|
||||||
$data['basic_cover_si']= $value->basic_cover_si;
|
|
||||||
$data['status'] = 'draft';
|
|
||||||
|
|
||||||
$this->employeePolicyModel->insert($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->updatePremiumAmount($requestData[0]->client_policy_id , $requestData[0]->emp_code);
|
|
||||||
|
|
||||||
return $this->respond(['status' => 'success','code' => 200,'data' => []], 200);
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function findPremiumAmount($slabArray,$siAmount)
|
|
||||||
{
|
|
||||||
foreach ($slabArray as $key => $value) {
|
|
||||||
if($value['si'] == $siAmount){
|
|
||||||
return $value['premium'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public function relationshipList()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
$relation_ships= $this->relationshipModel->findAll();
|
|
||||||
|
|
||||||
if(count($relation_ships) > 0){
|
|
||||||
return $this->respond(['status' => 'success','code' => 200,'data' => $relation_ships], 200);
|
|
||||||
}else{
|
|
||||||
return $this->respond(['status' => 'success','code' => 200,'data' => "No Data..!"], 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Upload the Employee Detail in DB by Sheet Data
|
// Upload the Employee Detail in DB by Sheet Data
|
||||||
public function employeeUpload()
|
public function employeeUpload()
|
||||||
@ -614,6 +619,7 @@ class EmployeeRestController extends AdminController
|
|||||||
// die;
|
// die;
|
||||||
$file = $this->request->getFile('file');
|
$file = $this->request->getFile('file');
|
||||||
$client_id = $this->request->getPost('client_id');
|
$client_id = $this->request->getPost('client_id');
|
||||||
|
$client_branch_id = $this->request->getPost('client_branch_id');
|
||||||
$policy_id = $this->request->getPost('policy_id');
|
$policy_id = $this->request->getPost('policy_id');
|
||||||
|
|
||||||
$client_data = $this->clientModel->where('id', $client_id)->first();
|
$client_data = $this->clientModel->where('id', $client_id)->first();
|
||||||
@ -632,7 +638,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$client_policy = $this->clientPolicyModel->where('id', $policy_id)->where('client_id', $client_id)->first();
|
$client_policy = $this->clientPolicyModel->where('id', $policy_id)->where('client_id', $client_id)->where('client_branch_id', $client_branch_id)->first();
|
||||||
if ($client_policy) {
|
if ($client_policy) {
|
||||||
$policy = $this->policesModel->where('id', $client_policy['policy_id'])->first();
|
$policy = $this->policesModel->where('id', $client_policy['policy_id'])->first();
|
||||||
$policy_permium_1 = $this->policyPremium1Model->where(['client_id' => $client_id , 'client_policy_id' => $policy_id,'is_active' =>1])-> first();
|
$policy_permium_1 = $this->policyPremium1Model->where(['client_id' => $client_id , 'client_policy_id' => $policy_id,'is_active' =>1])-> first();
|
||||||
@ -666,6 +672,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
$extractData['file_name']= $filename;
|
$extractData['file_name']= $filename;
|
||||||
$extractData['client_id']= $client_id;
|
$extractData['client_id']= $client_id;
|
||||||
|
$extractData['client_branch_id']= $client_branch_id;
|
||||||
$extractData['status']= 'success';
|
$extractData['status']= 'success';
|
||||||
$extractData['policy_id']= $policy_id;
|
$extractData['policy_id']= $policy_id;
|
||||||
$extractData['action']= 'enrollment';
|
$extractData['action']= 'enrollment';
|
||||||
@ -772,6 +779,7 @@ class EmployeeRestController extends AdminController
|
|||||||
'client_id' => $client_id,
|
'client_id' => $client_id,
|
||||||
'emp_status'=>'draft',
|
'emp_status'=>'draft',
|
||||||
'band'=> $extra['10'][$index],
|
'band'=> $extra['10'][$index],
|
||||||
|
'client_branch_id' => $client_branch_id
|
||||||
|
|
||||||
];
|
];
|
||||||
$basic_cover_si_value = null;
|
$basic_cover_si_value = null;
|
||||||
@ -928,13 +936,15 @@ public function getAgeRange($terms,$familyFloatesValue)
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEmployeePolicy()
|
public function getEmployeePolicy()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$id = $this->request->getGet('id');
|
$id = $this->request->getGet('id');
|
||||||
$emp_code = $this->request->getGet('emp_code');
|
$emp_code = $this->request->getGet('emp_code');
|
||||||
$client_id = $this->request->getGet('client_id');
|
$client_id = $this->request->getGet('client_id');
|
||||||
|
$client_branch_id = $this->request->getGet('client_branch_id');
|
||||||
|
|
||||||
// This is an array containing keys to be removed from the terms and conditions array
|
// This is an array containing keys to be removed from the terms and conditions array
|
||||||
$keysToRemove = ["removable_keys"];
|
$keysToRemove = ["removable_keys"];
|
||||||
@ -942,8 +952,11 @@ public function getEmployeePolicy()
|
|||||||
$empPolicy = $this->employeeModel->getEmployeePolicy($id);
|
$empPolicy = $this->employeeModel->getEmployeePolicy($id);
|
||||||
|
|
||||||
// Retrieve employee and dependents data by passing the employee code
|
// Retrieve employee and dependents data by passing the employee code
|
||||||
$employeeData = $this->employeeModel->where('emp_code',$emp_code)->where('client_id',$client_id)
|
$employeeData = $this->employeeModel->where('emp_code',$emp_code)
|
||||||
->where('is_active', 1 )->where('is_addon_value',0)->findAll();
|
->where('client_id',$client_id)
|
||||||
|
->where('client_branch_id',$client_branch_id)
|
||||||
|
->where('is_active', 1 )
|
||||||
|
->where('is_addon_value',0)->findAll();
|
||||||
|
|
||||||
|
|
||||||
if ($empPolicy) {
|
if ($empPolicy) {
|
||||||
@ -1091,12 +1104,13 @@ public function getEmployeePolicy()
|
|||||||
->where('client_policy.policy_type_id', 3 )
|
->where('client_policy.policy_type_id', 3 )
|
||||||
->where('client_policy.is_addon', 1 )
|
->where('client_policy.is_addon', 1 )
|
||||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
||||||
|
->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id') )
|
||||||
->where('client_policy.is_active', 1 )
|
->where('client_policy.is_active', 1 )
|
||||||
->get()
|
->get()
|
||||||
->getResult();
|
->getResult();
|
||||||
if($checkGmcParentsPolicyExist)
|
if($checkGmcParentsPolicyExist)
|
||||||
{
|
{
|
||||||
$GmcParrentsData = $this->getGmcParrentsPolicy($checkGmcParentsPolicyExist,$emp_code,$client_id);
|
$GmcParrentsData = $this->getGmcParrentsPolicy($checkGmcParentsPolicyExist,$emp_code,$client_id,$client_branch_id);
|
||||||
return $this->respond(['status' => 'success','code' => 200,'data' => [$array,$GmcParrentsData]], 200);
|
return $this->respond(['status' => 'success','code' => 200,'data' => [$array,$GmcParrentsData]], 200);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1122,11 +1136,14 @@ public function getEmployeePolicy()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id)
|
public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id,$client_branch_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$employeeData = $this->employeeModel->where('emp_code',$emp_code)->where('client_id',$client_id)
|
$employeeData = $this->employeeModel->where('emp_code',$emp_code)
|
||||||
->where('is_active', 1 )->where('is_addon_value',0)->findAll();
|
->where('client_id',$client_id)
|
||||||
|
->where('client_branch_id',$client_branch_id)
|
||||||
|
->where('is_active', 1 )
|
||||||
|
->where('is_addon_value',0)->findAll();
|
||||||
foreach ($GmcParrentsPolicy as $key => $array) {
|
foreach ($GmcParrentsPolicy as $key => $array) {
|
||||||
|
|
||||||
|
|
||||||
@ -1163,9 +1180,7 @@ public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id)
|
|||||||
$array->eCardDownload = null;
|
$array->eCardDownload = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if($array->tpa_id != null){
|
|
||||||
// $array->eCardDownload = base_url('download-e-card/') . $array->rand_string;
|
|
||||||
// }else{ $array->eCardDownload = null; }
|
|
||||||
$array->eCardDownload = null;
|
$array->eCardDownload = null;
|
||||||
|
|
||||||
// Map family floaters that already exist in the employee table
|
// Map family floaters that already exist in the employee table
|
||||||
@ -1256,6 +1271,7 @@ public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function FloterConvertion($array){
|
public function FloterConvertion($array){
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
@ -1320,7 +1336,8 @@ public function getClientDetails()
|
|||||||
$client = $this->clientModel->where('id',$this->request->getGet('client_id'))->first();
|
$client = $this->clientModel->where('id',$this->request->getGet('client_id'))->first();
|
||||||
if($client) {
|
if($client) {
|
||||||
$client['client_logo'] = base_url().'public/uploads/logo/'.$client['client_logo'];
|
$client['client_logo'] = base_url().'public/uploads/logo/'.$client['client_logo'];
|
||||||
$clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))->findAll();
|
$clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))
|
||||||
|
->where('client_branch_id',$this->request->getGet('client_branch_id'))->findAll();
|
||||||
return $this->respond(['status' => 'success','code' => 200,'data' => ['client'=>$client,'client_policy'=>$clientPolicy]], 200);
|
return $this->respond(['status' => 'success','code' => 200,'data' => ['client'=>$client,'client_policy'=>$clientPolicy]], 200);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@ -1335,17 +1352,22 @@ public function getAddOnPolicy()
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$addOnEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('client_id',$this->request->getGet('client_id'))->where('is_addon_value',1)->findAll();
|
$addOnEmployeeData = $this->employeeModel->where('is_active', 1 )
|
||||||
|
->where('emp_code',$this->request->getGet('emp_code'))
|
||||||
|
->where('client_id',$this->request->getGet('client_id'))
|
||||||
|
->where('client_branch_id',$this->request->getGet('client_branch_id'))
|
||||||
|
->where('is_addon_value',1)->findAll();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))
|
$clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))
|
||||||
|
->where('client_branch_id',$this->request->getGet('client_branch_id'))
|
||||||
->where('policy_status', 1)
|
->where('policy_status', 1)
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
if(count($clientPolicy))
|
if(count($clientPolicy))
|
||||||
{
|
{
|
||||||
$band = $addOnEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('client_id',$this->request->getGet('client_id'))->where('family_floater_key','self')->get()->getRow()->band;
|
$band = $addOnEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('client_id',$this->request->getGet('client_id'))->where('client_branch_id',$this->request->getGet('client_branch_id'))->where('family_floater_key','self')->get()->getRow()->band;
|
||||||
$PolicyData = [];
|
$PolicyData = [];
|
||||||
foreach ($clientPolicy as $key => $array) {
|
foreach ($clientPolicy as $key => $array) {
|
||||||
$responce = [];
|
$responce = [];
|
||||||
@ -1768,6 +1790,7 @@ public function getCashDepositData()
|
|||||||
$ClientPolicyData = $this->clientPolicyModel->select('client_policy.client_id as clientId , client_policy.insurer_id as insurerId,insurers.name as insurer_name')
|
$ClientPolicyData = $this->clientPolicyModel->select('client_policy.client_id as clientId , client_policy.insurer_id as insurerId,insurers.name as insurer_name')
|
||||||
->join('insurers', 'client_policy.insurer_id = insurers.id', 'left')
|
->join('insurers', 'client_policy.insurer_id = insurers.id', 'left')
|
||||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
||||||
|
->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id') )
|
||||||
->where('client_policy.is_active', 1 )
|
->where('client_policy.is_active', 1 )
|
||||||
->where('client_policy.policy_status', 1)
|
->where('client_policy.policy_status', 1)
|
||||||
->groupBy('client_policy.insurer_id')
|
->groupBy('client_policy.insurer_id')
|
||||||
@ -1789,6 +1812,7 @@ public function getCashDepositData()
|
|||||||
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
||||||
->where('client_policy.insurer_id', $value['insurerId'] )
|
->where('client_policy.insurer_id', $value['insurerId'] )
|
||||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
||||||
|
->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id') )
|
||||||
->where('client_policy.is_active', 1 )
|
->where('client_policy.is_active', 1 )
|
||||||
->where('client_policy.policy_status', 1)
|
->where('client_policy.policy_status', 1)
|
||||||
->findAll();
|
->findAll();
|
||||||
@ -1797,7 +1821,7 @@ public function getCashDepositData()
|
|||||||
{
|
{
|
||||||
|
|
||||||
$value['type'] = $this->policyTypeModel->where('id',$value['policy_type_id'])->get()->getRow()->policy_type;
|
$value['type'] = $this->policyTypeModel->where('id',$value['policy_type_id'])->get()->getRow()->policy_type;
|
||||||
$employeeDetails = $this->employeePolicyModel->getEmployeePolicy( client_id:$value['client_id'],policy_id: $value['client_policy_id'],status:0);
|
$employeeDetails = $this->employeePolicyModel->getEmployeePolicy( client_id:$value['client_id'],policy_id: $value['client_policy_id'],status:0,branch_id:$this->request->getGet('client_branch_id'));
|
||||||
$enrolledCount = 0;
|
$enrolledCount = 0;
|
||||||
$draftCount = 0;
|
$draftCount = 0;
|
||||||
if(count($employeeDetails))
|
if(count($employeeDetails))
|
||||||
@ -1970,83 +1994,6 @@ public function removeEmpAndEmpPolicyData()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getEmployeeOldPolicy()
|
|
||||||
{
|
|
||||||
$ClientPolicyData = $this->clientPolicyModel->select('client_policy.* , policies.name as policy_name , policy_type.policy_type as policy_type')
|
|
||||||
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
|
||||||
->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left')
|
|
||||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
|
||||||
->where('client_policy.is_active', 1 )
|
|
||||||
->where('client_policy.policy_status', 0)
|
|
||||||
->orderby('client_policy.id' , 'ASC')
|
|
||||||
->findAll();
|
|
||||||
|
|
||||||
// Retrieve employee and dependents data by passing the employee code
|
|
||||||
$employeeData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
|
|
||||||
->where('client_id',$this->request->getGet('client_id'))
|
|
||||||
->where('is_active', 1 )->findAll();
|
|
||||||
$whereArrayForId = [];
|
|
||||||
foreach ( $employeeData as $key => $value) { array_push($whereArrayForId, $value['id']); }
|
|
||||||
|
|
||||||
if(count($ClientPolicyData) > 0 && count($employeeData) > 0)
|
|
||||||
{
|
|
||||||
$result = [];
|
|
||||||
foreach ($ClientPolicyData as $key => $ClientPolicyValue) {
|
|
||||||
|
|
||||||
$terms = json_decode($ClientPolicyValue['policy_terms']);
|
|
||||||
// dd($terms);
|
|
||||||
$data['client_id'] = $ClientPolicyValue['client_id'];
|
|
||||||
$data['client_policy_id'] = $ClientPolicyValue['id'];
|
|
||||||
$data['policy_name'] = $ClientPolicyValue['policy_name'];
|
|
||||||
$data['policy_type'] = $ClientPolicyValue['policy_type'];
|
|
||||||
$data['policy_type'] = $ClientPolicyValue['policy_type'];
|
|
||||||
$data['policy_start_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['policy_start_date']);
|
|
||||||
$data['policy_end_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['policy_end_date']);
|
|
||||||
|
|
||||||
if($ClientPolicyValue['policy_type_id'] == 1){ $data['heading'] = 'Group Personal Accident Coverage'; }else
|
|
||||||
if($ClientPolicyValue['policy_type_id'] == 2){ $data['heading'] = 'Group Medical Coverage'; }else
|
|
||||||
if($ClientPolicyValue['policy_type_id'] == 3){ $data['heading'] = 'Group Medical Coverage - Parents'; }else
|
|
||||||
if($ClientPolicyValue['policy_type_id'] == 4){ $data['heading'] = 'Group Medical Coverage - Top Up'; }else
|
|
||||||
if($ClientPolicyValue['policy_type_id'] == 5){ $data['heading'] = 'Group Medical Coverage - Parents (Top Up)'; }
|
|
||||||
|
|
||||||
if($ClientPolicyValue['policy_type_id'] == 1){ $data['floter_text_heading'] = 'Sum Insured'; }
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if($terms->family_floater == 1){ $data['floter_text_heading'] = 'Floter Sum Insured'; }else{ $data['floter_text_heading'] = 'Sum Insured'; }
|
|
||||||
}
|
|
||||||
|
|
||||||
$employee_policy = $this->employeePolicyModel->select('employees.*,employee_polices.employee_id , employee_polices.basic_cover_si , employee_polices.premium , employee_polices.gst , employee_polices.tpa_id , employee_polices.rand_string')
|
|
||||||
->join('employees', 'employee_polices.employee_id = employees.id', 'left')
|
|
||||||
->whereIn('employee_polices.employee_id',$whereArrayForId)
|
|
||||||
->where('employee_polices.client_policy_id',$ClientPolicyValue['id'])
|
|
||||||
->where('employee_polices.is_active', 1 )->findAll();
|
|
||||||
$si_value = 0;
|
|
||||||
$si_premium_value = 0;
|
|
||||||
$si_gst_value = 0;
|
|
||||||
foreach ($employee_policy as $key => $value) {
|
|
||||||
if(isset($value['basic_cover_si'])){ $si_value = $value['basic_cover_si']; }
|
|
||||||
if(isset($value['premium'])){ $si_premium_value = $si_premium_value + $value['premium'];}
|
|
||||||
if(isset($value['gst'])){ $si_gst_value = $si_gst_value + $value['gst'];}
|
|
||||||
}
|
|
||||||
|
|
||||||
$data['si_value'] = $si_value;
|
|
||||||
$data['si_premium_value'] = ($ClientPolicyValue['policy_type_id'] == 1 || $ClientPolicyValue['policy_type_id'] == 2) ? 0 : $si_premium_value;
|
|
||||||
$data['si_gst_value'] = ($ClientPolicyValue['policy_type_id'] == 1 || $ClientPolicyValue['policy_type_id'] == 2) ? 0 : $si_gst_value;
|
|
||||||
|
|
||||||
$data['EmployeePolicy'] = $employee_policy;
|
|
||||||
array_push($result, $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result ], 200);
|
|
||||||
|
|
||||||
}else{
|
|
||||||
return $this->respond(['status' => 'failed','code' => 404,'data' => [] ], 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function getEmployeeActiveOrInactivePolicy()
|
function getEmployeeActiveOrInactivePolicy()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -2055,6 +2002,7 @@ function getEmployeeActiveOrInactivePolicy()
|
|||||||
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
||||||
->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left')
|
->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left')
|
||||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
||||||
|
->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id') )
|
||||||
->where('client_policy.is_active', 1 )
|
->where('client_policy.is_active', 1 )
|
||||||
->where('client_policy.policy_status', $policy_status)
|
->where('client_policy.policy_status', $policy_status)
|
||||||
->orderby('client_policy.id' , 'ASC')
|
->orderby('client_policy.id' , 'ASC')
|
||||||
@ -2063,9 +2011,11 @@ function getEmployeeActiveOrInactivePolicy()
|
|||||||
// Retrieve employee and dependents data by passing the employee code
|
// Retrieve employee and dependents data by passing the employee code
|
||||||
$employeeData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
|
$employeeData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
|
||||||
->where('client_id',$this->request->getGet('client_id'))
|
->where('client_id',$this->request->getGet('client_id'))
|
||||||
|
->where('client_branch_id',$this->request->getGet('client_branch_id'))
|
||||||
->where('is_active', 1 )->findAll();
|
->where('is_active', 1 )->findAll();
|
||||||
$employeeName = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
|
$employeeName = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
|
||||||
->where('client_id',$this->request->getGet('client_id'))
|
->where('client_id',$this->request->getGet('client_id'))
|
||||||
|
->where('client_branch_id',$this->request->getGet('client_branch_id'))
|
||||||
->where('family_floater_key','self')->where('is_active', 1 )
|
->where('family_floater_key','self')->where('is_active', 1 )
|
||||||
->get()->getRow()->name;
|
->get()->getRow()->name;
|
||||||
$whereArrayForId = [];
|
$whereArrayForId = [];
|
||||||
|
|||||||
@ -101,7 +101,7 @@ class RestAuthenticationController extends AdminController
|
|||||||
$auth = HttpRequestHelper::getRequestInfo();
|
$auth = HttpRequestHelper::getRequestInfo();
|
||||||
if ($auth) {
|
if ($auth) {
|
||||||
$data = [
|
$data = [
|
||||||
'user_id' => $employeeData['id'],
|
'user_id' => $employeeData['id'],
|
||||||
'user_type' => 'employee',
|
'user_type' => 'employee',
|
||||||
'ip' => $auth['ip'],
|
'ip' => $auth['ip'],
|
||||||
'platform' => $auth['platform'],
|
'platform' => $auth['platform'],
|
||||||
|
|||||||
@ -590,7 +590,7 @@
|
|||||||
$parsedUrl = parse_url($currentUrl);
|
$parsedUrl = parse_url($currentUrl);
|
||||||
$baseUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . '/';
|
$baseUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . '/';
|
||||||
$hashedEmail = hash('sha256', $sessionData->email);
|
$hashedEmail = hash('sha256', $sessionData->email);
|
||||||
$redirectUrl = $baseUrl . getenv('hepldeskURL') .'/staff/login?' . http_build_query(['token' => $hashedEmail]);
|
$redirectUrl = getenv('helpdeskURL') .'/staff/login?' . http_build_query(['token' => $hashedEmail]);
|
||||||
?>
|
?>
|
||||||
<a href="<?php echo $redirectUrl; ?>" target="_blank">
|
<a href="<?php echo $redirectUrl; ?>" target="_blank">
|
||||||
<i class="mdi mdi-lifebuoy"></i>
|
<i class="mdi mdi-lifebuoy"></i>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user