CHANGE_ENROLLMENT_FILE_UPLOAD_CR : RV
This commit is contained in:
parent
ecf469842a
commit
707d4710d9
@ -2557,6 +2557,7 @@ class ClientController extends AdminController
|
||||
// $data['special_condition_label'] = str_replace(',', '', $this->request->getPost("special_condition_label")) ?? [];
|
||||
// $data['special_condition_input'] = str_replace(',', '', $this->request->getPost("special_condition_input")) ?? [];
|
||||
// $data['multiple_sum_insured'] = str_replace(',', '', $this->request->getPost("multiple_sum_insured")) ?? [];
|
||||
|
||||
$fields = [
|
||||
'waiverofpreexistingdiseases' => false,
|
||||
'waiverof1,2,3&4thyearexclusions' => false,
|
||||
@ -2611,6 +2612,8 @@ class ClientController extends AdminController
|
||||
|
||||
if ($value !== null && $value !== '') {
|
||||
$data[$field] = $needsCleanup ? str_replace(',', '', $value) : $value;
|
||||
}else{
|
||||
$data[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2877,6 +2880,8 @@ class ClientController extends AdminController
|
||||
try {
|
||||
$this->myLogger->logme('error', 'Policy GPA Terms CREATE function called');
|
||||
|
||||
// print_r($this->request->getPost()); die;
|
||||
|
||||
/*** Client Policy Table Primary Key(ID) ***/
|
||||
$client_policy_id = $this->request->getPost("client_policy_id");
|
||||
|
||||
@ -2948,6 +2953,8 @@ class ClientController extends AdminController
|
||||
$value = $this->request->getPost($field);
|
||||
if ($value !== null) {
|
||||
$data[$field] = str_replace(',', '', $value);
|
||||
}else{
|
||||
$data[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2956,6 +2963,8 @@ class ClientController extends AdminController
|
||||
$value = $this->request->getPost($field);
|
||||
if ($value !== null) {
|
||||
$data[$field] = $value;
|
||||
}else{
|
||||
$data[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -199,13 +199,21 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
$totals = round($totals, 2);
|
||||
|
||||
if($export_data['insurer_or_tpa'] == 'insurer') //check CD amt related issue for only insurer, not tpa
|
||||
//check CD amt insufficient only insurer, not tpa // DO NOT REMOVE THIS
|
||||
if($export_data['insurer_or_tpa'] == 'insurer')
|
||||
{
|
||||
if (!empty($cash_balance)) {
|
||||
if ((int) $cash_balance['balance'] < (int) $totals) {
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount.');
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount. CASH BALANCE : {balance} and TOTAL AMOUNT : {total}', ['balance' => $cash_balance['balance'], 'total' => $totals]);
|
||||
return 0;
|
||||
session()->set('cd_balance', false);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $totals);
|
||||
}else{
|
||||
session()->set('cd_balance', true);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $totals);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -700,13 +708,21 @@ class EmpDataServiceController extends BaseController
|
||||
// echo '<pre>';
|
||||
// print_r($ids); die;
|
||||
|
||||
if($export_data['insurer_or_tpa'] == 'insurer') //check CD amt related issue for only insurer, not tpa
|
||||
//check CD amt insufficiend for only insurer, not tpa // DO NOT REMOVE THIS
|
||||
if($export_data['insurer_or_tpa'] == 'insurer')
|
||||
{
|
||||
if (!empty($cash_balance)) {
|
||||
if ((int) $cash_balance['balance'] < (int) $rounded_totals) {
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount.');
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount. CASH BALANCE : {balance} and TOTAL AMOUNT : {total}', ['balance' => $cash_balance['balance'], 'total' => $totals]);
|
||||
return 0;
|
||||
session()->set('cd_balance', false);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $rounded_totals);
|
||||
}else{
|
||||
session()->set('cd_balance', true);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $rounded_totals);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1003,22 +1019,29 @@ class EmpDataServiceController extends BaseController
|
||||
$cash_balance['balance'] = $balance['opening_bal'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Calculate the total amount from the objects
|
||||
$totals = 0;
|
||||
foreach ($inceptionData as $item) {
|
||||
$totals = $totals + $item->total;
|
||||
}
|
||||
|
||||
$totals = round($totals, 2);
|
||||
|
||||
|
||||
if($export_data['insurer_or_tpa'] != 'tpa')// check overal emp premium amt with cd balance only for insurer export, not tpa export
|
||||
{
|
||||
if (!empty($cash_balance)) {
|
||||
if ((int) $cash_balance['balance'] < (int) $totals) {
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount.');
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount. CASH BALANCE : {balance} and TOTAL AMOUNT : {total}', ['balance' => $cash_balance['balance'], 'total' => $totals]);
|
||||
return 0;
|
||||
session()->set('cd_balance', false);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $totals);
|
||||
}else{
|
||||
session()->set('cd_balance', true);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $totals);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1359,6 +1382,8 @@ class EmpDataServiceController extends BaseController
|
||||
$batch_code = $file['batch_code'];
|
||||
$user_id = $file['created_by'];
|
||||
|
||||
$client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||
|
||||
$insurer_or_tpa = $file['insurer_or_tpa'];
|
||||
if ($insurer_or_tpa == 'tpa') {
|
||||
$id = 'tpa_id';
|
||||
@ -1516,6 +1541,8 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
//--- TPA ID Duplicate check start ---
|
||||
|
||||
// Duplicate checking for only GMC's and GPA
|
||||
if(in_array($client_policy_data['policy_type_id'], [1,2,3,4,5])){
|
||||
$current_tpa_id = $excel_data[$key][13];
|
||||
|
||||
if (isset($tpa_id_all[$current_tpa_id])) {
|
||||
@ -1543,10 +1570,11 @@ class EmpDataServiceController extends BaseController
|
||||
$tpa_id_all[$current_tpa_id][] = $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--- TPA ID Duplicate check end ---
|
||||
|
||||
if ($insurer_or_tpa == 'tpa') {
|
||||
if ($insurer_or_tpa == 'tpa' && in_array($client_policy_data['policy_type_id'], [1,2,3,4,5])) {
|
||||
|
||||
if ($excel_data[$key][13] === null) {
|
||||
$missing_id[$key][] = [
|
||||
@ -1688,7 +1716,7 @@ class EmpDataServiceController extends BaseController
|
||||
];
|
||||
}
|
||||
|
||||
if ($insurer_or_tpa == 'tpa') {
|
||||
if ($insurer_or_tpa == 'tpa' && in_array($client_policy_data['policy_type_id'], [1,2,3,4,5])) {
|
||||
|
||||
if ($emp_value['uhid'] != $excel_data[$key][14]) {
|
||||
$errors[$key][] = [
|
||||
@ -1699,7 +1727,7 @@ class EmpDataServiceController extends BaseController
|
||||
];
|
||||
}
|
||||
|
||||
} else if ($insurer_or_tpa == 'insurer') {
|
||||
} else if ($insurer_or_tpa == 'insurer' && in_array($client_policy_data['policy_type_id'], [1,2,3,4,5])) {
|
||||
|
||||
if ($emp_value['tpa_id'] != $excel_data[$key][13]) {
|
||||
$errors[$key][] = [
|
||||
|
||||
@ -305,7 +305,8 @@ class EmployeeController extends AdminController
|
||||
$data['actions'] = ['inception' => 'Inception (Employee + Dependents)', 'missed_inception' => 'Missed Inception (Employee + Dependents)', 'addition' => 'Addition (Employee + Dependents)', 'dependent_addition' => 'Dependent Addition (Only Dependents)', 'deletion' => 'Deletion', 'correction' => 'Correction', 'si_enhancement' => 'SI Enhancement'];
|
||||
// $data['actions'] = ['inception' => 'Inception (Employee + Dependents)', 'missed_inception' => 'Missed Inception (Employee + Dependents)', 'addition' => 'Addition (Employee + Dependents)', 'dependent_addition' => 'Dependent Addition (Only Dependents)', 'deletion' => 'Deletion', 'correction' => 'Correction', 'si_enhancement' => 'SI Enhancement','enrollment' => 'Enrolment'];
|
||||
|
||||
$data['import_or_export'] = ['import' => 'Import', 'export' => 'Export'];
|
||||
// $data['import_or_export'] = ['import' => 'Import', 'export' => 'Export'];
|
||||
$data['import_or_export'] = ['import' => 'Upload', 'export' => 'Download'];
|
||||
$data['insurer_or_tpa'] = ['insurer' => 'Insurer', 'tpa' => 'TPA'];
|
||||
|
||||
// $data['fileList'] = $this->fileModel
|
||||
|
||||
@ -765,7 +765,12 @@ class PolicyTransactionModel extends Model
|
||||
),
|
||||
2
|
||||
) AS unbilled_amt,
|
||||
created_user.first_name as user_name
|
||||
created_user.first_name as user_name,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
@ -986,7 +991,12 @@ class PolicyTransactionModel extends Model
|
||||
pt_co_share_details.tp_amt AS tp,
|
||||
clients.pan,
|
||||
DATE_FORMAT(policy_transaction.created_at, '%d %b %Y %h:%i %p') AS created_at,
|
||||
user_profiles.first_name as user_name
|
||||
user_profiles.first_name as user_name,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'clients.id = policy_transaction.client_id', 'left')
|
||||
@ -1049,8 +1059,8 @@ class PolicyTransactionModel extends Model
|
||||
|
||||
// Optimize Query Execution
|
||||
$builder->orderBy('policy_transaction.id', 'desc');
|
||||
|
||||
return $builder->get()->getResultArray();
|
||||
$data = $builder->get()->getResultArray();
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@ -1065,7 +1075,12 @@ class PolicyTransactionModel extends Model
|
||||
client_branch.branch_name as client_branch_name,
|
||||
insurers.name AS insurer_name,
|
||||
insurers.short_name AS insurer_short_name,
|
||||
policy_type.policy_type
|
||||
policy_type.policy_type ,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
')
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'policy_transaction.client_id = clients.id', 'left')
|
||||
@ -1228,7 +1243,12 @@ class PolicyTransactionModel extends Model
|
||||
AND co_share_stmt_details.is_active = 1
|
||||
),
|
||||
2
|
||||
) AS variance_amt
|
||||
) AS variance_amt,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
|
||||
|
||||
")
|
||||
@ -1317,7 +1337,6 @@ class PolicyTransactionModel extends Model
|
||||
'clients.client_name',
|
||||
'insurers.name AS insurer_name',
|
||||
'policy_type.policy_type',
|
||||
'policy_transaction.policy_no',
|
||||
'policy_transaction.endorsement_no',
|
||||
"CASE
|
||||
WHEN policy_transaction.action_type = 'inception' THEN 'I'
|
||||
@ -1327,7 +1346,12 @@ class PolicyTransactionModel extends Model
|
||||
'pt_co_share_details.bp_amt',
|
||||
'pt_co_share_details.tp_amt',
|
||||
'pt_co_share_details.tep_amt',
|
||||
'policy_transaction.status'
|
||||
'policy_transaction.status',
|
||||
'CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`'
|
||||
])
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'clients.id = policy_transaction.client_id', 'left')
|
||||
@ -1417,7 +1441,12 @@ class PolicyTransactionModel extends Model
|
||||
policy_transaction.action_type AS action_type_full,
|
||||
pt_co_share_details.exp_amt,
|
||||
pt_co_share_details.variance,
|
||||
policy_transaction.status
|
||||
policy_transaction.status,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'clients.id = policy_transaction.client_id', 'left')
|
||||
@ -1490,7 +1519,6 @@ class PolicyTransactionModel extends Model
|
||||
clients.client_name,
|
||||
insurers.name AS insurer_name,
|
||||
policy_type.policy_type,
|
||||
policy_transaction.policy_no,
|
||||
policy_transaction.endorsement_no,
|
||||
CASE
|
||||
WHEN policy_transaction.action_type = 'inception' THEN 'I'
|
||||
@ -1525,7 +1553,12 @@ class PolicyTransactionModel extends Model
|
||||
inv_payment_details.statement_id = insurer_statements.id
|
||||
AND inv_payment_details.is_active = 1
|
||||
),
|
||||
2) AS outstanding_amount
|
||||
2) AS outstanding_amount,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('insurer_statements', 'pt_co_share_details.statement_id = insurer_statements.id', 'left')
|
||||
|
||||
@ -62,8 +62,8 @@
|
||||
<!-- <td><?php echo isset($file['policy_name']) ? $file['policy_name'] : '' ?> - <?php echo isset($file['policy_no']) ? $file['policy_no'] : '' ?> - <?php echo isset($file['policy_type']) ? $file['policy_type'] : '' ?></td> -->
|
||||
<td><?php echo isset($file['policy_type']) ? $file['policy_type'] : '' ?> - <?php echo isset($file['policy_no']) ? $file['policy_no'] : '' ?></td>
|
||||
<td><?php echo $file['event_type'] ?></td>
|
||||
<td><?php echo $file['insurer_or_tpa'] ?></td>
|
||||
<td><?php echo $file['actions'] ?></td>
|
||||
<td><?php echo $insurer_or_tpa[$file['insurer_or_tpa']] ?></td>
|
||||
<td><?php echo $import_or_export[$file['actions']] ?></td>
|
||||
<td><?php echo $file['count'] == null ? '-' : $file['count'] ?></td>
|
||||
|
||||
<td><?php echo format_indian_number($file['amount'])?></td>
|
||||
|
||||
@ -1,5 +1,26 @@
|
||||
<div class="tab-pane fade" id="police-tab">
|
||||
<style>
|
||||
|
||||
.save-indicator {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
background: #28a745;
|
||||
color: white;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
font-size: 11px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
.save-indicator.show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="save-indicator" id="saveIndicator">Saved</div>
|
||||
<div class="tab-pane fade" id="police-tab">
|
||||
|
||||
<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" style="position: relative;right: 10px;"><span class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy</button>
|
||||
@ -7,7 +28,6 @@
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" id="table_list">
|
||||
|
||||
<table class="table table-borderless table mb-0" id="table-client-policy">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
@ -198,6 +218,7 @@
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
@ -238,7 +259,6 @@
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<script>
|
||||
|
||||
// $('#inception_type').change(function () {
|
||||
// var open_data = $('#open_date').parent();
|
||||
// var close_data = $('#close_date').parent();
|
||||
@ -259,6 +279,8 @@
|
||||
|
||||
var policy_PrimaryKey = $('#client_id_policy').val();
|
||||
var policy_client = $('#policy_PrimaryKey').val();
|
||||
var submitInterval = null;
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
// Initialize select2
|
||||
@ -325,6 +347,7 @@
|
||||
|
||||
|
||||
if (policy_PrimaryKey !== '') {
|
||||
|
||||
var policyTable = '';
|
||||
var data = <?= isset($client_policy) ? json_encode($client_policy) : '[]' ?>;
|
||||
console.log('client_policy_data',data)
|
||||
@ -395,7 +418,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 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}" data-typeid="${item.policy_type_id}" 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}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" ><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}" data-typeid="${item.policy_type_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>Rack Rate</a>`;
|
||||
|
||||
// Conditionally render the delete option based on the role
|
||||
@ -639,7 +662,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 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}" data-typeid="${item.policy_type_id}" 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}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" ><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}" data-typeid="${item.policy_type_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>Rack Rate</a>`;
|
||||
|
||||
// Conditionally render the delete option based on the role
|
||||
@ -1106,7 +1129,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function checkDateStatus(inputDate, bg = false) {
|
||||
|
||||
var givenDate = new Date(inputDate);
|
||||
@ -1250,7 +1272,6 @@
|
||||
return result.trim();
|
||||
}
|
||||
|
||||
|
||||
function onlyNumbers(event) {
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
@ -1258,7 +1279,6 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function formatNumber(input, maxLength) {
|
||||
|
||||
//console.log("input", input);
|
||||
@ -1350,7 +1370,6 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
$('#policy_type').change(function() {
|
||||
|
||||
$('#insurer').val('').change();
|
||||
@ -2110,6 +2129,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
// for CD master
|
||||
$('#cd_ac_no').change(function(){
|
||||
|
||||
let cd_ac_no = $(this).val();
|
||||
@ -2138,5 +2158,119 @@
|
||||
$('#insurer_branch_id').val(firstPart).trigger('change');
|
||||
$('#insurer_id_for_cd').val(secondPart).trigger('change');
|
||||
}
|
||||
// End
|
||||
|
||||
function numberToWordsIndian(num) {
|
||||
|
||||
num = num.toString();
|
||||
if (typeof num === 'string') {
|
||||
// Remove all commas and convert to number
|
||||
num = parseFloat(num.replace(/,/g, ''));
|
||||
// Check if conversion resulted in NaN
|
||||
if (isNaN(num)) {
|
||||
return "invalid number";
|
||||
}
|
||||
}
|
||||
|
||||
if (num === 0) return "zero";
|
||||
if (num < 0) return "minus " + numberToWordsIndian(-num);
|
||||
|
||||
const ones = [
|
||||
"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
|
||||
"ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen",
|
||||
"seventeen", "eighteen", "nineteen"
|
||||
];
|
||||
|
||||
const tens = [
|
||||
"", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"
|
||||
];
|
||||
|
||||
function convertHundreds(n) {
|
||||
let result = "";
|
||||
|
||||
if (n >= 100) {
|
||||
result += ones[Math.floor(n / 100)] + " hundred";
|
||||
n %= 100;
|
||||
if (n > 0) result += " ";
|
||||
}
|
||||
|
||||
if (n >= 20) {
|
||||
result += tens[Math.floor(n / 10)];
|
||||
n %= 10;
|
||||
if (n > 0) result += " " + ones[n];
|
||||
} else if (n > 0) {
|
||||
result += ones[n];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
let result = "";
|
||||
let crores = Math.floor(num / 10000000);
|
||||
num %= 10000000;
|
||||
|
||||
let lakhs = Math.floor(num / 100000);
|
||||
num %= 100000;
|
||||
|
||||
let thousands = Math.floor(num / 1000);
|
||||
num %= 1000;
|
||||
|
||||
let hundreds = num;
|
||||
|
||||
if (crores > 0) {
|
||||
result += convertHundreds(crores) + " crore";
|
||||
if (lakhs > 0 || thousands > 0 || hundreds > 0) result += " ";
|
||||
}
|
||||
|
||||
if (lakhs > 0) {
|
||||
result += convertHundreds(lakhs) + " lakh";
|
||||
if (thousands > 0 || hundreds > 0) result += " ";
|
||||
}
|
||||
|
||||
if (thousands > 0) {
|
||||
result += convertHundreds(thousands) + " thousand";
|
||||
if (hundreds > 0) result += " ";
|
||||
}
|
||||
|
||||
if (hundreds > 0) {
|
||||
result += convertHundreds(hundreds);
|
||||
}
|
||||
|
||||
return result.trim();
|
||||
}
|
||||
|
||||
// Start the interval
|
||||
function startAutoSubmit(attrId) {
|
||||
if (!submitInterval) {
|
||||
submitInterval = setInterval(function() {
|
||||
if(attrId == "GMC"){
|
||||
autoSaveGmcTerms();
|
||||
}else if(attrId == "GPA"){
|
||||
autoSaveGpaTerms();
|
||||
}else if(attrId == "OTHERS"){
|
||||
autoSaveOtherTerms();
|
||||
}
|
||||
}, 20000);
|
||||
console.log("Auto-submit started.");
|
||||
}
|
||||
}
|
||||
|
||||
// Stop the interval
|
||||
function stopAutoSubmit() {
|
||||
if (submitInterval) {
|
||||
clearInterval(submitInterval);
|
||||
submitInterval = null;
|
||||
console.log("Auto-submit stopped.");
|
||||
}
|
||||
}
|
||||
|
||||
//Tiny Toastr
|
||||
function showTinyToast(attrId = "saveIndicator"){
|
||||
const saveIndicator = document.getElementById(attrId);
|
||||
saveIndicator.classList.add('show');
|
||||
setTimeout(() => {
|
||||
saveIndicator.classList.remove('show');
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -89,7 +89,7 @@ input:checked + .slider:before {
|
||||
<input id="addition_add_day" type="checkbox" name="addition_add_day" <?= (isset($insurer['addition_add_day']) && $insurer['addition_add_day'] == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="addition_add_day" style="position: relative;top: 30px;left: 82px;">Add one day to date of coverage when Addition/Dependent addition</label>
|
||||
<label for="addition_add_day" style="position: relative;top: 30px;left: 82px;">Add one day to date of coverage when <br> Addition/Dependent addition</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
<th>S.NO</th>
|
||||
<th>Policy Type</th>
|
||||
<th>Event Type</th>
|
||||
<th>Import/Export</th>
|
||||
<th>Upload/Download</th>
|
||||
<th>Template</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
@ -92,7 +92,7 @@
|
||||
<td><?= $key+1; ?></td>
|
||||
<td><?= $value['policy_type']; ?></td>
|
||||
<td><?= $events[$value['event_name']]; ?></td>
|
||||
<td><?= $value['type_name']; ?></td>
|
||||
<td><?= $value['type_name'] == 'import' ? 'Upload' : 'Download'; ?></td>
|
||||
<td style="overflow: hidden;" class="truncate" ><?= $value['jsoncolumns']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<li class="nav-item">
|
||||
<a href="#template-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="insurer_export_templete">
|
||||
<span class="mr-1"><i class="mdi mdi-file-export font-16"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Insurer Export Templete</span>
|
||||
<span class="d-none d-sm-inline-block">Insurer Download Templete</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
@ -653,10 +653,8 @@
|
||||
|
||||
});
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
$('#import_excel_download').click(function() {
|
||||
|
||||
// Check if the element with ID "import_excel_download" has the href attribute set
|
||||
@ -682,4 +680,87 @@
|
||||
}
|
||||
});
|
||||
|
||||
//------------- CHECK CD BALANCE in SESSION -----------------------------------------------------------------------------------------
|
||||
|
||||
// Global variables
|
||||
var submitInterval = null;
|
||||
var messageShown = false; // Flag to prevent duplicate messages
|
||||
|
||||
//function for checking the session
|
||||
function checkCDBalance() {
|
||||
|
||||
<?php if (session()->has('cd_balance')): ?>
|
||||
var cdBalance = <?php echo json_encode(session()->get('cd_balance')); ?>;
|
||||
var cdAmount = <?php echo json_encode(session()->get('cd_amount')); ?>;
|
||||
var excel_file_amt = <?php echo json_encode(session()->get('excel_file_amt')); ?>;
|
||||
|
||||
console.log("cdBalance : ", cdBalance);
|
||||
console.log("cdAmount : ", cdAmount);
|
||||
console.log("excel_file_amt : ", excel_file_amt);
|
||||
|
||||
// Only show message once and if status is false
|
||||
if (cdBalance === false && !messageShown) {
|
||||
// toastr.warning('Insufficient CD Balance deducated. Please wait the file will be downloaded', 'WARNING');
|
||||
var message1 = 'Insufficient CD Balance deducted. Please wait the file will be downloaded<br>' +
|
||||
'<strong>CD Amount:</strong> ₹' + (cdAmount || 0) + '<br>' +
|
||||
'<strong>Total Amount:</strong> ₹' + (excel_file_amt || 0);
|
||||
|
||||
toastr.warning(message1, 'WARNING', {
|
||||
allowHtml: true,
|
||||
timeOut: 10000,
|
||||
extendedTimeOut: 3000
|
||||
});
|
||||
messageShown = true; // Prevent showing message again
|
||||
stopInterval();
|
||||
} else if (cdBalance === true) {
|
||||
console.log("CD Balance is sufficient");
|
||||
stopInterval();
|
||||
}
|
||||
|
||||
<?php
|
||||
session()->remove('cd_balance');
|
||||
session()->remove('cd_amount');
|
||||
session()->remove('excel_file_amt');
|
||||
?>
|
||||
|
||||
<?php else: ?>
|
||||
console.log("No cd_balance session found");
|
||||
<?php endif; ?>
|
||||
}
|
||||
|
||||
// Start the interval
|
||||
function startInterval() {
|
||||
if (!submitInterval) {
|
||||
messageShown = false; // Reset message flag
|
||||
submitInterval = setInterval(function() {
|
||||
checkCDBalance();
|
||||
}, 2000);
|
||||
console.log("Checking CD balance started...");
|
||||
}
|
||||
}
|
||||
|
||||
// Stop the interval
|
||||
function stopInterval() {
|
||||
if (submitInterval) {
|
||||
clearInterval(submitInterval);
|
||||
submitInterval = null;
|
||||
<?php
|
||||
session()->remove('cd_balance');
|
||||
session()->remove('cd_amount');
|
||||
session()->remove('excel_file_amt');
|
||||
?>
|
||||
console.log("Interval stopped.");
|
||||
}
|
||||
}
|
||||
|
||||
// When click the button to start the interval
|
||||
$(document).ready(function() {
|
||||
$('#emp_form_submit_button_2').on('click', function() {
|
||||
console.log("Submit button clicked, starting interval...");
|
||||
startInterval();
|
||||
});
|
||||
});
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
</script>
|
||||
@ -1,5 +1,5 @@
|
||||
<style>
|
||||
.button-like {
|
||||
.button-like {
|
||||
display: inline-block;
|
||||
padding: 8px 15px;
|
||||
background-color: #02a8b5;
|
||||
@ -8,85 +8,87 @@
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
margin-right: -85px;
|
||||
}
|
||||
}
|
||||
|
||||
.radiobuttondiv {
|
||||
.radiobuttondiv {
|
||||
margin-left: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.form-control-client-policy-master {
|
||||
.form-control-client-policy-master {
|
||||
width: 62% !important;
|
||||
margin-left: 30px;
|
||||
margin-top: 3px
|
||||
}
|
||||
}
|
||||
|
||||
/* .form-group.col-md-6 */
|
||||
.form-group-client-policy-master {
|
||||
/* .form-group.col-md-6 */
|
||||
.form-group-client-policy-master {
|
||||
display: -webkit-box;
|
||||
max-width: 100% !important;
|
||||
/* border:1px solid; */
|
||||
/* background-color: #0001; */
|
||||
}
|
||||
}
|
||||
|
||||
.form-group-client-policy-masters {
|
||||
.form-group-client-policy-masters {
|
||||
display: -webkit-box;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-container {
|
||||
.flex-container {
|
||||
display: block;
|
||||
/* flex-wrap: wrap; */
|
||||
/* align-items: center; Align items vertically center */
|
||||
}
|
||||
}
|
||||
|
||||
.flex-container>div {
|
||||
.flex-container>div {
|
||||
flex: 1;
|
||||
/* Each div takes equal space */
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
label {
|
||||
padding-top: 7px;
|
||||
width: 400px;
|
||||
/* background-color: #0001; */
|
||||
height: 36px;
|
||||
/* text-align: center; */
|
||||
}
|
||||
}
|
||||
|
||||
.jodit-status-bar {
|
||||
.jodit-status-bar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.input-group {
|
||||
.input-group {
|
||||
width: 64.5% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.input-group-append-client-policy-master {
|
||||
.input-group-append-client-policy-master {
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.jodit-wysiwyg {
|
||||
.jodit-wysiwyg {
|
||||
margin-bottom: 162px;
|
||||
}
|
||||
}
|
||||
|
||||
.form-control-client-policy-masters {
|
||||
.form-control-client-policy-masters {
|
||||
margin-left: 30px;
|
||||
width: 689px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="OtherPolicyTermsForm" style="display:none">
|
||||
|
||||
<span id="otherPolicyTermsClose"
|
||||
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 Terms <span
|
||||
id="nameOfThePolicyOnOther"></span></label>
|
||||
<span id="otherPolicyTermsClose" 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 Terms <span id="nameOfThePolicyOnOther"></span></label>
|
||||
</h5>
|
||||
|
||||
<form role="form" class="parsley-examples" method="post" id="otherPolicyTerms" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
|
||||
<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="other_client_policy_id" />
|
||||
<input type="hidden" name="policy_id" id="gpa_policy_id" />
|
||||
<input type="hidden" id="emp_count" />
|
||||
|
||||
<div id="sumInsuredDiv" class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="sumInsured">Sum Insured</label>
|
||||
@ -119,14 +121,13 @@ label {
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnOtherTermsSubmit"
|
||||
style="margin-top: 100px;">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$("#otherPolicyTerms").submit(function(event) {
|
||||
|
||||
$("#otherPolicyTerms").submit(function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
@ -170,8 +171,7 @@ $("#otherPolicyTerms").submit(function(event) {
|
||||
}
|
||||
});
|
||||
|
||||
console.log(formObject);
|
||||
|
||||
console.log("formObject : ", formObject);
|
||||
|
||||
const jsonString = JSON.stringify(formObject);
|
||||
console.log(jsonString);
|
||||
@ -226,13 +226,13 @@ $("#otherPolicyTerms").submit(function(event) {
|
||||
toastr.success(message, 'Success');
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
var policy_type_id = "";
|
||||
$('body').on('click', '.btnPolicyMaster', function() {
|
||||
|
||||
var policy_type_id = "";
|
||||
$('body').on('click', '.btnPolicyMaster', function() {
|
||||
$("#append_html_for_other_policy_terms").empty();
|
||||
|
||||
|
||||
var client_policy_id = $(this).data('id');
|
||||
policy_type_id = $(this).data('typeid');
|
||||
console.log('policy_type_id', policy_type_id);
|
||||
@ -270,10 +270,8 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 500);
|
||||
|
||||
// $('#nameOfThePolicyOnOther').html(' - ' + res.policy_name.name);
|
||||
|
||||
|
||||
$('#emp_count').val(res.count)
|
||||
if (res.emp_count_by_policy != 0) {
|
||||
$("#btnOtherTermsSubmit").hide();
|
||||
@ -281,6 +279,7 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
} else {
|
||||
$("#btnOtherTermsSubmit").show();
|
||||
$("#otherButtonSpecialCondition").show();
|
||||
startAutoSubmit('OTHERS');
|
||||
}
|
||||
|
||||
|
||||
@ -405,13 +404,11 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
$('#sum_insured_others').trigger('keyup');
|
||||
$(".multiple_sum_insured").trigger("keyup");
|
||||
|
||||
|
||||
},
|
||||
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
@ -428,21 +425,21 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
$("#sumInsuredDiv").empty();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
document.getElementById('otherButtonSpecialCondition').addEventListener('click', function(event) {
|
||||
|
||||
document.getElementById('otherButtonSpecialCondition').addEventListener('click', function(event) {
|
||||
|
||||
console.log('specialConditionForOthers callback clicked')
|
||||
event.preventDefault();
|
||||
specialConditionForOthers();
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function specialConditionForOthers(count = 0) {
|
||||
function specialConditionForOthers(count = 0) {
|
||||
|
||||
console.log('specialConditionForOthers function called')
|
||||
|
||||
@ -470,20 +467,22 @@ function specialConditionForOthers(count = 0) {
|
||||
|
||||
console.log('else')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('click', '#otherPolicyTermsClose', function() {
|
||||
|
||||
//clear the intervel for the autosave
|
||||
stopAutoSubmit();
|
||||
|
||||
$(document).on('click', '#otherPolicyTermsClose', function() {
|
||||
$('#OtherPolicyTermsForm').css('display', 'none');
|
||||
$('#police-tab').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display', '');
|
||||
$('#otherPolicyTerms')[0].reset();
|
||||
$('.text-danger-2').html('');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#sum_insured_others").on("keyup", function() {
|
||||
$("#sum_insured_others").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
console.log('sum_insured_others keyup', inputNumber)
|
||||
if (inputNumber) {
|
||||
@ -492,10 +491,9 @@ $("#sum_insured_others").on("keyup", function() {
|
||||
} else {
|
||||
$("#numberToWordOthers").text("");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#totalSumInsured").on("keyup", function() {
|
||||
$("#totalSumInsured").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
@ -503,10 +501,9 @@ $("#totalSumInsured").on("keyup", function() {
|
||||
} else {
|
||||
$("#numberToWordTotalSumInsured").text("");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function si_keup_num_to_word2(input) {
|
||||
function si_keup_num_to_word2(input) {
|
||||
|
||||
console.log('keyup sum insured');
|
||||
var inputNumber = $(input).val();
|
||||
@ -518,10 +515,9 @@ function si_keup_num_to_word2(input) {
|
||||
} else {
|
||||
$("#numberToWordOthers").text("");
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
function appendPolicyTermsHTML(policy_type) {
|
||||
function appendPolicyTermsHTML(policy_type) {
|
||||
|
||||
var termsHTML = ""
|
||||
$('#append_html_for_other_policy_terms').empty();
|
||||
@ -731,10 +727,9 @@ function appendPolicyTermsHTML(policy_type) {
|
||||
}
|
||||
|
||||
$('#append_html_for_other_policy_terms').append(termsHTML);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function appendOtherSIAddMore(data = null) {
|
||||
function appendOtherSIAddMore(data = null) {
|
||||
|
||||
const addMoreContainer = document.getElementById('sum_insured_add_more');
|
||||
|
||||
@ -762,14 +757,83 @@ function appendOtherSIAddMore(data = null) {
|
||||
</div>`;
|
||||
|
||||
addMoreContainer.insertAdjacentHTML('beforeend', html);
|
||||
}
|
||||
}
|
||||
|
||||
function beautifyString(str) {
|
||||
function beautifyString(str) {
|
||||
return str
|
||||
.split('_') // Split the string by underscores
|
||||
.map(word =>
|
||||
word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() // Capitalize each word
|
||||
)
|
||||
.join(' '); // Join with spaces instead of underscores
|
||||
}
|
||||
}
|
||||
|
||||
function autoSaveOtherTerms(){
|
||||
|
||||
console.log('autoSaveOtherTerms function called');
|
||||
|
||||
var formData = new FormData($('#otherPolicyTerms')[0]);
|
||||
console.log("formData", formData);
|
||||
|
||||
var policy_form_action = '<?= base_url("client/terms/other_terms") ?>';
|
||||
console.log("policy_form_action", policy_form_action);
|
||||
|
||||
// Convert the FormData object to a JSON object
|
||||
const formObject = {};
|
||||
formData.forEach((value, key) => {
|
||||
if (key != 'csrf_test_name' && key != 'client_policy_id' && key != 'policy_id' && key !=
|
||||
'client_id') {
|
||||
|
||||
if (key.endsWith('[]')) {
|
||||
const baseKey = key.slice(0, -2);
|
||||
if (!formObject[baseKey]) {
|
||||
formObject[baseKey] = [];
|
||||
}
|
||||
formObject[baseKey].push(value.replace(/,/g, ''));
|
||||
} else if(key == 'sum_insureds'){
|
||||
formObject['sum_insured'] = value.replace(/,/g, '');
|
||||
}
|
||||
else {
|
||||
formObject[key] = value;
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log("formObject : ", formObject);
|
||||
|
||||
const jsonString = JSON.stringify(formObject);
|
||||
console.log('jsonString', jsonString);
|
||||
|
||||
// Append the JSON string to the FormData object
|
||||
formData.append('policy_terms', jsonString);
|
||||
|
||||
formData.forEach((value, key) => {
|
||||
console.log(key + ': ' + value);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: policy_form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log('Auto Save Response : ', res);
|
||||
|
||||
if (res.status == true) {
|
||||
showTinyToast();
|
||||
}else{
|
||||
console.log('Policy terms Dose Not save', 'Error');
|
||||
return;
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -97,8 +97,6 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
@ -878,7 +876,6 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var policy_grid_id = $('#client_id').val();
|
||||
var grid_html = '';
|
||||
@ -1012,7 +1009,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var specialConditions = [];
|
||||
|
||||
$(".removeDom").each(function() {
|
||||
@ -1086,7 +1082,6 @@
|
||||
}, 500);
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.btnPolicyMaster', function() {
|
||||
// alert("HELLO");
|
||||
|
||||
@ -1128,17 +1123,15 @@
|
||||
// $('#nameOfThePolicyInGMC').html(' - ' + response.policy_name.name);
|
||||
$('gmc_emp_count').val(response.count);
|
||||
|
||||
|
||||
if (response) {
|
||||
|
||||
if (response.emp_count_by_policy != 0) {
|
||||
|
||||
$('#btnGridSubmit1').hide();
|
||||
$('#myButtonSpecialCondition').hide();
|
||||
|
||||
} else {
|
||||
$('#btnGridSubmit1').show();
|
||||
$('#myButtonSpecialCondition').show();
|
||||
startAutoSubmit('GMC');
|
||||
}
|
||||
|
||||
let jsonObject = JSON.parse(response.data);
|
||||
@ -1558,27 +1551,12 @@
|
||||
$("#numberToWordGMC").text("");
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Jodit RTE -->
|
||||
<script>
|
||||
// $(document).ready(function() {
|
||||
// var editor = new Jodit('#additionalsicknessbenefit', {
|
||||
// buttons: 'bold,italic,underline,|,align,alignCenter,alignRight,alignJustify',
|
||||
// });
|
||||
|
||||
// var editor = new Jodit('#Wellness', {
|
||||
// buttons: 'bold,italic,underline,|,align,alignCenter,alignRight,alignJustify',
|
||||
// });
|
||||
// });
|
||||
//
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<!-- Policy terms Add Special Condition -->
|
||||
<script>
|
||||
|
||||
document.getElementById('myButtonSpecialCondition').addEventListener('click', function(event) {
|
||||
//console.log('specialCondition callback clicked')
|
||||
event.preventDefault();
|
||||
@ -1632,7 +1610,6 @@
|
||||
'multiple_sum_insured'
|
||||
];
|
||||
|
||||
|
||||
function specialCondition(count = 0) {
|
||||
|
||||
//console.log('specialCondition function called')
|
||||
@ -1670,6 +1647,10 @@
|
||||
|
||||
// Close the Policy terms
|
||||
$(document).on('click', '#policyGMCTermsClose', function() {
|
||||
|
||||
//clear the intervel for the autosave
|
||||
stopAutoSubmit();
|
||||
|
||||
$('#policyGMCTerms').css('display', 'none');
|
||||
$('#police-tab').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').css('display', '');
|
||||
@ -1930,4 +1911,64 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function autoSaveGmcTerms()
|
||||
{
|
||||
|
||||
console.log("autoSaveGmcTerms function called");
|
||||
|
||||
var specialConditions = [];
|
||||
|
||||
$(".removeDom").each(function() {
|
||||
var isChecked = $(this).find("input[name='special_condition_display[]']").is(":checked");
|
||||
|
||||
if (isChecked) {
|
||||
var label = $(this).find("input[name='special_condition_label[]']").val();
|
||||
var input = $(this).find("input[name='special_condition_input[]']").val();
|
||||
|
||||
specialConditions.push({
|
||||
[label]: input
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log("specialConditions", specialConditions);
|
||||
|
||||
var formData = new FormData($('#policyJsonForm')[0]);
|
||||
console.log("formData", formData);
|
||||
|
||||
var policy_form_action = '<?= base_url("client/policy/policyGMCTerms") ?>';
|
||||
console.log("policy_form_action", policy_form_action);
|
||||
|
||||
formData.append("special_condition_display_value", JSON.stringify(specialConditions));
|
||||
// console.log('formData', formData);
|
||||
formData.forEach((value, key) => {
|
||||
// console.log(key + ':', value);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: policy_form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log('Auto Save Response : ', res);
|
||||
|
||||
if (res.status == true) {
|
||||
showTinyToast();
|
||||
}else{
|
||||
console.log('Policy terms Dose Not save', 'Error');
|
||||
return;
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -1,5 +1,6 @@
|
||||
<style>
|
||||
.button-like {
|
||||
|
||||
.button-like {
|
||||
display: inline-block;
|
||||
padding: 8px 15px;
|
||||
background-color: #02a8b5;
|
||||
@ -8,83 +9,89 @@
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
margin-right: -85px;
|
||||
}
|
||||
}
|
||||
|
||||
.radiobuttondiv {
|
||||
.radiobuttondiv {
|
||||
margin-left: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.form-control-client-policy-master {
|
||||
.form-control-client-policy-master {
|
||||
width: 62% !important;
|
||||
margin-left: 30px;
|
||||
margin-top: 3px
|
||||
}
|
||||
}
|
||||
|
||||
/* .form-group.col-md-6 */
|
||||
.form-group-client-policy-master {
|
||||
/* .form-group.col-md-6 */
|
||||
.form-group-client-policy-master {
|
||||
display: -webkit-box;
|
||||
max-width: 100% !important;
|
||||
/* border:1px solid; */
|
||||
/* background-color: #0001; */
|
||||
}
|
||||
}
|
||||
|
||||
.form-group-client-policy-masters {
|
||||
.form-group-client-policy-masters {
|
||||
display: -webkit-box;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-container {
|
||||
.flex-container {
|
||||
display: block;
|
||||
/* flex-wrap: wrap; */
|
||||
/* align-items: center; Align items vertically center */
|
||||
}
|
||||
}
|
||||
|
||||
.flex-container>div {
|
||||
.flex-container>div {
|
||||
flex: 1;
|
||||
/* Each div takes equal space */
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
label {
|
||||
padding-top: 7px;
|
||||
width: 400px;
|
||||
/* background-color: #0001; */
|
||||
height: 36px;
|
||||
/* text-align: center; */
|
||||
}
|
||||
}
|
||||
|
||||
.jodit-status-bar {
|
||||
.jodit-status-bar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.input-group {
|
||||
.input-group {
|
||||
width: 64.5% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.input-group-append-client-policy-master {
|
||||
.input-group-append-client-policy-master {
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.jodit-wysiwyg {
|
||||
.jodit-wysiwyg {
|
||||
margin-bottom: 162px;
|
||||
}
|
||||
}
|
||||
|
||||
.form-control-client-policy-masters {
|
||||
.form-control-client-policy-masters {
|
||||
margin-left: 30px;
|
||||
width: 689px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<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 Terms <span id="nameOfThePolicyInGPA"></span></label>
|
||||
|
||||
<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 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="gpa_client_policy_id" />
|
||||
<input type="hidden" name="policy_id" id="gpa_policy_id" />
|
||||
<input type="hidden" id="emp_count" />
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
@ -453,99 +460,21 @@ label {
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="form-group text-right m-b-0" style="margin-top: -49px;">
|
||||
<a href="#" class="button-like" id="gpaButtonSpecialCondition" title="Special Condition">Special
|
||||
Condition</a>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnGPATermsSubmit"
|
||||
style="margin-top: 100px;">Submit</button>
|
||||
<a href="#" class="button-like" id="gpaButtonSpecialCondition" title="Special Condition">Special Condition</a>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnGPATermsSubmit" style="margin-top: 100px;">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var policy_grid_id = $('#client_id').val();
|
||||
var grid_html = '';
|
||||
|
||||
$('.close').click(function() {
|
||||
var policy_grid_id = $('#client_id').val();
|
||||
var grid_html = '';
|
||||
|
||||
});
|
||||
|
||||
|
||||
// $('input[name="burnExpenses"]').change(function() {
|
||||
|
||||
// console.log($(this).val());
|
||||
|
||||
// if ($(this).val() == '1') {
|
||||
// var element = $(this).parent().parent().next()[0];
|
||||
// $(element).css("display", "");
|
||||
|
||||
// } else {
|
||||
// var element = $(this).parent().parent().next()[0];
|
||||
// $(element).css("display", "none");
|
||||
// }
|
||||
// });
|
||||
|
||||
// $('input[name="compassionateVisitExpenses"]').change(function() {
|
||||
|
||||
// console.log($(this).val());
|
||||
|
||||
// if ($(this).val() == '1') {
|
||||
// var element = $(this).parent().parent().next()[0];
|
||||
// $(element).css("display", "");
|
||||
|
||||
// } else {
|
||||
// var element = $(this).parent().parent().next()[0];
|
||||
// $(element).css("display", "none");
|
||||
// }
|
||||
// });
|
||||
|
||||
// $('input[name="carriageOfDeadBody"]').change(function() {
|
||||
|
||||
// console.log($(this).val());
|
||||
|
||||
// if ($(this).val() == '1') {
|
||||
// var element = $(this).parent().parent().next()[0];
|
||||
// $(element).css("display", "");
|
||||
|
||||
// } else {
|
||||
// var element = $(this).parent().parent().next()[0];
|
||||
// $(element).css("display", "none");
|
||||
// }
|
||||
// });
|
||||
|
||||
// $('input[name="ambulanceCharges"]').change(function() {
|
||||
|
||||
// console.log($(this).val());
|
||||
|
||||
// if ($(this).val() == '1') {
|
||||
// var element = $(this).parent().parent().next()[0];
|
||||
// $(element).css("display", "");
|
||||
|
||||
// } else {
|
||||
// var element = $(this).parent().parent().next()[0];
|
||||
// $(element).css("display", "none");
|
||||
// }
|
||||
// });
|
||||
|
||||
// $('input[name="brokenBoneExpenses"]').change(function() {
|
||||
|
||||
// console.log($(this).val());
|
||||
|
||||
// if ($(this).val() == '1') {
|
||||
// var element = $(this).parent().parent().next()[0];
|
||||
// $(element).css("display", "");
|
||||
|
||||
// } else {
|
||||
// var element = $(this).parent().parent().next()[0];
|
||||
// $(element).css("display", "none");
|
||||
// }
|
||||
// });
|
||||
|
||||
$("#policyGPATerms").submit(function(event) {
|
||||
$("#policyGPATerms").submit(function(event) {
|
||||
|
||||
|
||||
if (!$('#self').prop('checked')) {
|
||||
@ -589,7 +518,6 @@ $("#policyGPATerms").submit(function(event) {
|
||||
var policy_form_action = '<?= base_url("client/terms/gpa_create") ?>';
|
||||
formData.append("gpa_special_condition_display_value", JSON.stringify(specialConditions));
|
||||
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: policy_form_action,
|
||||
@ -631,9 +559,9 @@ $("#policyGPATerms").submit(function(event) {
|
||||
toastr.success(message, 'Success');
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$('body').on('click', '.btnPolicyMaster', function() {
|
||||
$('body').on('click', '.btnPolicyMaster', function() {
|
||||
|
||||
var client_policy_id = $(this).data('id');
|
||||
// console.log('client_policy_id :' ,client_policy_id);
|
||||
@ -671,7 +599,6 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
}, 1000);
|
||||
// $('#nameOfThePolicyInGPA').html(' - ' + res.policy_name.name);
|
||||
|
||||
|
||||
$('#emp_count').val(res.count)
|
||||
if (res.emp_count_by_policy != 0) {
|
||||
$("#btnGPATermsSubmit").hide();
|
||||
@ -679,6 +606,7 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
} else {
|
||||
$("#btnGPATermsSubmit").show();
|
||||
$("#gpaButtonSpecialCondition").show();
|
||||
startAutoSubmit('GPA');
|
||||
}
|
||||
|
||||
|
||||
@ -848,13 +776,13 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
// toastr.warning("This policy has no policy terms.", 'warning');
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
const gpaFields = [
|
||||
const gpaFields = [
|
||||
'accidentalDeathBenefit',
|
||||
'permanentTotalDisablement',
|
||||
'permanentPartialDisablement',
|
||||
@ -879,18 +807,17 @@ const gpaFields = [
|
||||
'gpa_special_condition_label',
|
||||
'gpa_special_condition_input',
|
||||
'multiple_sum_insured'
|
||||
];
|
||||
];
|
||||
|
||||
|
||||
document.getElementById('gpaButtonSpecialCondition').addEventListener('click', function(event) {
|
||||
document.getElementById('gpaButtonSpecialCondition').addEventListener('click', function(event) {
|
||||
|
||||
console.log('specialConditionForGPA callback clicked')
|
||||
event.preventDefault();
|
||||
specialConditionForGPA();
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function specialConditionForGPA(count = 0) {
|
||||
function specialConditionForGPA(count = 0) {
|
||||
|
||||
console.log('specialConditionForGPA function called')
|
||||
|
||||
@ -920,9 +847,13 @@ function specialConditionForGPA(count = 0) {
|
||||
|
||||
console.log('else')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('click', '#policyGPATermsClose', function() {
|
||||
|
||||
//clear the intervel for the autosave
|
||||
stopAutoSubmit();
|
||||
|
||||
$(document).on('click', '#policyGPATermsClose', function() {
|
||||
$('#policyGPATermsForm').css('display', 'none');
|
||||
$('#police-tab').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').css('display', '');
|
||||
@ -930,34 +861,34 @@ $(document).on('click', '#policyGPATermsClose', function() {
|
||||
$('#policyGPATerms')[0].reset();
|
||||
$('.text-danger-2').html('');
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$("#sumInsured2").on("keyup", function() {
|
||||
$("#sumInsured2").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
var result = numberToWordsIndian(inputNumber);
|
||||
$("#numberToWordSumInsured").text(result);
|
||||
} else {
|
||||
$("#numberToWordSumInsured").text("");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".multiple_sum_insured").on("keyup", function() {
|
||||
$(".multiple_sum_insured").on("keyup", function() {
|
||||
|
||||
console.log('multiple_sum_insured key up')
|
||||
|
||||
var inputNumber = $(this).val();
|
||||
console.log('inputNumber', inputNumber);
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
var result = numberToWordsIndian(inputNumber);
|
||||
console.log(result);
|
||||
$(".numberToWordSumInsured").text(result);
|
||||
} else {
|
||||
$(".numberToWordSumInsured").text("");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function numtowordinkeyup(input) {
|
||||
function numtowordinkeyup(input) {
|
||||
console.log('testing......')
|
||||
console.log(input);
|
||||
|
||||
@ -965,7 +896,7 @@ function numtowordinkeyup(input) {
|
||||
console.log('inputNumber', inputNumber);
|
||||
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
var result = numberToWordsIndian(inputNumber);
|
||||
console.log(result);
|
||||
var $parentRow = $(input).closest('.row');
|
||||
console.log('$parentRow', $parentRow)
|
||||
@ -974,9 +905,9 @@ function numtowordinkeyup(input) {
|
||||
console.log('$targetDiv', $targetDiv)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$("#totalSumInsured").on("keyup", function() {
|
||||
$("#totalSumInsured").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
@ -984,9 +915,9 @@ $("#totalSumInsured").on("keyup", function() {
|
||||
} else {
|
||||
$("#numberToWordTotalSumInsured").text("");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function appendGPASIAddMore(data = null) {
|
||||
function appendGPASIAddMore(data = null) {
|
||||
|
||||
console.log('appendGPASIAddMore function called')
|
||||
console.log('appendGPASIAddMore function data', data)
|
||||
@ -1011,13 +942,13 @@ function appendGPASIAddMore(data = null) {
|
||||
</div>`;
|
||||
|
||||
$('#gpa_si_add_more').append(html);
|
||||
}
|
||||
}
|
||||
|
||||
function inArray(key, array) {
|
||||
function inArray(key, array) {
|
||||
return array.includes(key);
|
||||
}
|
||||
}
|
||||
|
||||
function processJsonObject2(jsonObject) {
|
||||
function processJsonObject2(jsonObject) {
|
||||
|
||||
if (typeof jsonObject !== 'object' || Array.isArray(jsonObject)) {
|
||||
console.log("jsonObject Input is not a valid object.");
|
||||
@ -1068,9 +999,9 @@ function processJsonObject2(jsonObject) {
|
||||
console.log(`${key} is not an object.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function disableUnwantedTermsforGPA(jsonObject) {
|
||||
function disableUnwantedTermsforGPA(jsonObject) {
|
||||
// alert("Disabling unwanted terms");
|
||||
|
||||
gpaFields.forEach(function(key) {
|
||||
@ -1102,4 +1033,57 @@ function disableUnwantedTermsforGPA(jsonObject) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function autoSaveGpaTerms(){
|
||||
|
||||
console.log('autoSaveGpaTerms function called');
|
||||
|
||||
var specialConditions = [];
|
||||
|
||||
$(".removeDom").each(function () {
|
||||
var isChecked = $(this).find("input[name='gpa_special_condition_display[]']").is(":checked");
|
||||
|
||||
if (isChecked) {
|
||||
var label = $(this).find("input[name='gpa_special_condition_label[]']").val();
|
||||
var input = $(this).find("input[name='gpa_special_condition_input[]']").val();
|
||||
|
||||
specialConditions.push({ [label]: input });
|
||||
}
|
||||
});
|
||||
|
||||
console.log("gpa_specialConditions", specialConditions);
|
||||
|
||||
var formData = new FormData($('#policyGPATerms')[0]);
|
||||
console.log("formData", formData);
|
||||
|
||||
var policy_form_action = '<?= base_url("client/terms/gpa_create") ?>';
|
||||
console.log("policy_form_action", policy_form_action);
|
||||
|
||||
formData.append("gpa_special_condition_display_value", JSON.stringify(specialConditions));
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: policy_form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log('Auto Save Response : ', res);
|
||||
|
||||
if (res.status == true) {
|
||||
showTinyToast();
|
||||
}else{
|
||||
console.log('Policy terms Dose Not save', 'Error');
|
||||
return;
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -189,6 +189,7 @@ $(document).on('click', '.close', function() {
|
||||
|
||||
var rarc_rate_json_array = [];
|
||||
|
||||
//Submit function
|
||||
$(document).on('submit', 'form[id^="GridForm_"]', function(event) {
|
||||
console.log('submitted function called')
|
||||
event.preventDefault(); // Prevent the default form submission
|
||||
@ -619,8 +620,6 @@ $('body').on('click', '.btnPolicyModel', function()
|
||||
$('#no_data').html('The policy has no Policy Rack Rate');
|
||||
toastr.warning("The policy has no Policy Rack Rate", "Warning")
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$(document).on('change', 'select[id^="grid_"]', function(event)
|
||||
|
||||
@ -421,15 +421,15 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="bp_cgst">Latest Action Date</label>
|
||||
<input id="last_action_date" type="text" class="form-control" name="last_action_date" placeholder="DD/MM/YYYY">
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="fund_received">Fund Recd / Sent to Insurer</label>
|
||||
<input id="fund_received" value="" type="text" class="form-control" name="fund_received">
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="switch" style="position: relative;top: 32px;left: 20px;">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user