CHANGE_POLICY_TERMS_NEW_PAYABLE_EMP_THROW_THE_EMP_INSERT_PROCESS_AND_OTHERS : RV

This commit is contained in:
VENKATESHWARAN 2024-12-11 08:50:51 +05:30
parent f9eee7c9ac
commit 885e396e00
13 changed files with 812 additions and 176 deletions

View File

@ -27,6 +27,7 @@ $routes->get("sendCroneRemainderMail", "DashboardController::sendCroneRemainderM
$routes->get("sendextraparam", "ClientController::sendextraparam");
// $routes->post("iAgreeForAddOn", "EmployeeRestController::iAgreeForAddOn");
// $routes->get("sendCroneRemainderMail", "DashboardController::sendCroneRemainderMail");
// $routes->post("employeeUpload", "EmployeeRestController::employeeUpload");
$routes->post("add_advertise_image", "AppContentManagementController::add_advertise_image");
$routes->get("add_image_index", "AppContentManagementController::add_image_index");
@ -135,6 +136,11 @@ $routes->group("/client", ["filter" => "authMVC"], function ($routes) {
$routes->get("list/(:any)", "ClientController::listVehicleFiles/$1");
$routes->get("delete/(:any)", "ClientController::deleteVehicleFiles/$1");
});
$routes->group("others", ["filter" => "authMVC"], function ($routes) {
$routes->post("create", "ClientController::createOtherTabContent");
});
});
$routes->group("/employee", ["filter" => "authMVC"], function ($routes) {

View File

@ -181,7 +181,7 @@ class ClientController extends AdminController
print_rr($attachments);
}
public function testingForReviewMail($client_id = 77, $emp_code = 'EMP001-K1', $mail_active = 1) //this function for only tsesting some logics not use for business logic
public function testingForReviewMail($client_id = 77, $emp_code = 'EMP001-K1', $mail_active = 0) //this function for only tsesting some logics not use for business logic
{
$client_policy_ids = $this->employeeModel
@ -315,6 +315,8 @@ class ClientController extends AdminController
// return $this->respond(['status' => 'success','code' => 200,'data' => [] ], 200);
}
//--------------------------------------------------------------------------------------------------------
public function index()
{
$this->myLogger->logme('error', 'Client list function called');
@ -2079,6 +2081,11 @@ class ClientController extends AdminController
$data['age_ratio']['elders']['min'] = $this->request->getPost("other_member_min_age") ? $this->request->getPost("other_member_min_age") : 0;
$data['age_ratio']['elders']['max'] = $this->request->getPost("other_member_max_age") ? $this->request->getPost("other_member_max_age") : 0;
$data['is_payable_employee']['self'] = $this->request->getPost("is_payable_employee_for_self") ? 1 : 0;
$data['is_payable_employee']['spouse'] = $this->request->getPost("is_payable_employee_for_spouse") ? 1 : 0;
$data['is_payable_employee']['childern'] = $this->request->getPost("is_payable_employee_for_child") ? 1 : 0;
$data['is_payable_employee']['elders'] = $this->request->getPost("is_payable_employee_for_elders") ? 1 : 0;
// if (!in_array("self", $data['family_floaters'])) {
@ -2309,6 +2316,8 @@ class ClientController extends AdminController
$data['totalSumInsured'] = str_replace(',', '', $this->request->getPost("totalSumInsured"));
$data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age");
$data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age");
$data['is_payable_employee']['self'] = 0;
$data['accidentalDeathBenefit'] = str_replace(',', '', $this->request->getPost("accidentalDeathBenefit"));
$data['permanentTotalDisablement'] = str_replace(',', '', $this->request->getPost("permanentTotalDisablement"));
$data['permanentPartialDisablement'] = $this->request->getPost("permanentPartialDisablement");
@ -2892,6 +2901,13 @@ class ClientController extends AdminController
$client_policy_id = $this->request->getPost("client_policy_id");
$policy_terms = $this->request->getPost("policy_terms");
if (!empty($policy_terms)) {
$policy_terms = json_decode($policy_terms, true);
$policy_terms['is_payable_employee']['self'] = 0;
$policy_terms = json_encode($policy_terms);
}
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
if ($record) {
@ -3602,15 +3618,22 @@ class ClientController extends AdminController
dd($result);
}
// ---------------------------------------------------------------------------------------------------------
public function updatePolicyTermsKey()
{
$client_id = $this->request->getGet('client_id');
$data = $this->clientPolicyModel
$query = $this->clientPolicyModel
->where("policy_terms IS NOT NULL AND policy_terms <> ''")
->where('policy_type_id', 2)
->where('is_active', 1)
->findAll();
->where('is_active', 1);
if (!empty($client_id)) {
$query->where('client_id', $client_id);
}
$data = $query->findAll();
for ($i = 0; $i < count($data); $i++) {
if (isset($data[$i]['policy_terms']) && !empty($data[$i]['policy_terms'])) {
@ -3619,49 +3642,110 @@ class ClientController extends AdminController
continue;
}
// Set default value of copayzonewisecopay to "empty"
$ans = isset($policyTerms['copayzonewisecopay']) ? $policyTerms['copayzonewisecopay'] : 'empty';
$is_addon = $data[$i]['is_addon'];
$payable_arr = [];
if (in_array($data[$i]['policy_type_id'], [2,3]) && $is_addon == 1) {
$payable_arr = [ "self" => 0, "spouse" => 0, "childern" => 0, "elders" => 0, ];
} else if ($data[$i]['policy_type_id'] == 3 && $is_addon == 3) {
$payable_arr = ["self" => 1,"spouse" => 1,"childern" => 1,"elders" => 1,];
} else if (in_array($data[$i]['policy_type_id'], [4, 5])) {
$payable_arr = ["self" => 1,"spouse" => 1,"childern" => 1,"elders" => 1,];
}
// Initialize an empty array for the ordered policy terms
$orderedPolicyTerms = [];
// Add copayzonewisecopay and copayzonewisecopaydata if they exist_
if (isset($policyTerms['copayzonewisecopay'])) {
if(in_array($data[$i]['policy_type_id'], [2,3,4,5])){
if(!isset($policyTerms['co_pay_details'])){
// Set default value of copayzonewisecopay to "empty"
$ans = isset($policyTerms['copayzonewisecopay']) ? $policyTerms['copayzonewisecopay'] : 'empty';
$co_pay_details_value = "";
if (strtolower($ans) == "nil" || $ans == 0) {
$policyTerms['copayzonewisecopay'] = 0;
$co_pay_details_value = "";
} elseif ($ans != 'empty' && $ans !== 'Nil' && $ans !== null && $ans != '' && $ans != 0) {
$policyTerms['copayzonewisecopay'] = 1;
$co_pay_details_value = $ans;
// add is_payable_employee for the GMC Policy
if (isset($policyTerms['age_ratio'])) {
if(!isset($policyTerms['is_payable_employee'])){
$aliment_index = array_search('age_ratio', array_keys($policyTerms));
$orderedPolicyTerms[] = [
"key" => "is_payable_employee",
"value" => $payable_arr,
"position" => $aliment_index + 1,
];
}
$co_pay_index = array_search('copayzonewisecopay', array_keys($policyTerms));
$orderedPolicyTerms[] = [
"key" => "co_pay_details",
"value" => $co_pay_details_value,
"position" => $co_pay_index + 1,
];
unset($policyTerms['optionalparentalcopay']);
}
// Add copayzonewisecopay and copayzonewisecopaydata if they exist_
if (isset($policyTerms['copayzonewisecopay'])) {
if(!isset($policyTerms['co_pay_details'])){
$co_pay_details_value = "";
if (strtolower($ans) == "nil" || $ans == 0) {
$policyTerms['copayzonewisecopay'] = 0;
$co_pay_details_value = "";
} elseif ($ans != 'empty' && $ans !== 'Nil' && $ans !== null && $ans != '' && $ans != 0) {
$policyTerms['copayzonewisecopay'] = 1;
$co_pay_details_value = $ans;
}
$co_pay_index = array_search('copayzonewisecopay', array_keys($policyTerms));
$orderedPolicyTerms[] = [
"key" => "co_pay_details",
"value" => $co_pay_details_value,
"position" => $co_pay_index + 2,
];
unset($policyTerms['optionalparentalcopay']);
}
}
// Add ailmentcapping and ailmentcappingdata if they exist
if (isset($policyTerms['ailmentcapping'])) {
if(!isset($policyTerms['ailment_capping_details'])){
$aliment_index = array_search('ailmentcapping', array_keys($policyTerms));
$orderedPolicyTerms[] = [
"key" => "ailment_capping_details",
"value" => "",
"position" => $aliment_index + 3,
];
}
}
}else {
// add is_payable_employee for the GMC Policy
if (isset($policyTerms['age_ratio'])) {
if(!isset($policyTerms['is_payable_employee'])){
$aliment_index = array_search('age_ratio', array_keys($policyTerms));
$orderedPolicyTerms[] = [
"key" => "is_payable_employee",
"value" => [
"self" => 0,
],
"position" => $aliment_index + 1,
];
}
}else{
if(!isset($policyTerms['is_payable_employee'])){
$orderedPolicyTerms[] = [
"key" => "is_payable_employee",
"value" => [
"self" => 0,
],
"position" => 2,
];
}
}
}
// Add ailmentcapping and ailmentcappingdata if they exist_
if (isset($policyTerms['ailmentcapping'])) {
if(!isset($policyTerms['ailment_capping_details'])){
$aliment_index = array_search('ailmentcapping', array_keys($policyTerms));
$orderedPolicyTerms[] = [
"key" => "ailment_capping_details",
"value" => "",
"position" => $aliment_index + 2,
];
}
}
foreach ($orderedPolicyTerms as $term) {
$position = $term['position'];
@ -3706,10 +3790,15 @@ class ClientController extends AdminController
dd($days);
}
public function sendextraparam(){
public function sendextraparam()
{
// dd($this->request);
// $employeeRestController = new EmployeeServiceController();
// $employeeRestController->employeesEnrollmentInsert(['file_id' => 715]);
// $employeeRestController->employeesEnrollmentInsert(['file_id' => 721]);
// $r = Jobs::addJob(['job_name' => 'employeesEnrollmentInsert','payload' => ['file_id' => 721]]);
// $dashBoardController = new DashboardController();
// $client_policy_data = $this->clientPolicyModel->getPolicyDetailsForRemainder($client_id=159, $client_branch_id=126);
@ -3719,6 +3808,28 @@ class ClientController extends AdminController
// $emp_data = $this->employeePolicyModel->getEmployeePolicyForEcard(12);
// $ids = array_column($emp_data, 'id');
// $EmpDataServiceController->sendMailForDownloadingECard($ids);
// $empServiceController = new EmployeeServiceController();
// $res = $empServiceController->employeesOnboardPreprocess(['file_id' => '741']);
}
// -------------------------------------------------------------------------------------------------------
public function createOtherTabContent()
{
$this->myLogger->logme('error', 'Client Others function called');
$data = $this->request->getPost();
$data['created_by'] = get_session_userid();
$client_id = $data['client_id'];
unset($data['client_id']);
$insert = $this->clientModel->where('id', $client_id)->set($data)->update();
if ($insert) {
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Client others data updated', 'data' => $data], 200);
} else {
return $this->respond(['status' => false, 'code' => 404, 'message' => 'No data to update'], 200);
}
}
}

View File

@ -934,11 +934,13 @@ class EmployeeRestController extends AdminController
}
}
}
$emp_policy_data =[
'employee_id'=>$emp_id,
'client_policy_id'=>$policy_id,
'status'=> 'draft',
'date_coverage' => $date_coverage,
'payable_employee' => check_pay_by_employee_or_company($client_policy['policy_terms'], $dataToInsert[$a]['relationship']),
'basic_cover_si'=>isset($basic_cover_si[$a]) ? $basic_cover_si[$a] : null
];
@ -2065,11 +2067,21 @@ class EmployeeRestController extends AdminController
// retun array
public function calculatePremium($clientPolicyId = null , $empCode = null, $default_si = null , $client_branch_id = null)//family level
{
// dd($clientPolicyId, $empCode, $default_si, $client_branch_id);
helper('excel_util_helper');
$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;
if($this->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
$client_policy_id = $clientPolicyId;
$emp_code = $empCode;
$default_si = $default_si;// si amt which choosed in add on policy
$client_branch_id =$client_branch_id;
}
// dd($client_policy_id);

View File

@ -1580,9 +1580,15 @@ class EmployeeServiceController extends AdminController
// insert or update in db for inception addition depent addition
public function employeesOnboardProcess($params)
{
{
// dd($params);
$familiy_data = $params['familiy_data'];
$file = $params['file'];
$policy_details = $this->clientPolicyModel->where('id', $file['policy_id'])->first();
// dd($policy_details);
foreach($familiy_data as $fkey => $value)
{
if(is_array($value))
@ -1658,7 +1664,8 @@ class EmployeeServiceController extends AdminController
$policy_data['updated_by'] = $file['created_by'];
$policy_data['id'] = $employee_policy[0]['id'];
$policy_data['status'] = 'active';
$policy_data['payable_employee'] = check_pay_by_employee_or_company($policy_details['policy_terms'], $value['relationship']);
$log_message = 'Update Employee Policy for '. $value['name'].'('. $value['emp_code'].') with PK- ' . $employee_policy[0]['id'] .' client policy ID '.$employee_policy[0]['client_policy_id'].' with SI '.$policy_data['basic_cover_si'];
// echo 'insert policy';
}
@ -1668,6 +1675,8 @@ class EmployeeServiceController extends AdminController
$policy_data['client_policy_id'] = $file['policy_id'];
$policy_data['created_by'] = $file['created_by'];
$policy_data['status'] = 'active';
$policy_data['payable_employee'] = check_pay_by_employee_or_company($policy_details['policy_terms'], $value['relationship']);
$log_message = 'Insert Employee Policy for '. $value['name'].'('. $value['emp_code'].') - client policy id -'. $file['policy_id'].' - with SI '.$policy_data['basic_cover_si'];
// echo 'update policy';
}
@ -1930,7 +1939,7 @@ public function getFileMetaDataByFileId($file_id, $status = 'success'){
public function employeesEnrollmentInsert($params)
{
// dd($this->request);
helper('excel_util_helper');
//get file name
$file_id = $params['file_id'];
@ -1982,7 +1991,9 @@ public function getFileMetaDataByFileId($file_id, $status = 'success'){
// dd($policy_details);
//get policy slab rates
$slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($file['policy_id'],$file['client_id']);
// $slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($file['policy_id'],$file['client_id']);
// dd($slab_details);
foreach ($excel_data as $key => $row)
{
$is_row_empty = check_row_is_empty_or_null($row);
@ -2029,7 +2040,7 @@ public function getFileMetaDataByFileId($file_id, $status = 'success'){
$value['family_floater_key'] = $relation;
$policy_data['basic_cover_si'] = $row[9];
$policy_data['date_coverage'] = $row[13] != "" && $row[13] != null ? change_date_format($row[13],'d-M-Y','Y-m-d') : null;
$policy_data['date_coverage'] = $row[13] != "" && $row[13] != null ? change_date_format($row[13],null,'Y-m-d') : null;
$policy_data['client_policy_id'] = $file['policy_id'];
$employee = $this->employeeModel->checkExistingEmployee($value,$file['client_branch_id']);
@ -2071,6 +2082,7 @@ public function getFileMetaDataByFileId($file_id, $status = 'success'){
$policy_data['updated_by'] = $file['created_by'];
$policy_data['id'] = $employee_policy[0]['id'];
$policy_data['status'] = 'draft';
$policy_data['payable_employee'] = check_pay_by_employee_or_company($policy_details['policy_terms'], $value['relationship']);
$log_message = 'Update Employee Policy for '. $value['name'].'('. $value['emp_code'].') with PK- ' . $employee_policy[0]['id'] .' client policy ID '.$employee_policy[0]['client_policy_id'].' with SI '.$policy_data['basic_cover_si'];
// echo 'insert policy';
@ -2081,6 +2093,8 @@ public function getFileMetaDataByFileId($file_id, $status = 'success'){
$policy_data['client_policy_id'] = $file['policy_id'];
$policy_data['created_by'] = $file['created_by'];
$policy_data['status'] = 'draft';
$policy_data['payable_employee'] = check_pay_by_employee_or_company($policy_details['policy_terms'], $value['relationship']);
$log_message = 'Insert Employee Policy for '. $value['name'].'('. $value['emp_code'].') - client policy id -'. $file['policy_id'].' - with SI '.$policy_data['basic_cover_si'];
// echo 'update policy';
}
@ -2089,6 +2103,10 @@ public function getFileMetaDataByFileId($file_id, $status = 'success'){
$emp_policy_id = $this->employeePolicyModel->getInsertID();
$this->myLogger->logme('error',$log_message);
$employeeRestController = new EmployeeRestController();
$employeeRestController->updatePremiumAmount($file['policy_id'], $value['emp_code'], $file['client_branch_id']);
//save email of self for send mail later
if (isset($notification) && $notification['enabled'] == 1 && $notification['mail_content'] != '')
{
@ -2097,7 +2115,14 @@ public function getFileMetaDataByFileId($file_id, $status = 'success'){
$params['dataToInsert'] = $value; //holds employee master data
$params['notification'] = $notification;
$params['client_data'] = $client_details;
$params['common'] = [];
$params['common'] = [
'client_id' => $file['client_id'],
'client_branch_id' => $file['client_branch_id'],
'client_policy_id' => $file['policy_id'],
'employee_policy_id' => $emp_policy_id ?? null,
'employee_id' => $emp_id,
'mail_type' => 'member_welcome_mail',
];
//store email and mail content via helper to send notification
$emp_emails[] = sendMailNotification::sendMailNotification('member_welcome_mail', $params);
}
@ -2105,6 +2130,7 @@ public function getFileMetaDataByFileId($file_id, $status = 'success'){
}// endof if row is empty check
} //end of for loop
// dd($emp_emails);
// for bulk mail queue job push
if (!empty($emp_emails) && count($emp_emails) > 0) {

View File

@ -191,7 +191,11 @@ class sendMailNotification
// echo '<pre>';
// print_r($array_list); die;
foreach ($array_list as $item) {
$payable_employee_array = [];
if (count($item) != 0) {
@ -211,6 +215,10 @@ class sendMailNotification
}
//end of getting policy premium data
if($inner_item['payable_employee'] == 1 && $client_policy_data['policy_type_id'] == 2){
$payable_employee_array[] = $inner_item;
}
// dd($policy_premium_data);
$policy_name = $inner_item['policy_name'];
@ -228,7 +236,7 @@ class sendMailNotification
// if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
$premium = '₹ ' .format_indian_number(round($inner_item['premium']));
$premium = '₹ ' .format_indian_number(round($inner_item['rata_premimum']));
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
// }
@ -296,6 +304,89 @@ class sendMailNotification
$addtional_premium = 0;
$gst = 0;
}
if(count($payable_employee_array) > 0){
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
$temp_data = '';
$is_addon = '';
foreach ($payable_employee_array as $inner_item) {
//getting policy premium data
$client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first();
if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
$policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
}else{
$policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
}
//end of getting policy premium data
$si = '';
$premium = '';
$gst_forself = '';
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
$premium = '₹ ' .format_indian_number(round($inner_item['rata_premimum']));
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
$temp_data .= '<tr>';
$temp_data .= '<td>' . $inner_item['name'] . ($inner_item['relationship'] == 'Self' ? ' (' . $inner_item['emp_code'] . ')' : '') . '</td>';
$temp_data .= '<td>' . $inner_item['relationship'] . '</td>';
$temp_data .= '<td>' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '</td>';
$temp_data .= '<td>' . $si . '</td>';
$temp_data .= '<td>' . $premium . '</td>';
$temp_data .= '<td>' . $gst_forself . '</td>';
$temp_data .= '</tr>';
$is_addon = $inner_item['is_addon'];
$addtional_premium = $inner_item['rata_premimum'] + $addtional_premium;
$gst = $inner_item['gst'] + $gst;
}
$policy_name_for_policy_type = $inner_item['policy_name'];
if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){
$policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents';
}
$table_content .= $policy_name_for_policy_type . ' ( Payable By Employee ) </h4></div>';
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
// Add text-align: center to the table head
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff; text-align: center;">';
$table_content .= '<tr>';
$table_content .= '<th>Name</th>';
$table_content .= '<th>Relation</th>';
$table_content .= '<th style="width:15%">Date Of Birth</th>';
$table_content .= '<th>Sum Insured</th>';
$table_content .= '<th>Premium</th>';
$table_content .= '<th>GST</th>';
$table_content .= '</tr>';
$table_content .= '</thead>';
// Add text-align: center to the table body
$table_content .= '<tbody style="text-align: center;">' . $temp_data . '</tbody>';
$table_content .= '</table></div>';
$addon_list_array = [
'policy_name' => $policy_name_for_policy_type . '( Payable By Employee )',
'addtional_premium' => round($addtional_premium),
'gst' => round($gst)
];
$Addon_list[] = $addon_list_array;
$temp_data = '';
$addtional_premium = 0;
$gst = 0;
}
}
if (count($Addon_list) > 0) {
@ -337,6 +428,7 @@ class sendMailNotification
// $table_content .= '<div style="width:100%; text-align:right; font-size: 12px;">' . $sum_total_words . '</div>';
}
// dd($payable_employee_array, $Addon_list);
// print_r($table_content); die;
$mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content);
@ -406,6 +498,9 @@ class sendMailNotification
$Addon_list = [];
foreach ($array_list as $item) {
$payable_employee_array = [];
if (count($item) != 0) {
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
$temp_data = '';
@ -423,6 +518,10 @@ class sendMailNotification
}
//end of getting policy premium data
if($inner_item['payable_employee'] == 1 && $client_policy_data['policy_type_id'] == 2){
$payable_employee_array[] = $inner_item;
}
$policy_name = $inner_item['policy_name'];
if ($inner_item['relationship'] == 'Self') {
@ -434,11 +533,11 @@ class sendMailNotification
$si = '';
$premium = '';
$gst_forself = '';
if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){
// if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
$premium = '₹ ' .format_indian_number(round($inner_item['premium']));
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
}
// }
$temp_data .= '<tr>';
$temp_data .= '<td>' . $inner_item['name'] . $emp_code . '</td>';
@ -504,6 +603,90 @@ class sendMailNotification
$addtional_premium = 0;
$gst = 0;
}
if(count($payable_employee_array) > 0){
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
$temp_data = '';
$is_addon = '';
foreach ($payable_employee_array as $inner_item) {
//getting policy premium data
$client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first();
if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
$policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
}else{
$policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
}
//end of getting policy premium data
$si = '';
$premium = '';
$gst_forself = '';
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
$premium = '₹ ' .format_indian_number(round($inner_item['rata_premimum']));
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
$temp_data .= '<tr>';
$temp_data .= '<td>' . $inner_item['name'] . ($inner_item['relationship'] == 'Self' ? ' (' . $inner_item['emp_code'] . ')' : '') . '</td>';
$temp_data .= '<td>' . $inner_item['relationship'] . '</td>';
$temp_data .= '<td>' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '</td>';
$temp_data .= '<td>' . $si . '</td>';
$temp_data .= '<td>' . $premium . '</td>';
$temp_data .= '<td>' . $gst_forself . '</td>';
$temp_data .= '</tr>';
$is_addon = $inner_item['is_addon'];
$addtional_premium = $inner_item['rata_premimum'] + $addtional_premium;
$gst = $inner_item['gst'] + $gst;
}
$policy_name_for_policy_type = $inner_item['policy_name'];
if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){
$policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents';
}
$table_content .= $policy_name_for_policy_type . ' ( Payable By Employee ) </h4></div>';
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
// Add text-align: center to the table head
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff; text-align: center;">';
$table_content .= '<tr>';
$table_content .= '<th>Name</th>';
$table_content .= '<th>Relation</th>';
$table_content .= '<th style="width:15%">Date Of Birth</th>';
$table_content .= '<th>Sum Insured</th>';
$table_content .= '<th>Premium</th>';
$table_content .= '<th>GST</th>';
$table_content .= '</tr>';
$table_content .= '</thead>';
// Add text-align: center to the table body
$table_content .= '<tbody style="text-align: center;">' . $temp_data . '</tbody>';
$table_content .= '</table></div>';
$addon_list_array = [
'policy_name' => $policy_name_for_policy_type . '( Payable By Employee )',
'addtional_premium' => round($addtional_premium),
'gst' => round($gst)
];
$Addon_list[] = $addon_list_array;
$temp_data = '';
$addtional_premium = 0;
$gst = 0;
}
}
if (count($Addon_list) > 0) {
@ -611,8 +794,11 @@ class sendMailNotification
$gst = 0;
$array_list = $params['array_list'];
$Addon_list = [];
foreach ($array_list as $item) {
$payable_employee_array = [];
if (count($item) != 0) {
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
$temp_data = '';
@ -630,6 +816,10 @@ class sendMailNotification
}
//end of getting policy premium data
if($inner_item['payable_employee'] == 1 && $client_policy_data['policy_type_id'] == 2){
$payable_employee_array[] = $inner_item;
}
$policy_name = $inner_item['policy_name'];
if ($inner_item['relationship'] == 'Self') {
@ -644,11 +834,11 @@ class sendMailNotification
// dd($policy_premium_data, $client_policy_data, $inner_item);
if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){
// if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
$premium = '₹ ' .format_indian_number(round($inner_item['premium']));
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
}
// }
$temp_data .= '<tr>';
$temp_data .= '<td>' . $inner_item['name'] . $emp_code . '</td>';
@ -714,6 +904,89 @@ class sendMailNotification
$addtional_premium = 0;
$gst = 0;
}
if(count($payable_employee_array) > 0){
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
$temp_data = '';
$is_addon = '';
foreach ($payable_employee_array as $inner_item) {
//getting policy premium data
$client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first();
if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
$policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
}else{
$policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
}
//end of getting policy premium data
$si = '';
$premium = '';
$gst_forself = '';
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
$premium = '₹ ' .format_indian_number(round($inner_item['rata_premimum']));
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
$temp_data .= '<tr>';
$temp_data .= '<td>' . $inner_item['name'] . ($inner_item['relationship'] == 'Self' ? ' (' . $inner_item['emp_code'] . ')' : '') . '</td>';
$temp_data .= '<td>' . $inner_item['relationship'] . '</td>';
$temp_data .= '<td>' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '</td>';
$temp_data .= '<td>' . $si . '</td>';
$temp_data .= '<td>' . $premium . '</td>';
$temp_data .= '<td>' . $gst_forself . '</td>';
$temp_data .= '</tr>';
$is_addon = $inner_item['is_addon'];
$addtional_premium = $inner_item['rata_premimum'] + $addtional_premium;
$gst = $inner_item['gst'] + $gst;
}
$policy_name_for_policy_type = $inner_item['policy_name'];
if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){
$policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents';
}
$table_content .= $policy_name_for_policy_type . ' ( Payable By Employee ) </h4></div>';
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
// Add text-align: center to the table head
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff; text-align: center;">';
$table_content .= '<tr>';
$table_content .= '<th>Name</th>';
$table_content .= '<th>Relation</th>';
$table_content .= '<th style="width:15%">Date Of Birth</th>';
$table_content .= '<th>Sum Insured</th>';
$table_content .= '<th>Premium</th>';
$table_content .= '<th>GST</th>';
$table_content .= '</tr>';
$table_content .= '</thead>';
// Add text-align: center to the table body
$table_content .= '<tbody style="text-align: center;">' . $temp_data . '</tbody>';
$table_content .= '</table></div>';
$addon_list_array = [
'policy_name' => $policy_name_for_policy_type . '( Payable By Employee )',
'addtional_premium' => round($addtional_premium),
'gst' => round($gst)
];
$Addon_list[] = $addon_list_array;
$temp_data = '';
$addtional_premium = 0;
$gst = 0;
}
}
if (count($Addon_list) > 0) {

View File

@ -404,67 +404,68 @@ if(!function_exists('checkFamilyFloaters')){
}
}
if (!function_exists('numberToWords')) {
function numberToWords($number)
{
$words = array(
'0' => 'Zero',
'1' => 'One',
'2' => 'Two',
'3' => 'Three',
'4' => 'Four',
'5' => 'Five',
'6' => 'Six',
'7' => 'Seven',
'8' => 'Eight',
'9' => 'Nine',
'10' => 'Ten',
'11' => 'Eleven',
'12' => 'Twelve',
'13' => 'Thirteen',
'14' => 'Fourteen',
'15' => 'Fifteen',
'16' => 'Sixteen',
'17' => 'Seventeen',
'18' => 'Eighteen',
'19' => 'Nineteen',
'20' => 'Twenty',
'30' => 'Thirty',
'40' => 'Forty',
'50' => 'Fifty',
'60' => 'Sixty',
'70' => 'Seventy',
'80' => 'Eighty',
'90' => 'Ninety'
);
function numberToWords($number)
{
$words = array(
'0' => 'Zero',
'1' => 'One',
'2' => 'Two',
'3' => 'Three',
'4' => 'Four',
'5' => 'Five',
'6' => 'Six',
'7' => 'Seven',
'8' => 'Eight',
'9' => 'Nine',
'10' => 'Ten',
'11' => 'Eleven',
'12' => 'Twelve',
'13' => 'Thirteen',
'14' => 'Fourteen',
'15' => 'Fifteen',
'16' => 'Sixteen',
'17' => 'Seventeen',
'18' => 'Eighteen',
'19' => 'Nineteen',
'20' => 'Twenty',
'30' => 'Thirty',
'40' => 'Forty',
'50' => 'Fifty',
'60' => 'Sixty',
'70' => 'Seventy',
'80' => 'Eighty',
'90' => 'Ninety'
);
if ($number < 21) {
return $words[$number];
}
if ($number < 100) {
$tens = (int)($number / 10) * 10;
$units = $number % 10;
return $words[$tens] . ($units ? ' ' . $words[$units] : '');
}
if ($number < 1000) {
$hundreds = (int)($number / 100);
$remainder = $number % 100;
return $words[$hundreds] . ' Hundred' . ($remainder ? ' and ' . numberToWords($remainder) : '');
}
$levels = array('', ' Thousand', ' Million', ' Billion', ' Trillion', ' Quadrillion', ' Quintillion');
for ($i = 0, $unit = 1; $i < count($levels); $i++, $unit *= 1000) {
if ($number < $unit * 1000) {
$current = (int)($number / $unit);
$remainder = $number % $unit;
return numberToWords($current) . $levels[$i] . ($remainder ? ' ' . numberToWords($remainder) : '');
if ($number < 21) {
return $words[$number];
}
}
return $number; // Fallback for numbers beyond the supported range
if ($number < 100) {
$tens = (int)($number / 10) * 10;
$units = $number % 10;
return $words[$tens] . ($units ? ' ' . $words[$units] : '');
}
if ($number < 1000) {
$hundreds = (int)($number / 100);
$remainder = $number % 100;
return $words[$hundreds] . ' Hundred' . ($remainder ? ' and ' . numberToWords($remainder) : '');
}
$levels = array('', ' Thousand', ' Million', ' Billion', ' Trillion', ' Quadrillion', ' Quintillion');
for ($i = 0, $unit = 1; $i < count($levels); $i++, $unit *= 1000) {
if ($number < $unit * 1000) {
$current = (int)($number / $unit);
$remainder = $number % $unit;
return numberToWords($current) . $levels[$i] . ($remainder ? ' ' . numberToWords($remainder) : '');
}
}
return $number; // Fallback for numbers beyond the supported range
}
}
if (!function_exists('print_rr')) {
@ -493,6 +494,7 @@ if (!function_exists('get_server_details')) {
];
}
}
if (!function_exists('isJsonString')) {
function isJsonString($input)
@ -509,9 +511,7 @@ if (!function_exists('isValidDate')) {
}
}
if (!function_exists('change_date_format'))
{
if (!function_exists('change_date_format')) {
function change_date_format($date_str, $source_format = null, $output_format = 'Y-m-d') {
@ -584,3 +584,80 @@ if (!function_exists('change_date_format'))
return null;
}
}
// if (!function_exists('check_pay_by_employee_or_company'))
// {
// function check_pay_by_employee_or_company($is_payable_employee = null, $relationship = null) {
// $relationship = strtolower(str_replace(" ", "_", $relationship));
// $result = 0;
// if($relationship == 'self'){
// $result = $is_payable_employee['self'] == 1 ? 1 : 0;
// }else if($relationship == 'spouse'){
// $result = $is_payable_employee['spouse'] == 1 ? 1 : 0;
// }else if(in_array($relationship, ['son', 'daughter'])){
// $result = $is_payable_employee['childern'] == 1 ? 1 : 0;
// }else if(in_array($relationship, ['father', 'mother', 'father_in_law', 'mother_in_law'])){
// $result = $is_payable_employee['elders'] == 1 ? 1 : 0;
// }
// return $result;
// }
// }
if (!function_exists('check_pay_by_employee_or_company')) {
function check_pay_by_employee_or_company($policy_terms = null, $relationship = null)
{
// dd($policy_terms, $relationship);
if (!$policy_terms || !($policy_terms = json_decode($policy_terms, true))) {
return 0;
}
// dd($policy_terms, $relationship);
if (!isset($policy_terms['is_payable_employee'])) {
return 0;
}
$is_payable_employee = $policy_terms['is_payable_employee'];
$relationship = strtolower(str_replace(" ", "_", $relationship));
// dd($is_payable_employee, $relationship);
$relationshipMap = [
'self' => 'self',
'spouse' => 'spouse',
'son' => 'childern',
'daughter' => 'childern',
'father' => 'elders',
'mother' => 'elders',
'father_in_law' => 'elders',
'mother_in_law' => 'elders'
];
if (array_key_exists($relationship, $relationshipMap)) {
$key = $relationshipMap[$relationship];
return isset($is_payable_employee[$key]) && $is_payable_employee[$key] == 1 ? 1 : 0;
}
return 0;
}
}

View File

@ -39,6 +39,7 @@ class ClientModel extends Model
"email",
"reply_to",
"mail_domain",
"addon_subheading",
];

View File

@ -106,7 +106,7 @@ class EmployeeModel extends Model
public function getEmpFamilybyEmpCode(string $client_policy_id = null,string $emp_code = null,string $client_id = null,array $emp_status = [],array $policy_status = [],array $relationship = [],array $client_branch_id = [])
{
$result = $this->select(['employees.id as emp_id', 'employees.client_id','employees.client_branch_id', 'employees.relationship', 'employees.relationship_code', 'employees.change_event', 'employees.emp_code', 'employees.name', 'employees.email_personal', 'employees.email_corporate', 'employees.mobile', 'employees.gender', 'employees.dob', 'employees.doj', 'employees.basic_pay', 'employees.band', 'employees.designation', 'employees.emp_status','employees.unit','employee_polices.id as emp_policy_id', 'employee_polices.employee_id', 'employee_polices.client_policy_id', 'employee_polices.tpa_id', 'employee_polices.uhid', 'employee_polices.batch_code', 'employee_polices.status', 'employee_polices.pre_existing_alignments', 'employee_polices.basic_cover_si', 'employee_polices.date_coverage', 'employee_polices.policy_end_date', 'employee_polices.days', 'employee_polices.premium', 'employee_polices.rata_premimum', 'employee_polices.gst', 'employee_polices.date_of_exit', 'employee_polices.reason_for_exit','policy_type.long_name as policy_name','client_policy.is_addon'])
$result = $this->select(['employees.id as emp_id', 'employees.client_id','employees.client_branch_id', 'employees.relationship', 'employees.relationship_code', 'employees.change_event', 'employees.emp_code', 'employees.name', 'employees.email_personal', 'employees.email_corporate', 'employees.mobile', 'employees.gender', 'employees.dob', 'employees.doj', 'employees.basic_pay', 'employees.band', 'employees.designation', 'employees.emp_status','employees.unit','employee_polices.id as emp_policy_id', 'employee_polices.employee_id', 'employee_polices.client_policy_id', 'employee_polices.tpa_id', 'employee_polices.uhid', 'employee_polices.batch_code', 'employee_polices.status', 'employee_polices.pre_existing_alignments', 'employee_polices.basic_cover_si', 'employee_polices.date_coverage', 'employee_polices.policy_end_date', 'employee_polices.days', 'employee_polices.premium', 'employee_polices.rata_premimum', 'employee_polices.gst', 'employee_polices.date_of_exit', 'employee_polices.reason_for_exit','policy_type.long_name as policy_name','client_policy.is_addon', 'employee_polices.payable_employee'])
->join('employee_polices', 'employee_polices.employee_id = employees.id')
->join('client_policy', 'client_policy.id = employee_polices.client_policy_id')
->join('policy_type', 'policy_type.id = client_policy.policy_type_id','left')

View File

@ -33,7 +33,8 @@ class EmployeePolicyModel extends Model
"rand_string",
"is_active",
"claim_status",
'ecard_sent_status'
'ecard_sent_status',
'payable_employee',
];
// Callbacks

View File

@ -88,10 +88,16 @@ body {
<span class="d-none d-sm-inline-block">Policies</span>
</a>
</li>
<li class="nav-item">
<a href="#others-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="others_tab">
<span class="mr-1"><i class="mdi mdi-tag-text-outline"></i></span>
<span class="d-none d-sm-inline-block">Others</span>
</a>
</li>
</ul>
<div class="tab-content">
<?php include('client_others_tab.php'); ?>
<?php include('notification.php'); ?>
<?php include('client_basic_info.php'); ?>
<?php include('client_kyc.php'); ?>
<?php include('client_rm.php'); ?>

View File

@ -0,0 +1,81 @@
<div class="tab-pane fade" id="others-tab">
<div class="row">
<div class="col-12">
<div class="card-body">
<form role="form" class="parsley-examples" method="post" id="others_form" enctype="multipart/form-data">
<input type="hidden" name="client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-12">
<label for="addon_subheading">Addon Sub-Heading</label>
<textarea class="form-control" id="addon_subheading" name="addon_subheading" rows="1" placeholder="Enter Text"><?= isset($client['addon_subheading']) ? $client['addon_subheading'] : '' ?></textarea>
</div>
</div>
</div>
<div class="form-group text-right m-b-0">
<button type="submit" class="btn btn-primary" id="others_form_submit">Submit</button>
</div>
</form>
</div>
</div> <!-- end col-->
</div>
<!-- end row -->
</div>
<!-- end -->
<script>
$(document).ready(function() {
//for Client Others Form Submit using AJAX
$("#others_form").submit(function(event) {
event.preventDefault();
var isValid = $('#others_form').parsley().validate();
if (!isValid) {
return;
}
if (isValid) {
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
var form_action = '<?= base_url("client/others/create"); ?>';
var formData = new FormData($('#others_form')[0]);
$.ajax({
data: formData,
url: form_action,
type: "POST",
dataType: 'json',
processData: false,
contentType: false,
success: function(res) {
console.log(res);
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
if (res.status == true) {
toastr.success(res.message, 'SUCCESS');
} else {
toastr.warning(res.message, 'WARNING');
}
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
console.log('Something Wrong!', 'warning');
}
});
}
});
});
</script>

View File

@ -107,7 +107,7 @@
<div class="form-group">
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="sumInsured">Sum Insured</label>
</div>
<div class="col-md-4">
@ -116,9 +116,9 @@
<div class="col-md-2" style="position: relative;left: 88px;">
<button type="button" class="btn btn-primary si-add-more" onclick="appendGMCSIAddMore()">+</button>
</div>
<div class="col-md-6">
<div class="col-md-4">
</div>
<div class="col-md-6">
<div class="col-md-4">
<div id='numberToWordGMC' class="text-danger-2" ></div>
</div>
</div>
@ -126,16 +126,16 @@
<div id="gmc_si_add_more"></div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Family Floater</label>
</div>
<div class="col-md-6">
<input type="radio" name="family_floater" class="family_floater" value="1"> Yes
<input type="radio" name="family_floater" class="family_floater" value="0" style="margin-left:10px"> No
</div>
<div class="col-md-6">
<div class="col-md-4">
</div>
<div class="col-md-6" style="margin-bottom:10px">
<div class="col-md-8" style="margin-bottom:10px">
<table>
<tbody>
<tr>
@ -143,12 +143,16 @@
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;" name="family_floaters[]" value="self" id="self" checked> </td>
<td style="width: 28%;" ><div class="self-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo (isset($self_min_age) && $self_min_age > 0) ? $self_min_age : '18'; ?>" style="width: 35%;;" type="number" name="self_min_age" id="self_min_age" onchange="lowerIsEighteen(this)"></div></td>
<td style="width: 28%;" ><div class="self-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>" style="width: 35%;;" type="number" name="self_max_age" id="self_max_age" onchange="lowerIsEighteen(this)"></div></td>
<td style="width: 11%;"><span class="self-age" style="margin-right: 20px;font-size: 12px;">Is Payable by employee:</span></td>
<td style="width: 11%;"><input class="self-age" type="checkbox" style="margin-right: 70px;" name="is_payable_employee_for_self" id="is_payable_employee_for_self"> </td>
</tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
<tr>
<td style="width: 11%;"><span style="margin-right: 20px;">Spouse:</span></td>
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;"name="family_floaters[]" value="spouse" id="spouse"></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($spouse_min_age) ? $spouse_min_age : '18'; ?>" style="width: 35%;;" type="number" name="spouse_min_age" id="spouse_min_age" onchange="lowerIsEighteen(this)"></div></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($spouse_max_age) ? $spouse_max_age : '60'; ?>" style="width: 35%;;" type="number" name="spouse_max_age" id="spouse_max_age" onchange="lowerIsEighteen(this)"></div></td>
<td style="width: 11%;"><span class="spouse-age" style="margin-right: 20px;font-size: 12px;">Is Payable by employee:</span></td>
<td style="width: 11%;"><input class="spouse-age" type="checkbox" style="margin-right: 70px;" name="is_payable_employee_for_spouse" id="is_payable_employee_for_spouse"> </td>
</tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
<tr>
<td style="width: 11%;"><span for="children">Children:</span></td>
@ -162,6 +166,8 @@
</td>
<td style="width: 28%;" ><div class="child-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($child_min_age) ? $child_min_age : '0'; ?>" style="width: 35%;;" type="number" name="child_min_age" id="child_min_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 28%;" ><div class="child-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($child_max_age) ? $child_max_age : '25'; ?>" style="width: 35%;;" type="number" name="child_max_age" id="child_max_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 11%;"><span class="child-age" style="margin-right: 20px;font-size: 12px;">Is Payable by employee:</span></td>
<td style="width: 11%;"><input class="child-age" type="checkbox" style="margin-right: 70px;" name="is_payable_employee_for_child" id="is_payable_employee_for_child"> </td>
</tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
</tbody>
</table>
@ -192,6 +198,8 @@
<td style="width: 22%;" ><div class="other-member-age"><span style="margin-right: 20px;">Elders Count:</span><input class="underline-input" id="member_count" style="width: 30%; width: 30%;background: lightgray;" type="number" name="elder_member_count" id="member_count" readonly></div></td>
<td style="width: 28%;" ><div class="other-member-age" style="margin-left: 32px;"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>" style="width: 35%;;" type="number" class="underline-input min_age" name="other_member_min_age" id="other_member_min_age" onchange="lowerIsEighteen(this)"></div></td>
<td style="width: 28%;" ><div class="other-member-age" style="margin-left: 17px;"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>" style="width: 35%;;" type="number" class="underline-input max_age" name="other_member_max_age" id="other_member_max_age" onchange="lowerIsEighteen(this)"></div></td>
<td style="width: 11%;"><span class="other-member-age" style="margin-right: 20px;font-size: 12px;">Is Payable by employee:</span></td>
<td style="width: 11%;"><input class="other-member-age" type="checkbox" style="margin-right: 70px;" name="is_payable_employee_for_elders" id="is_payable_employee_for_elders"> </td>
</tr>
</tbody>
</table>
@ -202,7 +210,7 @@
<hr>
<!-- <div class="row" style="margin-bottom: 10px;display:none;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Corporate Buffer</label>
</div>
<div class="col-md-6">
@ -213,7 +221,7 @@
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Waiver of Pre-existing Diseases</label>
</div>
<div class="col-md-6">
@ -223,16 +231,16 @@
</div>
<div class="row" style="margin-bottom: 10px;display:none;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Maternity Coverage</label>
</div>
<div class="col-md-6">
<div class="col-md-4">
<input type="text" name="maternitycoverage" id="maternitycoverage" class="form-control">
</div>
</div>
<div class="row" style="margin-bottom: 10px;display:none;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Twin Delivery</label>
</div>
<div class="col-md-6">
@ -241,7 +249,7 @@
</div>
<div class="row" style="margin-bottom: 10px;display:none;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Pre and Post natal</label>
</div>
<div class="col-md-6">
@ -250,7 +258,7 @@
</div>
<div class="row" style="margin-bottom: 10px;display:none;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Baby Day 1 Cover</label>
</div>
<div class="col-md-6">
@ -260,7 +268,7 @@
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">9-month waiting Period waived</label>
</div>
<div class="col-md-6">
@ -270,7 +278,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Cover from the date of Joining</label>
</div>
<div class="col-md-6">
@ -279,7 +287,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Waiver of 1, 2, 3 & 4th year Exclusions</label>
</div>
<div class="col-md-6">
@ -290,7 +298,7 @@
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Waiver of 30 days waiting period</label>
</div>
<div class="col-md-6">
@ -300,7 +308,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Pre Hospitalization Cover</label>
</div>
<div class="col-md-6">
@ -309,7 +317,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Post Hospitalization Cover</label>
</div>
<div class="col-md-6">
@ -318,7 +326,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Congenital Diseases - Internal</label>
</div>
<div class="col-md-6">
@ -328,7 +336,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Congenital Diseases - External</label>
</div>
<div class="col-md-6">
@ -337,7 +345,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Co-Pay/Zone wise Co Pay</label>
</div>
<div class="col-md-6">
@ -347,7 +355,7 @@
</div>
<div class="row" style="margin-bottom: 10px;display:none;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Co-pay Details</label>
</div>
<div class="col-md-6">
@ -356,7 +364,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Bio absorbable stent / Toric lens/ Multi Focal lens</label>
</div>
<div class="col-md-6">
@ -365,7 +373,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Room Rent Limit</label>
</div>
<div class="col-md-6">
@ -374,7 +382,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Proportionate Deduction Clause</label>
</div>
<div class="col-md-6">
@ -387,7 +395,7 @@
</div>
<!-- <div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Nursing Allowance</label>
</div>
<div class="col-md-6">
@ -396,7 +404,7 @@
</div> -->
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Ailment capping</label>
</div>
<div class="col-md-6">
@ -406,7 +414,7 @@
</div>
<div class="row" style="margin-bottom: 10px;display:none;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Ailment capping Details</label>
</div>
<div class="col-md-6">
@ -415,7 +423,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Corporate Buffer</label>
</div>
<div class="col-md-6">
@ -424,7 +432,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Sublimit of Corporate Buffer</label>
</div>
<div class="col-md-6">
@ -433,7 +441,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Ambulance Charges</label>
</div>
<div class="col-md-6">
@ -442,7 +450,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Air Ambulance</label>
</div>
<div class="col-md-6">
@ -451,7 +459,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Family Transportation Benefit</label>
</div>
<div class="col-md-6">
@ -460,7 +468,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Reasonable and Customary Charges</label>
</div>
<div class="col-md-6">
@ -470,7 +478,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Day Care Treatment</label>
</div>
<div class="col-md-6">
@ -480,7 +488,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">AYUSH treatment cover</label>
</div>
<div class="col-md-6">
@ -490,7 +498,7 @@
</div>
<div class="row" style="margin-bottom: 10px;display:none;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">AYUSH treatment cover Limit</label>
</div>
<div class="col-md-6">
@ -499,7 +507,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">ARMD Covered</label>
</div>
<div class="col-md-6">
@ -508,7 +516,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Sum Insured enhancement</label>
</div>
<div class="col-md-6">
@ -518,7 +526,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Automatic Sum Insured reinstatement</label>
</div>
<div class="col-md-6">
@ -527,7 +535,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Additional Sickness Benefit</label>
</div>
<div class="col-md-6">
@ -536,7 +544,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Lasik Surgery</label>
</div>
<div class="col-md-6">
@ -545,7 +553,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Mid Term inclusion</label>
</div>
<div class="col-md-6">
@ -554,7 +562,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">CAPD</label>
</div>
<div class="col-md-6">
@ -563,7 +571,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Organ donor expenses</label>
</div>
<div class="col-md-6">
@ -572,7 +580,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Modern treatments as per IRDAI</label>
</div>
<div class="col-md-6">
@ -581,7 +589,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Wellness</label>
</div>
<div class="col-md-6">
@ -590,7 +598,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Claim Intimation Clause</label>
</div>
<div class="col-md-6">
@ -600,7 +608,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Claim Submission</label>
</div>
<div class="col-md-6">
@ -610,7 +618,7 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Cataract</label>
</div>
<div class="col-md-6">
@ -620,7 +628,7 @@
</div>
<div class="row" style="margin-bottom: 10px;display:none;">
<div class="col-md-6">
<div class="col-md-4">
<label for="totalSumInsured">Cataract Limit</label>
</div>
<div class="col-md-6">
@ -1129,6 +1137,40 @@
$('#other_member_max_age').val(jsonObject[key].elders.max);
}
if (key.includes("is_payable_employee")) {
if (jsonObject[key]) {
if (jsonObject[key].self == 0) {
$('#is_payable_employee_for_self').prop('checked', false);
}else {
$('#is_payable_employee_for_self').prop('checked', true);
}
if (jsonObject[key].spouse == 0) {
$('#is_payable_employee_for_spouse').prop('checked', false);
} else {
$('#is_payable_employee_for_spouse').prop('checked', true);
}
if (jsonObject[key].childern == 0) {
$('#is_payable_employee_for_child').prop('checked', false);
} else {
$('#is_payable_employee_for_child').prop('checked', true);
}
if (jsonObject[key].elders == 0) {
$('#is_payable_employee_for_elders').prop('checked', false);
} else {
$('#is_payable_employee_for_elders').prop('checked', true);
}
}
}
});
}
$("#sum_insured").trigger("keyup");
@ -1446,7 +1488,7 @@
var html = `
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<div class="col-md-4">
<label for="sumInsured">Additional Sum Insured</label>
</div>
<div class="col-md-4">
@ -1456,9 +1498,9 @@
<button type="button" class="btn btn-danger si-remove-multi" onclick="removeGMCAdditionalSI(this)">x</button>
<button type="button" class="btn btn-primary si-add-more" onclick="appendGMCSIAddMore()">+</button>
</div>
<div class="col-md-6">
<div class="col-md-4">
</div>
<div class="col-md-6">
<div class="col-md-4">
<div class="text-danger-2 numberToWordSumInsured"></div>
</div>
</div>`;

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB