MERGE_RACKRATE9
This commit is contained in:
commit
db4fd844d0
@ -882,15 +882,20 @@ class ClientController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '9') {
|
||||
$premium=$this->request->getPost('9_premium[]');
|
||||
$sum_insure =$this->request->getPost('9_si[]');
|
||||
$grade =$this->request->getPost('9_grade[]');
|
||||
for ($i=0; $i < count($premium) ; $i++) {
|
||||
$data['premium'] = str_replace(',', '',$premium[$i]);
|
||||
$data['si'] = str_replace(',', '', $sum_insure[$i]);
|
||||
$data['grade'] = $grade[$i];
|
||||
$dataa= $this->policyPremium2Model->insert($data);
|
||||
}
|
||||
|
||||
$data['premium'] = str_replace(',', '', $this->request->getPost('gpa_premium'));
|
||||
$data['si'] = str_replace(',', '', $this->request->getPost('gpa_si'));
|
||||
|
||||
$policyPremium = $this->policyPremium2Model->insert($data);
|
||||
// $premium = $this->request->getPost('9_premium[]');
|
||||
// $sum_insure = $this->request->getPost('9_si[]');
|
||||
// $grade = $this->request->getPost('9_grade[]');
|
||||
// for ($i = 0; $i < count($premium); $i++) {
|
||||
// $data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
// $data['si'] = str_replace(',', '', $sum_insure[$i]);
|
||||
// // $data['grade'] = $grade[$i];
|
||||
// $dataa = $this->policyPremium2Model->insert($data);
|
||||
// }
|
||||
$data = $this->request->getPost();
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '10') {
|
||||
@ -1081,15 +1086,15 @@ class ClientController extends AdminController
|
||||
if ($search_term === 'GPA') {
|
||||
|
||||
$premiumData = $this->policyPremium1Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->findAll();
|
||||
|
||||
} else if ($search_term === 'GMC') {
|
||||
|
||||
$premiumData = $this->policyPremium2Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->findAll();
|
||||
|
||||
} else {
|
||||
|
||||
$premiumData = "";
|
||||
}
|
||||
// echo '<pre>';
|
||||
// print_r($premiumData); die;
|
||||
|
||||
// echo $record['client_id'];
|
||||
// echo "-----";
|
||||
@ -1128,8 +1133,7 @@ class ClientController extends AdminController
|
||||
} else if ($premiumData[0]['policy_grid_id'] == '3' || $premiumData[0]['policy_grid_id'] == '4' || $premiumData[0]['policy_grid_id'] == '5' || $premiumData[0]['policy_grid_id'] == '6' || $premiumData[0]['policy_grid_id'] == '7' || $premiumData[0]['policy_grid_id'] == '8' || $premiumData[0]['policy_grid_id'] == '9') {
|
||||
$premiumDataa = $premiumData;
|
||||
}
|
||||
}
|
||||
else if($family_floater == 1){
|
||||
} else if ($family_floater == 1) {
|
||||
if (count($premiumData) == 0) {
|
||||
$premiumDataa = $premiumData;
|
||||
} else if ($premiumData[0]['policy_grid_id'] == '10' || $premiumData[0]['policy_grid_id'] == '11') {
|
||||
@ -1150,15 +1154,12 @@ class ClientController extends AdminController
|
||||
// return json_encode($premiumData);
|
||||
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $resultss, 'premiumData' => json_encode($premiumDataa), 'count' => $emp_count, 'policy_name' => $policy_name, 'family_floater' => $family_floater, 'self' => $self], 200);
|
||||
|
||||
} else if ($search_term === 'GPA') {
|
||||
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $results, 'premiumData' => json_encode($premiumData), 'count' => $emp_count, 'policy_name' => $policy_name, 'family_floater' => $family_floater, 'self' => $self], 200);
|
||||
|
||||
} else {
|
||||
|
||||
return $this->respond(['status' => false, 'code' => 200, 'data' => $results, 'premiumData' => json_encode($premiumData), 'count' => $emp_count, 'policy_name' => $policy_name, 'family_floater' => $family_floater, 'self' => $self], 200);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1457,7 +1458,14 @@ class ClientController extends AdminController
|
||||
|
||||
$client_policy_id = $this->request->getGet('client_policy_id');
|
||||
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||
|
||||
$message = 'Policy updated Successfully' ;
|
||||
if($record['open_for_enrollment'] == 0){
|
||||
$open_for_enrollment_update_value = 1;
|
||||
$message = 'Update Open Enrollment Successfully';
|
||||
}else if($record['open_for_enrollment'] == 1){
|
||||
$open_for_enrollment_update_value = 0;
|
||||
$message = 'Update Open Enrollment Successfully';
|
||||
}
|
||||
|
||||
$data = $this->policesModel->getPolicyPremium($record['policy_id']);
|
||||
$pattern = '/gmc/i';
|
||||
@ -1508,7 +1516,7 @@ class ClientController extends AdminController
|
||||
|
||||
$policy_status = $this->clientPolicyModel->where('id', $client_policy_id )->set('policy_status', 1)->update();
|
||||
$json_data ='';
|
||||
$open_for_enrollment = $this->clientPolicyModel->where('id', $client_policy_id )->set('open_for_enrollment', 1)->update();
|
||||
$open_for_enrollment = $this->clientPolicyModel->where('id', $client_policy_id )->set('open_for_enrollment', $open_for_enrollment_update_value)->update();
|
||||
if ($open_for_enrollment) {
|
||||
$open_for_enrollment_1 = $this->clientPolicyModel->where('id', $client_policy_id )->find();
|
||||
$open_for_enrollment_value = $open_for_enrollment_1[0]['open_for_enrollment'];
|
||||
@ -1517,9 +1525,7 @@ class ClientController extends AdminController
|
||||
$json_data = json_encode(['open_for_enrollment' => $open_for_enrollment_value, 'client_policy_id' => $client_policy_id_value]);
|
||||
}
|
||||
|
||||
return $this->respond(['status' => true,'code' => 200, 'message' => 'Policy Status Updated Successfully', 'data' => $termsData, 'racRate' => $racRate, 'open_for_enrollment' => $json_data], 200);
|
||||
|
||||
|
||||
return $this->respond(['status' => true,'code' => 200, 'message' => $message, 'data' => $termsData, 'racRate' => $racRate, 'open_for_enrollment' => $json_data], 200);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -834,7 +834,7 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
foreach($familiy_data as $fkey => $value)
|
||||
{
|
||||
if($file['id'] == null || ($value['temp']['source'] == 'excel' || (in_array($value['temp']['grid_type'],[10,11]) && strtolower($value['relationship']) == 'self'))) //insert data come from excel and from db
|
||||
if($file['id'] == null || $value['temp']['source'] == 'excel') //insert data come from excel and from db i.e. ( $file['id'] == null for enrollment data)
|
||||
{
|
||||
|
||||
$employee = $this->employeeModel->checkExistingEmp($value);
|
||||
@ -842,50 +842,6 @@ class EmployeeServiceController extends AdminController
|
||||
$temp = $value['temp'];
|
||||
unset($value['policy_details']);
|
||||
unset($value['temp']);
|
||||
|
||||
if($file['id'] == null && (strtolower($value['relationship']) == 'self' && $temp['source'] == 'db' && $temp['emp_id'] != null && $temp['emp_policy_id'] != null))
|
||||
{
|
||||
//check existing si and new si
|
||||
$employee_policy = $this->employeePolicyModel->where('employee_id',$employee['id'])->where('client_policy_id',$file['policy_id'])->first();
|
||||
if($employee_policy['basic_cover_si'] != $policy_data['basic_cover_si'])
|
||||
{
|
||||
|
||||
//check any existing si enhancement pending
|
||||
$existing_endorsements = $this->empEndorsementModel->where('actions','si')
|
||||
->where('table_name','employee_polices')
|
||||
->where('endorsement_id is null')
|
||||
->where('emp_code',$employee['emp_code'])
|
||||
->where('name',$employee['name'])
|
||||
->where('field_name','basic_cover_si')
|
||||
->findAll();
|
||||
|
||||
if(!count($existing_endorsements))
|
||||
{
|
||||
|
||||
$slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($file['policy_id'],$file['client_id']);
|
||||
foreach ($slab_details['slab_rates'] as $skey => $slab_value)
|
||||
{
|
||||
if($slab_value['si'] == $policy_data['si'])
|
||||
{
|
||||
$group_key = rand(100000, 999999);
|
||||
//add new premimum details in endorsement table
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'basic_cover_si','old_value' => $employee_policy['basic_cover_si'],'new_value' => $policy_data['premium'],'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement','group_key' => $group_key]);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'premium','old_value' => $employee_policy['premium'],'new_value' => $slab_value['premium'],'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement','group_key' => $group_key]);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'si_enhancement_date','old_value' => null,'new_value' => ($policy_data['date_coverage']),'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement','group_key' => $group_key]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}// end of self employee si enhance ment
|
||||
|
||||
|
||||
//save employee table
|
||||
if(count($employee))
|
||||
{
|
||||
|
||||
@ -659,25 +659,25 @@ if (!function_exists('premium_calculation_manager'))
|
||||
//audit history table then initiate calculation with it. so this data again get updated in emp table
|
||||
|
||||
//check emp records
|
||||
if($file['id'] == null && $emp_data['temp']['emp_status'] == 'draft' && $emp_data['temp']['policy_status'] == 'draft')
|
||||
if($emp_data['file_id'] == null && $emp_data['temp']['emp_status'] == 'draft' && $emp_data['temp']['policy_status'] == 'draft')
|
||||
{
|
||||
$original_emp_records = get_emp_records_from_audit_history($emp_data['temp']['emp_id']);
|
||||
if(is_array($original_emp_records))
|
||||
{
|
||||
// Kint::dump($original_emp_records);
|
||||
// $emp_data = replace_original_data(original_data:$original_emp_records,current_data:$emp_data);
|
||||
$emp_data = replace_original_data(original_data:$original_emp_records,current_data:$emp_data);
|
||||
// Kint::dump($value);
|
||||
}
|
||||
}
|
||||
|
||||
//check emp policy records
|
||||
if($file['id'] == null && $emp_data['temp']['emp_status'] == 'draft' && $emp_data['temp']['policy_status'] == 'draft')
|
||||
if($emp_data['file_id'] == null && $emp_data['temp']['emp_status'] == 'draft' && $emp_data['temp']['policy_status'] == 'draft')
|
||||
{
|
||||
$original_emp_policy_records = get_emp_policy_records_from_audit_history($emp_data['temp']['emp_policy_id']);
|
||||
if(is_array($original_emp_policy_records))
|
||||
{
|
||||
// Kint::dump($original_emp_records);
|
||||
// $emp_data['policy_details'] = replace_original_data(original_data:$original_emp_policy_records,current_data:$emp_data['policy_details']);
|
||||
$emp_data['policy_details'] = replace_original_data(original_data:$original_emp_policy_records,current_data:$emp_data['policy_details']);
|
||||
// Kint::dump($policy_data);
|
||||
}
|
||||
}
|
||||
@ -860,7 +860,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
foreach ($slab_details['slab_rates'] as $skey => $slab_value)
|
||||
{
|
||||
|
||||
if($slab_value['grade'] == $employee_received_band && $slab_value['si'] == $employee_received_si && (($slab_value['premium_type'] == 1 && strtolower($emp_data['relationship']) == 'self') || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
if($slab_value['si'] == $employee_received_si && (($slab_value['premium_type'] == 1 && strtolower($emp_data['relationship']) == 'self') || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
|
||||
@ -27,4 +27,39 @@ class PolicyPremium1Model extends Model
|
||||
'premium_type',
|
||||
|
||||
];
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = ["checkAndADDCreatedByValue"];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = ["checkAndUpdateUpdatedByValue"];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
protected function checkAndADDCreatedByValue(array $data)
|
||||
{
|
||||
// Check if 'updated_by' value is null or empty
|
||||
if (empty($data['data']['created_by'])) {
|
||||
// Set 'updated_by' value to the current session user ID
|
||||
$data['data']['created_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function checkAndUpdateUpdatedByValue(array $data)
|
||||
{
|
||||
// Check if 'updated_by' value is null or empty
|
||||
if (empty($data['data']['updated_by'])) {
|
||||
// Set 'updated_by' value to the current session user ID
|
||||
$data['data']['updated_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -28,4 +28,37 @@ class PolicyPremium2Model extends Model
|
||||
|
||||
];
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = ["checkAndADDCreatedByValue"];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = ["checkAndUpdateUpdatedByValue"];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
protected function checkAndADDCreatedByValue(array $data)
|
||||
{
|
||||
// Check if 'updated_by' value is null or empty
|
||||
if (empty($data['data']['created_by'])) {
|
||||
// Set 'updated_by' value to the current session user ID
|
||||
$data['data']['created_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function checkAndUpdateUpdatedByValue(array $data)
|
||||
{
|
||||
// Check if 'updated_by' value is null or empty
|
||||
if (empty($data['data']['updated_by'])) {
|
||||
// Set 'updated_by' value to the current session user ID
|
||||
$data['data']['updated_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,8 +2,7 @@
|
||||
|
||||
|
||||
<div class="row float-right" style="padding-bottom: 10px; position: relative;right: 13px;">
|
||||
<button type="button" id="BtnAdd" class="btn btn-primary waves-effect waves-light btnAdd btn-sm"><span
|
||||
class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy</button>
|
||||
<button type="button" id="BtnAdd" class="btn btn-primary waves-effect waves-light btnAdd btn-sm"><span class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy</button>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" id="table_list">
|
||||
@ -29,9 +28,7 @@
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;">
|
||||
<button type="button" id="btnPolicyBack"
|
||||
class="btn btn-primary waves-effect waves-light btn-sm btnBack btn-sm"><span class="fa fa-list"
|
||||
aria-hidden="true" style="padding: 5px 10px;"></span>Back To List</button>
|
||||
<button type="button" id="btnPolicyBack" class="btn btn-primary waves-effect waves-light btn-sm btnBack btn-sm"><span class="fa fa-list" aria-hidden="true" style="padding: 5px 10px;"></span>Back To List</button>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@ -41,8 +38,7 @@
|
||||
<input type="hidden" name="PrimaryKey" id="policy_PrimaryKey" />
|
||||
<input type="hidden" id="policy_form_action" />
|
||||
<input type="hidden" name="policy_type_id" id="policy_type_id" />
|
||||
<input type="hidden" name="client_id" id="client_id_policy"
|
||||
value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
|
||||
<input type="hidden" name="client_id" id="client_id_policy" value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-row">
|
||||
@ -96,20 +92,16 @@
|
||||
|
||||
<div class="form-row" id="second" style="display: none;">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="policy_start_date">Policy Start Date<span
|
||||
class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Start Date "
|
||||
name="policy_start_date" id="start_date" required>
|
||||
<label for="policy_start_date">Policy Start Date<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Start Date " name="policy_start_date" id="start_date" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="policy_end_date">Policy End Date<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter End Date "
|
||||
name="policy_end_date" id="end_date" required>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter End Date " name="policy_end_date" id="end_date" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4" id="policy_status_field">
|
||||
<label for="policy_status">Policy Status</label>
|
||||
<input value="" type="text" class="form-control" placeholder="Policy Status"
|
||||
id="policy_status" readonly>
|
||||
<input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -118,10 +110,8 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack"
|
||||
id="btnBack">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack" id="btnBack">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -265,9 +255,10 @@ $(document).ready(function() {
|
||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a> `;
|
||||
} else {
|
||||
policyTable +=
|
||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="pointer-events:none; background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
|
||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
|
||||
}
|
||||
policyTable += ` </div>
|
||||
policyTable += `
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -378,7 +369,15 @@ $("#policy_form").submit(function(event) {
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a>
|
||||
`;
|
||||
if (item.open_for_enrollment == 0) {
|
||||
policyTable +=
|
||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a> `;
|
||||
} else {
|
||||
policyTable +=
|
||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
|
||||
}
|
||||
policyTable += `
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@ -582,11 +581,20 @@ $('body').on('click', '.btnPolicyEdit', function() {
|
||||
|
||||
$('body').on('click', '.btnOpenEnroll', function() {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to approve this!",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: "Yes, delete it!"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
var client_policy_id = $(this).attr('data-id');
|
||||
var policy_id = $(this).attr('id');
|
||||
var client_id = $('#client_id_policy').val()
|
||||
|
||||
|
||||
// console.log('client_policy_id', client_policy_id);
|
||||
|
||||
if (client_policy_id) {
|
||||
@ -602,6 +610,7 @@ $('body').on('click', '.btnOpenEnroll', function() {
|
||||
},
|
||||
success: function(res) {
|
||||
console.log(res);
|
||||
|
||||
if (res) {
|
||||
if (res.open_for_enrollment) {
|
||||
var json_decode = JSON.parse(res.open_for_enrollment);
|
||||
@ -613,8 +622,17 @@ $('body').on('click', '.btnOpenEnroll', function() {
|
||||
if ($(element).data('id') == client_policy_id) {
|
||||
$(element).css({
|
||||
'background-color': 'lightgrey',
|
||||
'pointer-events': 'none'
|
||||
});
|
||||
$(element).html('<i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('.btnOpenEnroll').each(function(index, element) {
|
||||
if ($(element).data('id') == client_policy_id) {
|
||||
$(element).css({
|
||||
'background-color': '',
|
||||
});
|
||||
$(element).html('<i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment');
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -648,6 +666,10 @@ $('body').on('click', '.btnOpenEnroll', function() {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function appendPolicyFormFields(policy_type, data = false) {
|
||||
@ -1154,5 +1176,4 @@ $(document).ready(function(){
|
||||
function objectToQueryString(obj) {
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -665,6 +665,9 @@ $(document).ready(function() {
|
||||
|
||||
var selectedpolicy = $(this).val();
|
||||
console.log('selectedpolicy',selectedpolicy)
|
||||
$('#upload-action-type').val('').change();
|
||||
$('#file_upload').hide();
|
||||
$('#excel_download').removeAttr('href');
|
||||
|
||||
var apiURL = '<?php echo base_url();?>' + 'util/fetch-emp-count/' + selectedpolicy;
|
||||
console.log(apiURL);
|
||||
@ -729,5 +732,5 @@ $(document).ready(function() {
|
||||
})
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@ -382,25 +382,17 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
}
|
||||
|
||||
grid_html = `
|
||||
|
||||
<div class="form-row" id="grid_9" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<div class="form-row" id="grid_2" style="width:84%">
|
||||
<input value="1" type="hidden" name="policy_type">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="9_si[]" id="9_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_si" id="gpa_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Grade/Band<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.grade : ''}" type="text" class="form-control" placeholder="Enter Grade/Band " name="9_grade[]" id="9_grade" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="9_premium[]" id="9_premium" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='premium_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,9)">x</button>
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(9)">+</button>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="gpa_premium" id="gpa_premium" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='gpa_premium_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
@ -563,8 +555,6 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
grid_container.insertAdjacentHTML('beforeend', grid_html);
|
||||
|
||||
if (dataIdValue == '1') {
|
||||
@ -708,8 +698,10 @@ $('body').on('click', '.btnPolicyModel', function() {
|
||||
}, 1000);
|
||||
console.log('policy grid responce', res);
|
||||
var temp_for_premiumData = JSON.parse(res.premiumData);
|
||||
|
||||
console.log('policy grid responce', temp_for_premiumData);
|
||||
res.premiumData = JSON.parse(res.premiumData);
|
||||
console.log('policy grid responce', res.premiumData);
|
||||
|
||||
|
||||
$('#nameOfThePolicy').html(' - ' + res.policy_name);
|
||||
$('#grid_emp_count').val(res.count);
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user