CHANGE_ family floter text : GWM
This commit is contained in:
parent
11ecfce5c4
commit
5ae2fcfdc4
@ -1075,6 +1075,11 @@ public function getEmployeePolicy()
|
|||||||
|
|
||||||
// Generate Notes string based on familyFloates terms
|
// Generate Notes string based on familyFloates terms
|
||||||
$array->notes = $this->FloterNotesConvertion($familyFloates);
|
$array->notes = $this->FloterNotesConvertion($familyFloates);
|
||||||
|
|
||||||
|
if($getSlabAndGridData['slab_rates'][0]['premium_type'] == 1)
|
||||||
|
{ $array->family_floter_notes = 'For Family'; }
|
||||||
|
else{ $array->family_floter_notes = 'For Members'; }
|
||||||
|
|
||||||
// Convert familyFloaters terms data to plain array
|
// Convert familyFloaters terms data to plain array
|
||||||
$floters = $this->FloterConvertion($familyFloates);
|
$floters = $this->FloterConvertion($familyFloates);
|
||||||
|
|
||||||
@ -1514,51 +1519,55 @@ public function getCashDepositData()
|
|||||||
->findAll();
|
->findAll();
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
foreach ($ClientPolicyData as $key => $value) {
|
if(count($ClientPolicyData))
|
||||||
|
{
|
||||||
|
foreach ($ClientPolicyData as $key => $value) {
|
||||||
|
|
||||||
$data['clientId'] = $value['clientId'];
|
$data['clientId'] = $value['clientId'];
|
||||||
$data['insurerId'] = $value['insurerId'];
|
$data['insurerId'] = $value['insurerId'];
|
||||||
$data['insurerName'] = $value['insurer_name'];
|
$data['insurerName'] = $value['insurer_name'];
|
||||||
$data['depositData'] = $this->clientPolicyModel->getdepositData($value['clientId'],$value['insurerId']);
|
$data['depositData'] = $this->clientPolicyModel->getdepositData($value['clientId'],$value['insurerId']);
|
||||||
$data['balance'] = count($data['depositData']) ? $data['depositData'][0]->balance : 0;
|
$data['balance'] = count($data['depositData']) ? $data['depositData'][0]->balance : 0;
|
||||||
|
|
||||||
$data['policyDetails'] = [];
|
$data['policyDetails'] = [];
|
||||||
$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')
|
$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.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') )
|
||||||
->findAll();
|
->findAll();
|
||||||
foreach ($ClientPolicyData as $key => $value)
|
foreach ($ClientPolicyData as $key => $value)
|
||||||
{
|
|
||||||
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard( $value['client_policy_id'],$value['client_id']);
|
|
||||||
if($value['is_addon'] == "2"){ $value['type'] = 'SI TopUp'; }else if($value['is_addon'] == "3"){ $value['type'] = 'Dependent AddOn'; }else{ $value['type'] = $getSlabAndGridData['grid_master']['policy_type']; }
|
|
||||||
$employeeDetails = $this->employeePolicyModel->getEmployeePolicy( client_id:$value['client_id'],policy_id: $value['client_policy_id'],status:0);
|
|
||||||
$enrolledCount = 0;
|
|
||||||
$draftCount = 0;
|
|
||||||
if(count($employeeDetails))
|
|
||||||
{
|
{
|
||||||
foreach ($employeeDetails as $item) {
|
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard( $value['client_policy_id'],$value['client_id']);
|
||||||
if ($item['emp_status'] === 'enrolled') {
|
if($value['is_addon'] == "2"){ $value['type'] = 'SI TopUp'; }else if($value['is_addon'] == "3"){ $value['type'] = 'Dependent AddOn'; }else{ $value['type'] = $getSlabAndGridData['grid_master']['policy_type']; }
|
||||||
$enrolledCount++;
|
$employeeDetails = $this->employeePolicyModel->getEmployeePolicy( client_id:$value['client_id'],policy_id: $value['client_policy_id'],status:0);
|
||||||
} elseif ($item['emp_status'] === 'draft') {
|
$enrolledCount = 0;
|
||||||
$draftCount++;
|
$draftCount = 0;
|
||||||
|
if(count($employeeDetails))
|
||||||
|
{
|
||||||
|
foreach ($employeeDetails as $item) {
|
||||||
|
if ($item['emp_status'] === 'enrolled') {
|
||||||
|
$enrolledCount++;
|
||||||
|
} elseif ($item['emp_status'] === 'draft') {
|
||||||
|
$draftCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$value['totalMembersCount'] = count($employeeDetails);
|
||||||
|
$value['membersCountOfEnrolled'] = $enrolledCount;
|
||||||
|
$value['membersCountOfDraft'] = $draftCount;
|
||||||
|
|
||||||
|
array_push($data['policyDetails'],$value);
|
||||||
}
|
}
|
||||||
|
|
||||||
$value['totalMembersCount'] = count($employeeDetails);
|
|
||||||
$value['membersCountOfEnrolled'] = $enrolledCount;
|
|
||||||
$value['membersCountOfDraft'] = $draftCount;
|
|
||||||
|
|
||||||
array_push($data['policyDetails'],$value);
|
array_push($result,$data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
array_push($result,$data);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($result)
|
if($result)
|
||||||
{
|
{
|
||||||
return $this->respond(['status' => 'success','code' => (count($result) ? 200 : 404),'data' => $result ], 200);
|
return $this->respond(['status' => 'success','code' => (count($result) ? 200 : 404),'data' => $result ], 200);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user