MERGE_ISSUES

This commit is contained in:
velz 2024-04-27 16:02:47 +05:30
commit 22e061ef19
4 changed files with 42 additions and 9 deletions

View File

@ -69,9 +69,11 @@ class EmployeeRestController extends AdminController
{
try {
$emp_code = $this->request->getGet('emp_code');
$client_id = $this->request->getGet('client_id');
if ($emp_code) {
$relationship = 'self';
$employee = $this->employeeModel->where('emp_code', $emp_code)
->where('client_id', $client_id)
->where('is_active', 1 )
->where('relationship', $relationship)
->first();
@ -211,7 +213,7 @@ class EmployeeRestController extends AdminController
{
$this->createEmployeePolicyData($employee , $data[0]->emp_code , $data[0]->client_id , $data[0]->client_policy_id);
}else{
$this->createEmployeePolicyData($employee , $data[0]->emp_code , $data[0]->client_id , $data[0]->client_policy_id , $data[0]->basic_cover_si);
$this->createEmployeePolicyData($data[0]->id , $data[0]->emp_code , $data[0]->client_id , $data[0]->client_policy_id , $data[0]->basic_cover_si);
}
@ -1446,11 +1448,14 @@ public function getAddOnPolicy()
public function iAgreeForAddOn()
{
$emp_code = $this->request->getPost('emp_code');
$postData = json_decode($this->request->getBody(), true);
$client_policy_id = $postData['client_policy_id'];
$emp_code = $postData['emp_code'];
$client_id = $postData['client_id'];
$this->employeeModel->where('emp_code', $emp_code )
->where('client_id', $client_id )
->where('is_active', 1 )
->set(array('emp_status'=>'enrolled'))
->update();

View File

@ -321,6 +321,7 @@ class EmployeeServiceController extends AdminController
// get policy and rack details
$policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
$policy_details = (array)$policy_terms[0];
// dd($this->clientPolicyModel->getLastQuery());
$policy_terms = json_decode($policy_terms[0]->policy_terms);
$policy_terms = (array) $policy_terms;// convert obj to array
@ -373,7 +374,7 @@ class EmployeeServiceController extends AdminController
}
}
if($file['action'] == 'inception')
if(($file['action'] == 'inception' || $file['action'] == 'addition') && ($policy_details['is_addon'] != 3)) // 3 is depent addon
{
$res = check_self_available_in_family($family,$file['action']);
// dd($res);

View File

@ -571,7 +571,8 @@ if (!function_exists('calculate_premimum'))
$transformed_familiy_member_data['temp']['band'] = $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['band'];
$transformed_familiy_member_data['temp']['maxage'] = $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['maxage'];
$transformed_familiy_member_data['temp']['maxcount'] = $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['maxcount'];
$transformed_familiy_member_data['policy_details']['basic_cover_si'] = $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['si'];
$transformed_familiy_member_data['policy_details']['basic_cover_si'] = isset($emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['si']) ? $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['si'] : $transformed_familiy_member_data['policy_details']['basic_cover_si'];
if( $fileArr['id'] == null || (in_array($grid_type,[10,11]) || $transformed_familiy_member_data['temp']['source'] == 'excel'))//if file id is null then data coming from enrollment (from DB) otherwise data coming from xcel, so calculate only data from excel (new entry) note: even data coming from excel for event dependet additon we fetch other dependts from db and calculate premium for whole family
{

View File

@ -434,11 +434,19 @@
}
} else if ($policy_type_value == 2) {
if (item.policy_type_id == 4) {
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
item.id +
'">' + item.name + '</option>';
}
} else if ($policy_type_value == 1) {
if (item.policy_type_id == 1 || item.policy_type_id == 2) {
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
item.id +
'">' + item.name + '</option>';
}
} else {
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
item.id +
'">' + item.name + '</option>';
@ -544,6 +552,14 @@
$('#base_policy').prop('required', false);
}
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
$('#insurer').prop('disabled', true);
$('#tpa').prop('disabled', true);
} else {
$('#insurer').prop('disabled', false);
$('#tpa').prop('disabled', false);
}
var policeOptionHTML = '';
$.each(res.policy, function(index, item) {
policeOptionHTML += '<option data-id="' + item.policy_type_id +
@ -572,7 +588,7 @@
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
toastr.warning('Something Wrong!', 'warning');
console.log('Something Wrong!', 'warning');
}, 1000);
}
});
@ -1025,10 +1041,20 @@
$('#tpa').val('').change();
$('#start_date').val('');
$('#end_date').val('');
$('#base_policy').val('0');
$('#base_policy').val('').change();
if ($(this).val() == 2 || $(this).val() == 3) {
$('#insurer').prop('disabled', true);
$('#tpa').prop('disabled', true);
} else {
$('#insurer').prop('disabled', false);
$('#tpa').prop('disabled', false);
}
if ($(this).val() == 3) {
toastr.warning('Please Change the Policy Terms after Submit the Policy!', 'warning');
toastr.warning('Please Change the Policy Terms after Submit the Policy!', 'INFO');
}
if ($(this).val() != '1' && $(this).val() != '0') {
@ -1091,7 +1117,7 @@
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
toastr.warning('Something Wrong!', 'warning');
console.log('Something Wrong!', 'warning');
}, 1000);
}
});
@ -1166,7 +1192,7 @@
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
toastr.warning('Something Wrong!', 'warning');
console.log('Something Wrong!', 'warning');
}, 500);
}
});