FEAT_CLIENT_OPEN_ENROLLMENT : RV
This commit is contained in:
parent
0a0322276a
commit
8aa229a4e6
@ -184,7 +184,8 @@ $routes->group("/util", ["filter" => "authMVC"], function($routes){
|
||||
$routes->get("police-by-insurer/(:any)", "ClientController::getPolicesByInsurerId/$1");
|
||||
$routes->get("get-file-error/(:any)", "EmployeeController::getUploadedFileError/$1");
|
||||
$routes->get("kyc-other-docs-delete/(:any)", "ClientController::deleteClientKycOtherDocs/$1");
|
||||
$routes->get("policy-premium", "ClientController::getpolicyGridData/$1");
|
||||
$routes->get("policy-premium", "ClientController::getpolicyGridData/$1");
|
||||
$routes->get("update-policy-status/(:any)", "ClientController::updateClientPolicyStatus/$1");
|
||||
});
|
||||
|
||||
$routes->cli('processjob', 'JobWorker::processJob');
|
||||
|
||||
@ -121,81 +121,77 @@ class ClientController extends AdminController
|
||||
echo view('client_onboarding', $data);
|
||||
echo view('layout/footer');
|
||||
|
||||
}
|
||||
// In your controller
|
||||
public function deposit($id = null)
|
||||
{
|
||||
$headerData['page_name'] = 'Client Deposit';
|
||||
|
||||
$data['clientData'] = $this->clientPolicyModel->getinsurerswithclientid($id);
|
||||
$data['depositsummary'] = $this->clientPolicyModel->getDepositlistsummary($id);
|
||||
|
||||
// Fetch associated insurer names and balances
|
||||
$balances = $this->clientPolicyModel->getBalances($id);
|
||||
$data['balances'] = $balances;
|
||||
|
||||
echo view('layout/header', $headerData);
|
||||
echo view('client_deposit_list', $data);
|
||||
echo view('layout/footer');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function view_Deposit($insurerId) {
|
||||
// Load your model to fetch data based on $clientId and $insurerId
|
||||
$subTypeOptions = [
|
||||
1 => 'Deposit',
|
||||
2 => 'Adjustment',
|
||||
3 => 'Deletion',
|
||||
// Add more options as needed
|
||||
];
|
||||
$data['subTypeOptions'] = $subTypeOptions;
|
||||
// In your controller
|
||||
public function deposit($id = null)
|
||||
{
|
||||
$headerData['page_name'] = 'Client Deposit';
|
||||
$data['insurerName']= $this->insurerModel->getInsurerName($insurerId);
|
||||
$loggedInUserID = get_session_userid();
|
||||
// $data['clientData']= $this->clientPolicyModel->getinsurerswithinsurenceid($insurerId);
|
||||
$clientId = $this->request->getGet('client_id');
|
||||
$data['depositdata']= $this->clientPolicyModel->getdepositData($clientId,$insurerId);
|
||||
$data['clientData'] = $this->clientPolicyModel->getClientById($clientId);
|
||||
$data['deposiamount'] = $this->clientPolicyModel->getDepositSummary($clientId, $insurerId);
|
||||
|
||||
|
||||
// print_r($data['depositdata'] );die;
|
||||
// Load the view for the new list page
|
||||
|
||||
$data['clientData'] = $this->clientPolicyModel->getinsurerswithclientid($id);
|
||||
$data['depositsummary'] = $this->clientPolicyModel->getDepositlistsummary($id);
|
||||
|
||||
// Fetch associated insurer names and balances
|
||||
$balances = $this->clientPolicyModel->getBalances($id);
|
||||
$data['balances'] = $balances;
|
||||
|
||||
echo view('layout/header', $headerData);
|
||||
echo view('view_deposit',$data);
|
||||
echo view('client_deposit_list', $data);
|
||||
echo view('layout/footer');
|
||||
}
|
||||
}
|
||||
|
||||
public function view_Deposit($insurerId)
|
||||
{
|
||||
// Load your model to fetch data based on $clientId and $insurerId
|
||||
$subTypeOptions = [
|
||||
1 => 'Deposit',
|
||||
2 => 'Adjustment',
|
||||
3 => 'Deletion',
|
||||
// Add more options as needed
|
||||
];
|
||||
$data['subTypeOptions'] = $subTypeOptions;
|
||||
$headerData['page_name'] = 'Client Deposit';
|
||||
$data['insurerName']= $this->insurerModel->getInsurerName($insurerId);
|
||||
$loggedInUserID = get_session_userid();
|
||||
// $data['clientData']= $this->clientPolicyModel->getinsurerswithinsurenceid($insurerId);
|
||||
$clientId = $this->request->getGet('client_id');
|
||||
$data['depositdata']= $this->clientPolicyModel->getdepositData($clientId,$insurerId);
|
||||
$data['clientData'] = $this->clientPolicyModel->getClientById($clientId);
|
||||
$data['deposiamount'] = $this->clientPolicyModel->getDepositSummary($clientId, $insurerId);
|
||||
|
||||
|
||||
// print_r($data['depositdata'] );die;
|
||||
// Load the view for the new list page
|
||||
echo view('layout/header', $headerData);
|
||||
echo view('view_deposit',$data);
|
||||
echo view('layout/footer');
|
||||
}
|
||||
|
||||
|
||||
public function saveDeposit()
|
||||
{
|
||||
// Retrieve form data from POST request
|
||||
$loggedInUserID = get_session_userid();
|
||||
|
||||
// Prepare the array with data
|
||||
$data = [
|
||||
'amount' => $this->request->getPost('amount'),
|
||||
'sub_type_id' => $this->request->getPost('sub_type_id'),
|
||||
'client_id' => $this->request->getPost('client_id'),
|
||||
'insurer_id' => $this->request->getPost('insurer_id'),
|
||||
'description' => $this->request->getPost('description'),
|
||||
'transaction_type' => $this->request->getPost('transaction_type') ?: 'Credit',
|
||||
'updated_by' => 1, // You need to set the correct value for updated_by
|
||||
];
|
||||
|
||||
// Call the saveDeposit function from DepositHelper
|
||||
$response = DepositHelper::saveDeposit($data, $loggedInUserID);
|
||||
|
||||
// Return a boolean value based on success
|
||||
return $this->response->setJSON(['success' => $response['success']]);
|
||||
}
|
||||
|
||||
|
||||
public function saveDeposit()
|
||||
{
|
||||
// Retrieve form data from POST request
|
||||
$loggedInUserID = get_session_userid();
|
||||
|
||||
// Prepare the array with data
|
||||
$data = [
|
||||
'amount' => $this->request->getPost('amount'),
|
||||
'sub_type_id' => $this->request->getPost('sub_type_id'),
|
||||
'client_id' => $this->request->getPost('client_id'),
|
||||
'insurer_id' => $this->request->getPost('insurer_id'),
|
||||
'description' => $this->request->getPost('description'),
|
||||
'transaction_type' => $this->request->getPost('transaction_type') ?: 'Credit',
|
||||
'updated_by' => 1, // You need to set the correct value for updated_by
|
||||
];
|
||||
|
||||
// Call the saveDeposit function from DepositHelper
|
||||
$response = DepositHelper::saveDeposit($data, $loggedInUserID);
|
||||
|
||||
// Return a boolean value based on success
|
||||
return $this->response->setJSON(['success' => $response['success']]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function editClientOnboarding($id = null)
|
||||
{
|
||||
|
||||
@ -616,11 +612,10 @@ public function saveDeposit()
|
||||
$si = $this->request->getPost('si');
|
||||
}
|
||||
$age_from = isset($this->request->getPost('age_from')[$i]) ? $this->request->getPost('age_from')[$i] : null;
|
||||
$age_to = isset($this->request->getPost('age_to')[$i]) ? $this->request->getPost('age_to')[$i] : null;
|
||||
$premium = isset($premiumData[$i]) ? $premiumData[$i] : null;
|
||||
$grade = isset($this->request->getPost('grade')[$i]) ? $this->request->getPost('grade')[$i] : null;
|
||||
$max_si = isset($this->request->getPost('max_si')[$i]) ? $this->request->getPost('max_si')[$i] : null;
|
||||
$created_by = get_session_userid();
|
||||
$age_to = isset($this->request->getPost('age_to')[$i]) ? $this->request->getPost('age_to')[$i] : null;
|
||||
$premium = isset($premiumData[$i]) ? $premiumData[$i] : null;
|
||||
$grade = isset($this->request->getPost('grade')[$i]) ? $this->request->getPost('grade')[$i] : null;
|
||||
$max_si = isset($this->request->getPost('max_si')[$i]) ? $this->request->getPost('max_si')[$i] : null;
|
||||
|
||||
if ($si !== null) {
|
||||
$data['si'] = $si;
|
||||
@ -739,6 +734,7 @@ public function saveDeposit()
|
||||
|
||||
|
||||
$data = $this->policesModel->getPolicyPremium($policy_id);
|
||||
$policy_name = $data[0]->policy_name;
|
||||
$pattern = '/gmc/i';
|
||||
$subject = $data[0]->policy_type;
|
||||
if (preg_match($pattern, $subject)) {
|
||||
@ -754,10 +750,11 @@ public function saveDeposit()
|
||||
$premiumData = $this->policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
|
||||
}
|
||||
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($results);
|
||||
// print_r($data[0]->policy_type); die;
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => $results, 'premiumData' => $premiumData, 'count' => $emp_count], 200);
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => $results, 'premiumData' => $premiumData, 'count' => $emp_count, 'policy_name' => $policy_name], 200);
|
||||
|
||||
}
|
||||
|
||||
@ -864,6 +861,7 @@ public function saveDeposit()
|
||||
{
|
||||
$client_id = $this->request->getVar('client_id');
|
||||
$policy_id = $this->request->getVar('policy_id');
|
||||
$policy_name = $this->policesModel->select('name')->where('id', $policy_id)->first();
|
||||
$record = $this->clientPolicyModel->where(['client_id' => $client_id, 'policy_id' => $policy_id])->first();
|
||||
$emp_count = $this->employeeModel ->join('client_policy cp',"employees.client_id = cp.client_id")
|
||||
->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
|
||||
@ -877,9 +875,9 @@ public function saveDeposit()
|
||||
}
|
||||
|
||||
if ($record) {
|
||||
return $this->respond(['Status' => true,'code' => 200,'data' => $record['policy_terms'], 'count' => $emp_count], 200);
|
||||
return $this->respond(['Status' => true,'code' => 200,'data' => $record['policy_terms'], 'count' => $emp_count, 'policy_name' => $policy_name], 200);
|
||||
} else {
|
||||
return $this->respond(['Status' => false,'code' => 200,'message' => 'Record not found.', 'count' => $emp_count], 200);
|
||||
return $this->respond(['Status' => false,'code' => 200,'message' => 'Record not found.', 'count' => $emp_count, 'policy_name' => $policy_name], 200);
|
||||
}
|
||||
|
||||
}
|
||||
@ -994,4 +992,12 @@ public function saveDeposit()
|
||||
|
||||
}
|
||||
|
||||
public function updateClientPolicyStatus($id=null){
|
||||
|
||||
|
||||
$policy_status = $this->clientPolicyModel->where('id', $id )->set('policy_status', 1)->update();
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => $id], 200);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -22,6 +22,7 @@ class PolicesModel extends Model
|
||||
|
||||
return $this->db->table('policies')
|
||||
->select('policy_type.*')
|
||||
->select('policies.name as policy_name')
|
||||
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||
->where('policies.id', $policy_id)
|
||||
->get()
|
||||
|
||||
@ -18,6 +18,7 @@ class PolicyPremium2Model extends Model
|
||||
'age_to',
|
||||
'si',
|
||||
'premium',
|
||||
'max_si',
|
||||
'grade',
|
||||
"created_by",
|
||||
"updated_by",
|
||||
|
||||
@ -38,11 +38,7 @@
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("client/list/"); ?><?= $row->id;?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" href="<?= base_url("client/deposit/{$row->id}"); ?>">
|
||||
<i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>Deposit
|
||||
</a>
|
||||
|
||||
|
||||
<a class="dropdown-item" href="<?= base_url("client/deposit/{$row->id}"); ?>"><i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>Deposit</a>
|
||||
<a class="dropdown-item" href="#"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -91,7 +91,7 @@
|
||||
<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>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<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>
|
||||
</div>
|
||||
@ -126,6 +126,8 @@
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#policy_status_field').hide()
|
||||
|
||||
// Get today's date
|
||||
var today = new Date();
|
||||
|
||||
@ -198,9 +200,15 @@
|
||||
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
|
||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||
<td>
|
||||
<a data-id="${item.id}" class="btnPolicyEdit mdi mdi-lead-pencil" href="#" style="font-size:18px;"></a>
|
||||
<a data-id="${item.policy_id}" class="btnPolicyMaster mdi mdi-wrench" href="#" data-toggle="modal" id="${item.policy_type_id}" style="font-size:18px;"></a>
|
||||
<a data-id="${item.policy_id}" class="btnPolicyModel mdi mdi-book-open" href="#" data-toggle="modal" data-target="#bs-example-modal-lg" style="font-size:18px; margin-left: 7px;"></a>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="#" data-id="${item.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.policy_id}" class="dropdown-item btnPolicyMaster" data-toggle="modal" id="${item.policy_type_id}"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.policy_id}" 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>Rac Rate</a>
|
||||
<a href="#" data-id="${item.id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
@ -212,7 +220,6 @@
|
||||
|
||||
});
|
||||
|
||||
|
||||
/******** for form submit using AJAX *******/
|
||||
$("#policy_form").submit(function(event) {
|
||||
|
||||
@ -297,7 +304,6 @@
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/********* To get th POLICY base on Insurer *******/
|
||||
$('#insurer').change(function() {
|
||||
var id = $(this).val();
|
||||
@ -321,8 +327,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// set the Policy_Type_id for Form Submit
|
||||
/********* set the Policy_Type_id for Form Submit *******/
|
||||
$('#policy').change(function(){
|
||||
|
||||
var dataId = $(this).children('option:selected').attr('data-id');
|
||||
@ -337,7 +342,6 @@
|
||||
|
||||
});
|
||||
|
||||
|
||||
// get the client policy data for edit
|
||||
$('body').on('click', '.btnPolicyEdit', function () {
|
||||
|
||||
@ -354,7 +358,6 @@
|
||||
success: function (res) {
|
||||
|
||||
console.log('clientPolicy : ', res);
|
||||
|
||||
$('#policy_form_action').val('<?= base_url("client/policy/edit"); ?>');
|
||||
|
||||
if (res.status === false) {
|
||||
@ -375,12 +378,17 @@
|
||||
$('#start_date').val(rearrangeDateFormat(res.data.policy_start_date));
|
||||
$('#end_date').val(rearrangeDateFormat(res.data.policy_end_date));
|
||||
$('#policy_status').val(checkDateStatus(res.data.policy_end_date));
|
||||
$('#policy_status_field').show();
|
||||
|
||||
if(res.data.policy_type_id == 1){
|
||||
appendPolicyFormFields(1, res.data);
|
||||
}else if(res.data.policy_type_id >= 2) {
|
||||
appendPolicyFormFields(2, res.data);
|
||||
}
|
||||
/** do not delete this comment condition
|
||||
|
||||
// if(res.data.policy_type_id == 1){
|
||||
// appendPolicyFormFields(1, res.data);
|
||||
// }else if(res.data.policy_type_id >= 2) {
|
||||
// appendPolicyFormFields(2, res.data);
|
||||
// }
|
||||
|
||||
do not delete this comment condition **/
|
||||
|
||||
var policeOptionHTML = '';
|
||||
$.each(res.policy, function(index, item) {
|
||||
@ -396,6 +404,26 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('body').on('click', '.btnOpenEnroll', function () {
|
||||
|
||||
var policy_id = $(this).attr('data-id');
|
||||
console.log(policy_id)
|
||||
if(policy_id){
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
}
|
||||
|
||||
$.get('<?php echo base_url('util/update-policy-status/');?>'+policy_id, function (data) {
|
||||
if(data){
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.success('Policy Status Updated Successfully', 'Success');
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
function appendPolicyFormFields(policy_type, data = false){
|
||||
|
||||
@ -571,57 +599,57 @@
|
||||
|
||||
}
|
||||
|
||||
// Function to convert numbers into Indian numbering system
|
||||
function convertToIndianNumberingSystem(number) {
|
||||
// Define Indian numbering system
|
||||
var suffixes = ["", "Thousand", "Lakh", "Crore"];
|
||||
|
||||
// Split the number into groups of 3 digits each
|
||||
var numberChunks = [];
|
||||
while (number > 0) {
|
||||
numberChunks.push(number % 1000);
|
||||
number = Math.floor(number / 1000);
|
||||
const numberWords = {
|
||||
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 convertNumberToWords(number) {
|
||||
if (number === 0) {
|
||||
return numberWords[number];
|
||||
}
|
||||
|
||||
// Convert each chunk into words
|
||||
var result = "";
|
||||
for (var i = 0; i < numberChunks.length; i++) {
|
||||
if (numberChunks[i] !== 0) {
|
||||
result = convertThreeDigitNumberToWords(numberChunks[i]) + " " + suffixes[i] + " " + result;
|
||||
let word = '';
|
||||
|
||||
if (number >= 10000000) {
|
||||
word += convertNumberToWords(Math.floor(number / 10000000)) + " Crore ";
|
||||
number %= 10000000;
|
||||
}
|
||||
|
||||
if (number >= 100000) {
|
||||
word += convertNumberToWords(Math.floor(number / 100000)) + " Lakh ";
|
||||
number %= 100000;
|
||||
}
|
||||
|
||||
if (number >= 1000) {
|
||||
word += convertNumberToWords(Math.floor(number / 1000)) + " Thousand ";
|
||||
number %= 1000;
|
||||
}
|
||||
|
||||
if (number >= 100) {
|
||||
word += convertNumberToWords(Math.floor(number / 100)) + " Hundred ";
|
||||
number %= 100;
|
||||
}
|
||||
|
||||
if (number > 0) {
|
||||
if (word !== '') {
|
||||
word += "and ";
|
||||
}
|
||||
if (number <= 20) {
|
||||
word += numberWords[number];
|
||||
} else {
|
||||
word += numberWords[Math.floor(number / 10) * 10] + " " + numberWords[number % 10];
|
||||
}
|
||||
}
|
||||
|
||||
return result.trim();
|
||||
return word;
|
||||
}
|
||||
|
||||
// Function to convert a three-digit number into words
|
||||
function convertThreeDigitNumberToWords(num) {
|
||||
var ones = ["", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"];
|
||||
var tens = ["", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"];
|
||||
var teens = ["", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"];
|
||||
|
||||
var words = "";
|
||||
|
||||
// Convert hundreds place
|
||||
if (Math.floor(num / 100) > 0) {
|
||||
words += ones[Math.floor(num / 100)] + " Hundred ";
|
||||
num %= 100;
|
||||
}
|
||||
|
||||
// Convert tens and ones place
|
||||
if (num >= 20) {
|
||||
words += tens[Math.floor(num / 10)] + " ";
|
||||
num %= 10;
|
||||
} else if (num >= 11 && num <= 19) {
|
||||
words += teens[num - 10] + " ";
|
||||
num = 0;
|
||||
}
|
||||
|
||||
if (num > 0) {
|
||||
words += ones[num] + " ";
|
||||
}
|
||||
|
||||
return words.trim();
|
||||
function onlyNumbers(event){
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
if(charcode>= 48 && charcode <= 57)return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -75,7 +75,7 @@
|
||||
|
||||
<div id="policyGMCTerms" style="display:none">
|
||||
<span id="policyGMCTermsClose" style="float: right;font-size: 26px;color: red;margin-top: -42px;margin-left: 3px;margin-right: 7px;">x</span>
|
||||
<h5><label for="gmcTerms" style="margin-bottom: 20px;">Policy GMC Terms</label></h5>
|
||||
<h5><label for="gmcTerms" style="margin-bottom: 20px;">Policy Terms <span id="nameOfThePolicyInGMC"></span></label></h5>
|
||||
<form role="form" class="parsley-examples" method="post" id="policyJsonForm" enctype="multipart/form-data" >
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>"/>
|
||||
<input type="hidden" name="client_id" id="Client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
@ -88,8 +88,11 @@
|
||||
<div class="form-column">
|
||||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||||
<label for="emp_code" class=" " style="width: 400px;">Sum Insured</label>
|
||||
<input type="text" name="sum_insured" id="sum_insured" class="form-control form-control-client-policy-master">
|
||||
<input type="text" name="sum_insured" id="sum_insured" class="form-control form-control-client-policy-master" onkeypress = "return onlyNumbers(event)">
|
||||
</div>
|
||||
|
||||
<div id='numberToWordGMC' class="text-danger" style="float: right;position: relative;right: 25px;bottom: 10px;"></div>
|
||||
|
||||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||||
<label class=" " style="width: 400px;">Family Floater</label><br>
|
||||
<div class="flex-container">
|
||||
@ -471,11 +474,11 @@ var grid_html = '';
|
||||
var client_id = $('#Client_id').val();
|
||||
$('#client_policy_id').val(policy_id);
|
||||
|
||||
var policy_type_id = $(this).attr('id');
|
||||
console.log('policy_type_id', typeof policy_type_id)
|
||||
var gmc_policy_type_id = $(this).attr('id');
|
||||
console.log('gmc_policy_type_id', typeof gmc_policy_type_id)
|
||||
|
||||
|
||||
if(policy_type_id >= '2'){
|
||||
if(gmc_policy_type_id >= '2'){
|
||||
|
||||
$('#policyGMCTerms').css('display', '');
|
||||
$('#police-tab').css('display', 'none');
|
||||
@ -489,6 +492,7 @@ var grid_html = '';
|
||||
data: { policy_id : policy_id , client_id: client_id},
|
||||
success: function(response) {
|
||||
|
||||
$('#nameOfThePolicyInGMC').html(' - ' + response.policy_name.name);
|
||||
$('gmc_emp_count').val(response.count)
|
||||
if(response.count){
|
||||
|
||||
@ -598,6 +602,15 @@ var grid_html = '';
|
||||
|
||||
});
|
||||
|
||||
$("#sum_insured").on("keyup", function() {
|
||||
var inputNumber = parseInt($(this).val());
|
||||
if (!isNaN(inputNumber)) {
|
||||
var result = convertNumberToWords(inputNumber);
|
||||
$("#numberToWordGMC").text(result);
|
||||
} else {
|
||||
$("#numberToWordGMC").text("");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -77,11 +77,11 @@
|
||||
|
||||
<div id="policyGPATermsForm" style="display:none">
|
||||
<span id="policyGPATermsClose" style="float: right;font-size: 26px;color: red;margin-top: -42px;margin-left: 3px;margin-right: 7px;">x</span>
|
||||
<h5><label for="gpaTerms" style="margin-bottom: 20px;">Policy GMC Terms</label></h5>
|
||||
<h5><label for="gpaTerms" style="margin-bottom: 20px;">Policy Terms <span id="nameOfThePolicyInGPA"></span></label></h5>
|
||||
<form role="form" class="parsley-examples" method="post" id="policyGPATerms" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>"/>
|
||||
<input type="hidden" name="client_id" id="Client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<input type="hidden" name="client_policy_id" id="client_policy_id" />
|
||||
<input type="hidden" name="client_policy_id" id="gpa_client_policy_id" />
|
||||
<input type="hidden" name="policy_id" id="gpa_policy_id"/>
|
||||
<input type="hidden" id="emp_count"/>
|
||||
<div class="form-group">
|
||||
@ -90,10 +90,10 @@
|
||||
|
||||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||||
<label for="sumInsured" class=" " style="width: 400px;">Sum Insured</label>
|
||||
<input type="text" name="sumInsured2" id="sumInsured2" class="form-control form-control-client-policy-master"> <br>
|
||||
<input type="text" name="sumInsured2" id="sumInsured2" class="form-control form-control-client-policy-master" onkeypress = "return onlyNumbers(event)"> <br>
|
||||
</div>
|
||||
|
||||
<div id='numberToWord' class="text-danger"></div>
|
||||
<div id='numberToWord' class="text-danger" style="float: right;position: relative;right: 25px;bottom: 10px;"></div>
|
||||
|
||||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||||
<label for="totalSumInsured" class=" " style="width: 400px;">Total Sum Insured</label>
|
||||
@ -393,11 +393,9 @@
|
||||
$('#gpa_policy_id').val(policy_id);
|
||||
|
||||
var client_id = $('#Client_id').val();
|
||||
console.log('client_id :' ,client_id);
|
||||
$('#client_policy_id').val(client_id);
|
||||
$('#gpa_client_policy_id').val(client_id);
|
||||
|
||||
var policy_type_id = $(this).attr('id');
|
||||
console.log('policy_type_id', policy_type_id)
|
||||
|
||||
if(policy_type_id == '1'){
|
||||
|
||||
@ -413,9 +411,12 @@
|
||||
data: { policy_id : policy_id , client_id: client_id},
|
||||
success: function(res) {
|
||||
|
||||
console.log(res)
|
||||
$('#nameOfThePolicyInGPA').html(' - ' + res.policy_name.name);
|
||||
|
||||
if(res.count){
|
||||
|
||||
$('emp_count').val(res.count)
|
||||
$('#emp_count').val(res.count)
|
||||
if(res.count === false){
|
||||
$("#btnGPATermsSubmit").prop("disabled", true);
|
||||
}else{
|
||||
@ -427,7 +428,7 @@
|
||||
if (res) {
|
||||
|
||||
let jsonObject = JSON.parse(res.data);
|
||||
|
||||
$("#numberToWord").text(convertNumberToWords(jsonObject.sumInsured2));
|
||||
if(jsonObject.compassionateVisitExpenses == '1'){
|
||||
var element = $('input[name="compassionateVisitExpenses"]').parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
@ -501,7 +502,7 @@
|
||||
$("#sumInsured2").on("keyup", function() {
|
||||
var inputNumber = parseInt($(this).val());
|
||||
if (!isNaN(inputNumber)) {
|
||||
var result = convertToIndianNumberingSystem(inputNumber);
|
||||
var result = convertNumberToWords(inputNumber);
|
||||
$("#numberToWord").text(result);
|
||||
} else {
|
||||
$("#numberToWord").text("");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user