CHANGE_RACK_RATE_ADD_SECONDARY_RACK_RATE : RV

This commit is contained in:
VENKATESHWARAN 2024-05-28 12:13:33 +05:30
parent d772aac14e
commit 1a029367dd
4 changed files with 715 additions and 261 deletions

View File

@ -783,6 +783,9 @@ class ClientController extends AdminController
public function createClientPolicyPremium()
{
// echo json_encode(['key' => $this->request->getPost()]); die;
try {
$policy_type = $this->request->getPost('policy_type');
$client_id = $this->request->getPost('client_id');
@ -793,6 +796,25 @@ class ClientController extends AdminController
$client_id = $client_policy_data['client_id'];
}
$policy_grid_id = $this->request->getPost('policy_grid_id');
$rack_rate_type = $this->request->getPost('rack_rate_type');
$self = $this->request->getPost('self') ? 1 : 0;
$spouse = $this->request->getPost('spouse')? 1 : 0;
$childrens = $this->request->getPost('childrens')? 1 : 0;
$parents = $this->request->getPost('parents')? 1 : 0;
$parents_in_law = $this->request->getPost('parents-in-law')? 1 : 0;
$either_parents_pil = $this->request->getPost('either-parents-pil')? 1 : 0;
$relation_data['self'] = $self;
$relation_data['spouse'] = $spouse;
$relation_data['childrens'] = $childrens;
$relation_data['parents'] = $parents;
$relation_data['parents_in_law'] = $parents_in_law;
$relation_data['either_parents_pil'] = $either_parents_pil;
$jsonDataForRelation = json_encode($relation_data);
// if($policy_grid_id == 10 || $policy_grid_id == 11){
// $premium_type = 1;
@ -811,6 +833,11 @@ class ClientController extends AdminController
$data['client_policy_id'] = $client_policy_id;
$data['policy_grid_id'] = $policy_grid_id;
$data['premium_type'] = $premium_type;
$data['rack_rate_type'] = $rack_rate_type;
if($rack_rate_type == 1){
$data['additional_relationship'] = $jsonDataForRelation;
}
$premium = [];
@ -818,7 +845,7 @@ class ClientController extends AdminController
if ($policy_grid_id == '1' || $policy_grid_id == '2') {
$this->policyPremium1Model->where('client_id', $client_id)->where('client_policy_id', $client_policy_id)->set('is_active', 0)->update();
} else {
$this->policyPremium2Model->where('client_id', $client_id)->where('client_policy_id', $client_policy_id)->set('is_active', 0)->update();
$this->policyPremium2Model->where('client_id', $client_id)->where('client_policy_id', $client_policy_id)->where('rack_rate_type', $rack_rate_type)->set('is_active', 0)->update();
}
@ -925,6 +952,9 @@ class ClientController extends AdminController
$premium = $this->request->getPost('6_premium[]');
print_r($premium);
$sum_insure = $this->request->getPost('6_si');
$age_from = $this->request->getPost('6_age_from[]');
$age_to = $this->request->getPost('6_age_to[]');
@ -1184,6 +1214,11 @@ class ClientController extends AdminController
$premiumData = "";
}
// echo '<pre>';
// print_r($premiumData); die;
@ -1240,13 +1275,22 @@ class ClientController extends AdminController
$premiumDataa = $premiumData;
}
// print_r($premiumData);die;
// $premium1 = [];
// $premium2 = [];
// print_r($data[0]->policy_type); die;
// echo "hello";
// return json_encode($premiumData);
// foreach ($premiumDataa as $key => $item) {
// if ($item['rack_rate_type'] == 0) {
// $premium1[] = $item;
// } elseif ($item['rack_rate_type'] == 1) {
// $premium2[] = $item;
// }
// }
// print_r($premium1);
// print_r($premium2); die;
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);

View File

@ -25,6 +25,8 @@ class PolicyPremium2Model extends Model
'is_active',
'premium_type',
'relationship',
'additional_relationship',
'rack_rate_type',
];

View File

@ -164,7 +164,7 @@
// });
console.log('responce', response)
//console.log('responce', response)
let messagesList = $('#messages-list');
messagesList.empty();
@ -260,11 +260,11 @@
$('#messages-list').on('click', 'li', function(event) {
console.log('messages-list click li')
//console.log('messages-list click li')
if ($(event.target).closest('.rm_msg').length > 0) {
console.log('.rm_msg')
//console.log('.rm_msg')
let messageId = $(this).data('id');
let url = $(this).data('url');
@ -276,11 +276,11 @@
} else if ($(event.target).closest('.redirect_page').length > 0) {
console.log('redirect_page')
//console.log('redirect_page')
let messageId = $(this).data('id');
let url = $(this).data('url');
console.log('url : ', url)
//console.log('url : ', url)
acknowledgeMessage(messageId);
window.location.href = '<?= base_url() ?>' + url;
@ -304,7 +304,7 @@
method: 'GET',
success: function(response) {
console.log(response);
//console.log(response);
if (response.length == 0) {
@ -332,7 +332,7 @@
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString
//console.log(url)
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
@ -342,15 +342,15 @@
if (!item.branch_name.toLowerCase().includes('branch')) {
console.log(item.branch_name)
//console.log(item.branch_name)
item.branch_name += ' branch';
}
//console.log(item.branch_name);
////console.log(item.branch_name);
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
//console.log(toast_body_data);
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
@ -394,7 +394,7 @@
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
//console.log(url)
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
@ -407,12 +407,12 @@
if (!item.branch_name.toLowerCase().includes('branch')) {
console.log(item.branch_name)
//console.log(item.branch_name)
item.branch_name += ' branch';
}
//console.log(item.branch_name);
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
@ -420,7 +420,7 @@
// }
var toast_body_data = item.client_name + ' - ' + item.branch_name;
//console.log(toast_body_data);
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
@ -469,7 +469,7 @@
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
//console.log(url)
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
@ -481,12 +481,12 @@
if (!item.branch_name.toLowerCase().includes('branch')) {
console.log(item.branch_name)
//console.log(item.branch_name)
item.branch_name += ' branch';
}
//console.log(item.branch_name);
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
@ -494,7 +494,7 @@
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
//console.log(toast_body_data);
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
@ -541,7 +541,7 @@
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
//console.log(url)
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
@ -553,12 +553,12 @@
if (!item.branch_name.toLowerCase().includes('branch')) {
console.log(item.branch_name)
//console.log(item.branch_name)
item.branch_name += ' branch';
}
//console.log(item.branch_name);
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
@ -566,7 +566,7 @@
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
//console.log(toast_body_data);
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
@ -613,7 +613,7 @@
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
//console.log(url)
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
@ -624,12 +624,12 @@
if (!item.branch_name.toLowerCase().includes('branch')) {
console.log(item.branch_name)
//console.log(item.branch_name)
item.branch_name += ' branch';
}
//console.log(item.branch_name);
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
@ -637,7 +637,7 @@
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
//console.log(toast_body_data);
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
@ -684,7 +684,7 @@
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
//console.log(url)
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
@ -695,12 +695,12 @@
if (!item.branch_name.toLowerCase().includes('branch')) {
console.log(item.branch_name)
//console.log(item.branch_name)
item.branch_name += ' branch';
}
//console.log(item.branch_name);
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
@ -708,7 +708,7 @@
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
//console.log(toast_body_data);
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
@ -753,11 +753,11 @@
$('#messages-list-2').on('click', 'li', function(event) {
console.log('messages-list-2 click li')
//console.log('messages-list-2 click li')
if ($(event.target).closest('.rm_msg').length > 0) {
console.log('.rm_msg')
//console.log('.rm_msg')
$(this).delay(300).fadeOut('slow', function() {
$(this).remove();
@ -765,10 +765,10 @@
} else if ($(event.target).closest('.redirect_page').length > 0) {
console.log('redirect_page')
//console.log('redirect_page')
let url = $(this).data('url');
console.log('url : ', url);
//console.log('url : ', url);
window.location.href = '<?= base_url() ?>' + url;
}

File diff suppressed because it is too large Load Diff