FEAT_POLICY_TERMS_FOR_HR

This commit is contained in:
VENKATESHWARAN 2026-06-24 16:53:33 +05:30
parent aae2a6d933
commit 2ec49e3e7e
3 changed files with 29 additions and 1 deletions

View File

@ -2264,6 +2264,7 @@ class EmployeeRestController extends AdminController
client_policy.inception_type as inception_type,
client_policy.policy_no as policy_no,
client_policy.insurer_id as insurer_id,
client_policy.policy_terms,
DATE_FORMAT(client_policy.policy_start_date, '%d-%m-%Y') AS policy_start_date,
DATE_FORMAT(client_policy.policy_end_date, '%d-%m-%Y') AS policy_expiry_date,
clients.client_logo as client_logo,
@ -2316,6 +2317,26 @@ class EmployeeRestController extends AdminController
$value['is_ecard_bulk_download'] = 0;
$value['is_ecard_bulk_download_for_employee'] = 0;
$terms = json_decode($value['policy_terms'], true) ?? [];
if ($value['policy_type_id'] == 1) {
$policyGroup = 'gpa';
} elseif (in_array($value['policy_type_id'], [6, 7, 72])) {
$policyGroup = 'other';
} else {
$policyGroup = 'gmc';
}
$value['policy_terms'] = isset($terms['enrollment_display_key']) && ! empty($terms['enrollment_display_key'])
? $terms['enrollment_display_key']
: $this->policyTermsFiter($terms, $policyGroup);
$sumInsuredLabel = in_array($value['policy_type_id'], [1, 6, 7]) ? 'Sum Assured' : 'Sum Insured';
$sumInsuredValue = $terms['sum_insured'] ?? ($terms['sumInsured2'] ?? null);
if ($sumInsuredValue !== null && $sumInsuredValue !== '') {
if (! array_key_exists($sumInsuredLabel, $value['policy_terms'])) {
$value['policy_terms'] = array_merge([$sumInsuredLabel => $sumInsuredValue], $value['policy_terms']);
}
}
array_push($result, $value);
}

View File

@ -2218,7 +2218,7 @@ body[data-sidebar-size="condensed"] .footer {
<ul class="nav-third-level">
<?php if (
in_array(POS_TEAM_ID, user_team()) // Case 4: Role Any + Must be in POS Team (global guard)
&& (
||(
in_array(get_role_id(), [1, 5]) // Case 1: Role 1 or 5
|| (in_array(get_role_id(), [4]) && in_array(FINANCE_TEAM_ID, user_team())) // Case 2: Role 4 + Finance Team
|| in_array(MANAGEMENT_TEAM_ID, user_team()) // Case 3: Role Any + Management Team

View File

@ -38,6 +38,13 @@
return false;
}
var name = (el.name || '').toLowerCase();
var id = (el.id || '').toLowerCase();
if (name === 'policy_holder_name' || id === 'policy_holder_name' ||
name === 'family_name[]' || name === 'client_name' || name === 'name') {
return false;
}
var type = (el.type || '').toLowerCase();
if (type === 'file' || type === 'checkbox' || type === 'radio' || type === 'password' || type === 'email' || type === 'url' || type === 'submit' || type === 'button' || type === 'reset') {
return false;