Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
f11ddd5cec
@ -113,7 +113,8 @@ class PolicyTransactionController extends BaseController
|
||||
|
||||
// Policy Transaction Inception
|
||||
public function viewInception()
|
||||
{
|
||||
{
|
||||
$bds_edit_pt_id = $this->request->getGet('pt_id') ?? null;
|
||||
$data['tab_name'] = 'Policy';
|
||||
$data['page_name'] = 'Policy';
|
||||
|
||||
@ -183,34 +184,38 @@ class PolicyTransactionController extends BaseController
|
||||
$issuer = empty($issuer) ? 0 : $issuer;
|
||||
$status = empty($status) ? 0 : $status; // Corrected from `$issuer`
|
||||
|
||||
if ($this->request->is('get')) {
|
||||
if(empty($bds_edit_pt_id)){
|
||||
if ($this->request->is('get')) {
|
||||
|
||||
// Fetch inception data list
|
||||
$data['inception_data_list'] = $this->policyTransactionModel->getInceptionTranctionListData(
|
||||
$start_date,
|
||||
$end_date,
|
||||
$client_id,
|
||||
$insurer_id,
|
||||
$policy_type_id,
|
||||
$date_type,
|
||||
$issuer,
|
||||
$status
|
||||
);
|
||||
} else {
|
||||
// Fetch inception data list
|
||||
$data['inception_data_list'] = $this->policyTransactionModel->getInceptionTranctionListData(
|
||||
$start_date,
|
||||
$end_date,
|
||||
$client_id,
|
||||
$insurer_id,
|
||||
$policy_type_id,
|
||||
$date_type,
|
||||
$issuer,
|
||||
$status
|
||||
);
|
||||
} else {
|
||||
|
||||
$ids = $this->request->getPost('ids');
|
||||
$ids = array_filter(explode(',', $ids));
|
||||
$data['inception_data_list'] = $this->policyTransactionModel->getInceptionTranctionListData(
|
||||
$start_date = 0,
|
||||
$end_date = 0,
|
||||
$client_id = 0,
|
||||
$insurer_id = 0,
|
||||
$policy_type_id = 0,
|
||||
$date_type = 0,
|
||||
$issuer = 0,
|
||||
$status = 0,
|
||||
$ids
|
||||
);
|
||||
$ids = $this->request->getPost('ids');
|
||||
$ids = array_filter(explode(',', $ids));
|
||||
$data['inception_data_list'] = $this->policyTransactionModel->getInceptionTranctionListData(
|
||||
$start_date = 0,
|
||||
$end_date = 0,
|
||||
$client_id = 0,
|
||||
$insurer_id = 0,
|
||||
$policy_type_id = 0,
|
||||
$date_type = 0,
|
||||
$issuer = 0,
|
||||
$status = 0,
|
||||
$ids
|
||||
);
|
||||
}
|
||||
}else{
|
||||
$data['inception_data_list'] = [];
|
||||
}
|
||||
|
||||
|
||||
@ -1087,7 +1092,7 @@ class PolicyTransactionController extends BaseController
|
||||
{
|
||||
// echo '<pre>';
|
||||
// !dd($this->getEndorsementDataForEdit(17));
|
||||
|
||||
$bds_edit_pt_id = $this->request->getGet('pt_id') ?? null;
|
||||
$data['tab_name'] = 'Endorsement';
|
||||
$data['page_name'] = 'Endorsement';
|
||||
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
|
||||
@ -1154,8 +1159,11 @@ class PolicyTransactionController extends BaseController
|
||||
$issuer = (!isset($issuer) || $issuer === '' || $issuer === null) ? 0 : $issuer;
|
||||
$status = (!isset($issuer) || $status === '' || $status === null) ? 0 : $status;
|
||||
|
||||
|
||||
$data['endorsement_data_list'] = $this->policyTransactionModel->getEndorsementTranctionListData($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer, $status);
|
||||
if($bds_edit_pt_id == null){
|
||||
$data['endorsement_data_list'] = $this->policyTransactionModel->getEndorsementTranctionListData($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer, $status);
|
||||
}else{
|
||||
$data['endorsement_data_list'] = [];
|
||||
}
|
||||
$data['client'] = $this->clientModel->where('is_active', 1)->findAll();
|
||||
$data['policy_types'] = $this->policyTypeModel->where('is_active', 1)->findAll();
|
||||
|
||||
|
||||
@ -545,6 +545,7 @@
|
||||
console.log(" role_id : ", role_id);
|
||||
var insurer_count_array = [];
|
||||
var pt_co_share_count_data = 0;
|
||||
var redirect_url = '<?= base_url('policy_tranction/endorsement/list') ?>';
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
@ -838,7 +839,7 @@
|
||||
if (res.status == true) {
|
||||
toastr.success(res.message, 'Success');
|
||||
$('#policy_tranction_primarykey').val(res.pt_id);
|
||||
window.location.href = '<?= base_url('policy_tranction/endorsement/list') ?>';
|
||||
window.location.href = redirect_url;
|
||||
} else {
|
||||
toastr.error(res.message, 'Error');
|
||||
}
|
||||
@ -2647,28 +2648,56 @@
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
function getURLParamsForReport()
|
||||
{
|
||||
console.log('getURLParamsForReport() function called')
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
const pt_id = params.get('pt_id') ?? 0
|
||||
// function getURLParamsForReport()
|
||||
// {
|
||||
// console.log('getURLParamsForReport() function called')
|
||||
// const url = new URL(window.location.href);
|
||||
// const params = new URLSearchParams(url.search);
|
||||
// const pt_id = params.get('pt_id') ?? 0
|
||||
|
||||
console.log('policy tranction id ', pt_id);
|
||||
// console.log('policy tranction id ', pt_id);
|
||||
|
||||
if(pt_id != 0){
|
||||
setTimeout(function(){
|
||||
hide_list_show_add()
|
||||
getPolicyTransactionDataForEndorsementEdit(pt_id)
|
||||
}, 2000)
|
||||
}else{
|
||||
show_list_hide_add()
|
||||
// if(pt_id != 0){
|
||||
// setTimeout(function(){
|
||||
// hide_list_show_add()
|
||||
// getPolicyTransactionDataForEndorsementEdit(pt_id)
|
||||
// }, 2000)
|
||||
// }else{
|
||||
// show_list_hide_add()
|
||||
// }
|
||||
|
||||
// console.log('pt_id', pt_id)
|
||||
|
||||
// }
|
||||
|
||||
function getURLParamsForReport() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const pt_id = params.get('pt_id') ?? 0;
|
||||
|
||||
// ✅ Get the previous page URL
|
||||
const previousUrl = document.referrer || '';
|
||||
|
||||
console.log("PT ID:", pt_id);
|
||||
console.log("Previous Page URL:", previousUrl);
|
||||
|
||||
if (pt_id != 0) {
|
||||
hide_list_show_add();
|
||||
setTimeout(() =>
|
||||
getPolicyTransactionDataForEndorsementEdit(pt_id),
|
||||
1500); // Reduced timeout
|
||||
} else {
|
||||
show_list_hide_add();
|
||||
}
|
||||
|
||||
console.log('pt_id', pt_id)
|
||||
if(previousUrl != "" && pt_id != 0){
|
||||
redirect_url = previousUrl;
|
||||
$('#btnAdd').attr('href', previousUrl);
|
||||
}
|
||||
|
||||
console.log('getURLParamsForReport pt_id', pt_id); // Retain the log if necessary
|
||||
}
|
||||
|
||||
|
||||
function onlyNumbers(event)
|
||||
{
|
||||
var charcode = event.which || event.keyCode;
|
||||
|
||||
@ -1338,6 +1338,7 @@
|
||||
let isClientFormSubmitting = false;
|
||||
let isVehicleFormSubmitting = false;
|
||||
var insurer_count_array = [];
|
||||
var redirect_url = '<?= base_url('policy_tranction/inception/list') ?>';
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
@ -3608,10 +3609,7 @@
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var formData = new FormData($('#inception_form_id')[0]);
|
||||
|
||||
console.log(formData);
|
||||
|
||||
var formData = new FormData($('#inception_form_id')[0]);
|
||||
|
||||
const jsonString = JSON.stringify(shortListedInsurer);
|
||||
// console.log('jsonString', jsonString);
|
||||
@ -3658,7 +3656,7 @@
|
||||
toastr.success(res.message, 'Success');
|
||||
|
||||
show_list_hide_add();
|
||||
window.location.href = '<?= base_url('policy_tranction/inception/list') ?>';
|
||||
window.location.href = redirect_url;
|
||||
|
||||
|
||||
$('#policy_tranction_primarykey').val(res.pt_id);
|
||||
@ -5036,6 +5034,12 @@
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const pt_id = params.get('pt_id') ?? 0;
|
||||
|
||||
// ✅ Get the previous page URL
|
||||
const previousUrl = document.referrer || '';
|
||||
|
||||
console.log("PT ID:", pt_id);
|
||||
console.log("Previous Page URL:", previousUrl);
|
||||
|
||||
if (pt_id != 0) {
|
||||
hide_list_show_add();
|
||||
setTimeout(() =>
|
||||
@ -5045,6 +5049,11 @@
|
||||
show_list_hide_add();
|
||||
}
|
||||
|
||||
if(previousUrl != "" && pt_id != 0){
|
||||
redirect_url = previousUrl;
|
||||
$('#btnAdd').attr('href', previousUrl);
|
||||
}
|
||||
|
||||
console.log('getURLParamsForReport pt_id', pt_id); // Retain the log if necessary
|
||||
}
|
||||
|
||||
|
||||
@ -79,36 +79,36 @@ table.dataTable tbody td {
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S. No</th>
|
||||
<th>User</th>
|
||||
<th style="display: none;">User</th>
|
||||
<th>Month</th>
|
||||
<th>Business Type</th>
|
||||
<th>Client Type</th>
|
||||
<!-- <th style="display: none;">Business Type</th> -->
|
||||
<th style="display: none;">Client Type</th>
|
||||
<th>Insured Name</th>
|
||||
<th>Policy/<br>Endorsement</th>
|
||||
<th>Policy Type</th>
|
||||
<th>BAP Group</th>
|
||||
<th>Vehicle Number</th>
|
||||
<th style="display: none;">BAP Group</th>
|
||||
<th style="display: none;">Vehicle Number</th>
|
||||
<th>Policy No</th>
|
||||
<th>Endorsement No</th>
|
||||
<th>Insurer Name</th>
|
||||
<!-- <th style="display: none;">Insurer Name</th> -->
|
||||
<th>Insurer Branch</th>
|
||||
<th>TPA</th>
|
||||
<th>Endorsement <br> Effective Date</th>
|
||||
<th>Policy <br> Effective Date</th>
|
||||
<th>Policy <br> Expiry Date</th>
|
||||
<th>Reference</th>
|
||||
<th>Remarks</th>
|
||||
<th>Base Premium</th>
|
||||
<th>Terrorism/TP</th>
|
||||
<th>Premium <br> (without GST)</th>
|
||||
<th>GST @ 18%</th>
|
||||
<!-- <th style="display: none;">TPA</th> -->
|
||||
<th style="display: none;">Endorsement <br> Effective Date</th>
|
||||
<th style="display: none;">Policy <br> Effective Date</th>
|
||||
<th style="display: none;">Policy <br> Expiry Date</th>
|
||||
<th style="display: none;">Reference</th>
|
||||
<th style="display: none;">Remarks</th>
|
||||
<th>BP Premium</th>
|
||||
<th>TP/Ter Premium</th>
|
||||
<th style="display: none;">Premium <br> (without GST)</th>
|
||||
<!-- <th style="display: none;">GST @ 18%</th> -->
|
||||
<th>Total Premium</th>
|
||||
<th>Base <br> Revenue %</th>
|
||||
<th>TP / Terrorism <br> Revenue %</th>
|
||||
<th>Rewards</th>
|
||||
<th>Total IRDA <br> Revenue INR</th>
|
||||
<th>Billed Amount</th>
|
||||
<th>UnBilled Amount</th>
|
||||
<th>BP %</th>
|
||||
<th>TP/Ter %</th>
|
||||
<th style="display: none;">Rewards</th>
|
||||
<th>Agreed Amount</th>
|
||||
<th>Invoiced Amount</th>
|
||||
<th>Outstanding Amount</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
@ -116,34 +116,40 @@ table.dataTable tbody td {
|
||||
<?php if (isset($report_list)) { ?>
|
||||
<?php foreach($report_list as $index => $row){ ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['user_name'] ?: 'N/A'; ?></td>
|
||||
<td><?= $index + 1 ?> <a href="<?php
|
||||
if($row['action_type'] == "inception"){
|
||||
echo base_url('policy_tranction/inception/list') . '?pt_id=' . $row['id'] ;
|
||||
}else{
|
||||
echo base_url('policy_tranction/endorsement/list') . '?pt_id=' . $row['id'] ;
|
||||
}
|
||||
?>" class="mdi mdi-pencil" ></a> </td>
|
||||
<td style="display: none;"><?php echo $row['user_name'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['policy_issue_month'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['revenue_type'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['client_type'] ?: 'N/A'; ?></td>
|
||||
<!-- <td style="display: none;"><?php echo $row['revenue_type'] ?: 'N/A'; ?></td> -->
|
||||
<td style="display: none;"><?php echo $row['client_type'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['client_name'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['action_type'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['policy_type'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['bap'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['vehicle_no'] ?: 'N/A'; ?></td>
|
||||
<td style="display: none;"><?php echo $row['bap'] ?: 'N/A'; ?></td>
|
||||
<td style="display: none;"><?php echo $row['vehicle_no'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['policy_no'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['endorsement_no'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['insurer_name'] ?: 'N/A'; ?> </td>
|
||||
<!-- <td style="display: none;"><?php echo $row['insurer_name'] ?: 'N/A'; ?> </td> -->
|
||||
<td><?php echo $row['insurer_branch_name'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['tpa_name']; ?></td>
|
||||
<td><?php echo empty($row['endorse_eff_date']) ? 'N/A' : date('d/m/Y', strtotime($row['endorse_eff_date'])) ?></td>
|
||||
<td><?php echo empty($row['policy_start_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_start_date'])); ?></td>
|
||||
<td><?php echo empty($row['policy_end_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_end_date'])); ?></td>
|
||||
<td><?php echo $row['ref'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['remarks'] ?: 'N/A'; ?></td>
|
||||
<!-- <td style="display: none;"><?php echo $row['tpa_name']; ?></td> -->
|
||||
<td style="display: none;"><?php echo empty($row['endorse_eff_date']) ? 'N/A' : date('d/m/Y', strtotime($row['endorse_eff_date'])) ?></td>
|
||||
<td style="display: none;"><?php echo empty($row['policy_start_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_start_date'])); ?></td>
|
||||
<td style="display: none;"><?php echo empty($row['policy_end_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_end_date'])); ?></td>
|
||||
<td style="display: none;"><?php echo $row['ref'] ?: 'N/A'; ?></td>
|
||||
<td style="display: none;"><?php echo $row['remarks'] ?: 'N/A'; ?></td>
|
||||
<td class="right-align-input"><?php echo $row['bp_amt']; ?></td>
|
||||
<td class="right-align-input"><?php echo $row['tp_or_ter']; ?></td>
|
||||
<td class="right-align-input"><?php echo $row['premium_wo_gst']; ?></td>
|
||||
<td class="right-align-input"><?php echo $row['gst_amount']; ?></td>
|
||||
<td class="right-align-input" style="display: none;"><?php echo $row['premium_wo_gst']; ?></td>
|
||||
<!-- <td class="right-align-input" style="display: none;"><?php echo $row['gst_amount']; ?></td> -->
|
||||
<td class="right-align-input"><?php echo $row['total_premium']; ?></td>
|
||||
<td class="right-align-input"><?php echo $row['agreed_bp_per']; ?> %</td>
|
||||
<td class="right-align-input"><?php echo $row['agreed_tp_or_ter_per'];?> %</td>
|
||||
<td class="right-align-input"><?php echo isset($row['reward']) ? $row['reward'] : '0.00'; ?></td>
|
||||
<td class="right-align-input" style="display: none;"><?php echo isset($row['reward']) ? $row['reward'] : '0.00'; ?></td>
|
||||
|
||||
<?php $total_irda_amt = empty($row['total_irda_amt']) ? $row['exp_amt'] : $row['total_irda_amt']; ?>
|
||||
<td class="right-align-input" onclick="showCoShareStatementDetails(this)" data-id="<?= $row['pt_id'] ?>"><?php echo $total_irda_amt; ?></td>
|
||||
@ -415,33 +421,64 @@ $(document).ready(function() {
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
"footerCallback": function(row, data, start, end, display) {
|
||||
// "footerCallback": function(row, data, start, end, display) {
|
||||
// var api = this.api();
|
||||
|
||||
// // Calculate column totals
|
||||
// var totalPremium = api.column(23).data().reduce(function(a, b) {
|
||||
// return parseFloat(a) + parseFloat(b) || 0;
|
||||
// }, 0);
|
||||
|
||||
// var total_rewards = api.column(26).data().reduce(function(a, b) {
|
||||
// return parseFloat(a) + parseFloat(b) || 0;
|
||||
// }, 0); // Add initial value 0 here
|
||||
|
||||
// console.log('total_rewards - ' + total_rewards);
|
||||
|
||||
// var totalIrda = api.column(27).data().reduce(function(a, b) {
|
||||
// return parseFloat(a) + parseFloat(b) || 0;
|
||||
// }, 0);
|
||||
|
||||
// var totalBilled = api.column(28).data().reduce(function(a, b) {
|
||||
// return parseFloat(a) + parseFloat(b) || 0;
|
||||
// }, 0);
|
||||
|
||||
// var totalUnbilled = api.column(29).data().reduce(function(a, b) {
|
||||
// return parseFloat(a) + parseFloat(b) || 0;
|
||||
// }, 0);
|
||||
|
||||
// // Update the totals in the div above the table
|
||||
// $('#total_premium').text(totalPremium.toFixed(2));
|
||||
// $('#total_rewards').text(total_rewards.toFixed(2));
|
||||
// $('#total_irda').text(totalIrda.toFixed(2));
|
||||
// $('#total_billed').text(totalBilled.toFixed(2));
|
||||
// $('#total_unbilled').text(totalUnbilled.toFixed(2));
|
||||
// }
|
||||
"footerCallback": function(row, data, start, end, display) {
|
||||
var api = this.api();
|
||||
|
||||
// Calculate column totals
|
||||
var totalPremium = api.column(23).data().reduce(function(a, b) {
|
||||
return parseFloat(a) + parseFloat(b) || 0;
|
||||
// Calculate column totals (adjust indices based on VISIBLE columns)
|
||||
var totalPremium = api.column(20, {search: 'applied'}).data().reduce(function(a, b) {
|
||||
return parseFloat(a) + parseFloat(b || 0);
|
||||
}, 0);
|
||||
|
||||
var total_rewards = api.column(26).data().reduce(function(a, b) {
|
||||
return parseFloat(a) + parseFloat(b) || 0;
|
||||
}, 0); // Add initial value 0 here
|
||||
|
||||
console.log('total_rewards - ' + total_rewards);
|
||||
|
||||
var totalIrda = api.column(27).data().reduce(function(a, b) {
|
||||
return parseFloat(a) + parseFloat(b) || 0;
|
||||
var total_rewards = api.column(23, {search: 'applied'}).data().reduce(function(a, b) {
|
||||
return parseFloat(a) + parseFloat(b || 0);
|
||||
}, 0);
|
||||
|
||||
var totalBilled = api.column(28).data().reduce(function(a, b) {
|
||||
return parseFloat(a) + parseFloat(b) || 0;
|
||||
var totalIrda = api.column(24, {search: 'applied'}).data().reduce(function(a, b) {
|
||||
return parseFloat(a) + parseFloat(b || 0);
|
||||
}, 0);
|
||||
|
||||
var totalUnbilled = api.column(29).data().reduce(function(a, b) {
|
||||
return parseFloat(a) + parseFloat(b) || 0;
|
||||
var totalBilled = api.column(25, {search: 'applied'}).data().reduce(function(a, b) {
|
||||
return parseFloat(a) + parseFloat(b || 0);
|
||||
}, 0);
|
||||
|
||||
// Update the totals in the div above the table
|
||||
var totalUnbilled = api.column(26, {search: 'applied'}).data().reduce(function(a, b) {
|
||||
return parseFloat(a) + parseFloat(b || 0);
|
||||
}, 0);
|
||||
|
||||
// Update the totals
|
||||
$('#total_premium').text(totalPremium.toFixed(2));
|
||||
$('#total_rewards').text(total_rewards.toFixed(2));
|
||||
$('#total_irda').text(totalIrda.toFixed(2));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user