CHNAGE_IS_PAY_BY_EMP_IN_WEB : RV
This commit is contained in:
parent
6de3f15a59
commit
ca74a7b36e
@ -444,6 +444,7 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) {
|
||||
|
||||
$routes->post("employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
|
||||
$routes->post("employeeRest/updateMpin", "RestAuthenticationController::updateMpin");
|
||||
$routes->post("calculatePremium", "EmployeeRestController::calculatePremium");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -44,6 +44,7 @@ use App\Models\SIMappingModel;
|
||||
|
||||
use App\Controllers\EmpDataServiceController;
|
||||
use App\Controllers\GoogleDriveController;
|
||||
use App\Controllers\EmployeeRestController;
|
||||
|
||||
use App\Helpers\sendMailNotification;
|
||||
|
||||
@ -4567,6 +4568,10 @@ class ClientController extends AdminController
|
||||
// $empmodel = new EmployeeModel();
|
||||
// $data = $empmodel->getEmployeePolicy(348);
|
||||
// dd($data);
|
||||
|
||||
|
||||
// $empRest = new EmployeeRestController();
|
||||
// $empRest->calculatePremium(393, 'ARCPO7010', 500000, 27);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -2228,12 +2228,14 @@ class EmployeeRestController extends AdminController
|
||||
helper('excel_util_helper');
|
||||
|
||||
if($this->request){ //
|
||||
echo 'request';
|
||||
$client_policy_id = $this->request->getVar('client_policy_id') ?? $clientPolicyId;
|
||||
$emp_code = $this->request->getVar('emp_code') ?? $empCode;
|
||||
$default_si = $this->request->getVar('si') ?? $default_si;// si amt which choosed in add on policy
|
||||
$client_branch_id = $this->request->getVar('client_branch_id') ?? $client_branch_id;
|
||||
}else{
|
||||
//Cli and enrollment
|
||||
echo 'internal';
|
||||
$client_policy_id = $clientPolicyId;
|
||||
$emp_code = $empCode;
|
||||
$default_si = $default_si;// si amt which choosed in add on policy
|
||||
@ -2295,6 +2297,42 @@ class EmployeeRestController extends AdminController
|
||||
|
||||
$employee_data_group_by_family[$emp_id] = $data;
|
||||
}
|
||||
|
||||
if($this->request){
|
||||
if(isset($policy_terms['policy_terms'])){
|
||||
$policyTermsJson = json_decode($policy_terms['policy_terms'], true);
|
||||
// print_r($employee_data_group_by_family);die();
|
||||
|
||||
foreach ($employee_data_group_by_family[$emp_code] as $key => &$value) {
|
||||
|
||||
if(strtolower($value['relationship']) == 'self' && $policyTermsJson['is_payable_employee']['self'] == 0){
|
||||
$value['policy_details']['rata_premimum'] = 0;
|
||||
$value['policy_details']['premium'] = 0;
|
||||
$value['policy_details']['gst'] = 0;
|
||||
}
|
||||
|
||||
if(strtolower($value['relationship']) == 'spouse' && $policyTermsJson['is_payable_employee']['spouse'] == 0){
|
||||
$value['policy_details']['rata_premimum'] = 0;
|
||||
$value['policy_details']['premium'] = 0;
|
||||
$value['policy_details']['gst'] = 0;
|
||||
}
|
||||
|
||||
if((strtolower($value['relationship']) == 'son' || strtolower($value['relationship']) == 'daughter') && $policyTermsJson['is_payable_employee']['childern'] == 0){
|
||||
$value['policy_details']['rata_premimum'] = 0;
|
||||
$value['policy_details']['premium'] = 0;
|
||||
$value['policy_details']['gst'] = 0;
|
||||
}
|
||||
|
||||
if((strtolower($value['relationship']) == 'father in law' || strtolower($value['relationship']) == 'mother in law' || strtolower($value['relationship']) == 'father' || strtolower($value['relationship']) == 'mother' ) && $policyTermsJson['is_payable_employee']['elders'] == 0){
|
||||
$value['policy_details']['rata_premimum'] = 0;
|
||||
$value['policy_details']['premium'] = 0;
|
||||
$value['policy_details']['gst'] = 0;
|
||||
}
|
||||
|
||||
}
|
||||
unset($value);
|
||||
}
|
||||
}
|
||||
|
||||
if($clientPolicyId != null && $empCode != null)
|
||||
{ // dd ($employee_data_group_by_family);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user