CHANGE_addKeyGstInTopupPolicyAPI:GWM

This commit is contained in:
bitbucket 2024-04-18 10:13:29 +05:30
parent 7ac19945b4
commit c671a10149

View File

@ -280,7 +280,7 @@ class EmployeeRestController extends AdminController
->where('client_policy_id',$value['policy_details']['client_policy_id'] )
->where('employee_id' , $value['temp']['emp_id'] )
->where('is_active', 1 )
->set(array('premium'=> $value['policy_details']['premium'] ))
->set(array('premium'=> $value['policy_details']['rata_premimum'] , 'gst'=> $value['policy_details']['gst'] ))
->update();
}
@ -1183,8 +1183,9 @@ public function getAddOnPolicy()
$data = [];
$dependent_and_si_value = null;
$dependent_and_si_premium_value = null;
$dependent_and_si_value = 0;
$dependent_and_si_premium_value = 0;
$dependent_and_si_gst_value = 0;
foreach ($floters as $familyFloatesValue) {
$dependent = preg_replace('/\d/', '', $familyFloatesValue);
if(count($addOnEmployeeData)){
@ -1192,7 +1193,8 @@ public function getAddOnPolicy()
if ($value['family_floater_key'] === $dependent) {
$employee_policy = $this->employeePolicyModel->where('employee_id',$value['id'])->where('client_policy_id',$array['id'])->where('is_active', 1 )->get()->getRow();
if(isset($employee_policy->basic_cover_si)){ $dependent_and_si_value = $employee_policy->basic_cover_si; }
if(isset($employee_policy->premium)){ $dependent_and_si_premium_value = $employee_policy->premium;}
if(isset($employee_policy->premium)){ $dependent_and_si_premium_value = $dependent_and_si_premium_value + $employee_policy->premium;}
if(isset($employee_policy->gst)){ $dependent_and_si_gst_value = $dependent_and_si_gst_value + $employee_policy->gst;}
$temp['is_value_exist'] = true;
$temp['data']['family_floater_key'] = $familyFloatesValue;
@ -1269,6 +1271,7 @@ public function getAddOnPolicy()
$responce['family_floaters_of_dependent_and_si_array'] = $data;
$responce['family_floaters_of_dependent_and_si_value'] = $dependent_and_si_value;
$responce['family_floaters_of_dependent_and_si_premium_value'] = $dependent_and_si_premium_value;
$responce['family_floaters_of_dependent_and_gst_value'] = $dependent_and_si_gst_value;
@ -1283,13 +1286,15 @@ public function getAddOnPolicy()
$only_si_array = [];
$only_si_value = null;
$only_si_premium_value = null;
$only_si_value = 0;
$only_si_premium_value = 0;
$only_si_gst_value = 0;
foreach ($GMCEmployeeData as $key => $value) {
$employee_policy = $this->employeePolicyModel->where('employee_id',$value['id'])->where('client_policy_id',$array['id'])->where('is_active', 1 )->get()->getRow();
if(isset($employee_policy->basic_cover_si)){ $only_si_value = $employee_policy->basic_cover_si; }
if(isset($employee_policy->premium)){ $only_si_premium_value = $employee_policy->premium;}
if(isset($employee_policy->premium)){ $only_si_premium_value = $only_si_premium_value + $employee_policy->premium;}
if(isset($employee_policy->gst)){ $only_si_gst_value = $only_si_gst_value + $employee_policy->gst;}
$temp3['is_value_exist'] = true;
$temp3['data']['employee_id'] = $value['id'];
$temp3['data']['relationship'] = $value['relationship'];
@ -1305,6 +1310,7 @@ public function getAddOnPolicy()
$responce['family_floaters_of_only_si_array'] = $only_si_array;
$responce['family_floaters_of_only_si_value'] = $only_si_value;
$responce['family_floaters_of_only_si_premium_value'] = $only_si_premium_value;
$responce['family_floaters_of_only_si_gst_value'] = $only_si_gst_value;
if($this->request->getGet('policy') == 'GMC-SI-TOPUP'){
return $this->respond(['status' => 'success','code' => 200,'data' => ['gmc_si_topup'=>$responce]], 200);