Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
e259fa5a27
@ -520,6 +520,7 @@ $routes->group("/ticket", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->post('crud_mail_template/(:any)','TicketController::crudTemplate/$1');
|
||||
$routes->post('note/(:any)','TicketController::crudNote/$1');
|
||||
$routes->post('reply','TicketController::saveReply');
|
||||
$routes->match( ['get', 'post'], 'ticket_reports','TicketController::ticketReports');
|
||||
// $routes->post('ticket_messages','TicketController::getTicketMessage');
|
||||
});
|
||||
|
||||
|
||||
@ -841,4 +841,184 @@ class TicketController extends BaseController
|
||||
|
||||
return 'Ticket id\'s : '.json_encode($ticket_ids);
|
||||
}
|
||||
|
||||
public function ticketReports(){
|
||||
|
||||
if ($this->request->is('get')){
|
||||
$default_start = new \DateTime();
|
||||
$data['default_end'] = $default_start->format('d-m-Y');
|
||||
$data['default_start'] = $default_start->modify('-60 days')->format('d-m-Y');
|
||||
|
||||
$data['policy_type'] = $this->ticketType;
|
||||
$data['account_manager'] = $this->userModel->select('first_name')->where('is_active',1)->where('role',3)->findAll();
|
||||
$data['report_type'] = [
|
||||
'acc_manager_wise_status'=>'Account Manger Wise Status Report',
|
||||
'tpa_wise_status' => 'TPA Wise Status Report',
|
||||
'tat_band_wise' => 'TAT Wise Status Report'
|
||||
];
|
||||
//
|
||||
$this->loadLayout('ticket_reports',$data);
|
||||
}else{
|
||||
$received_data = $this->request->getPost();
|
||||
$from_Date = $received_data['fromDate'];
|
||||
$to_Date = $received_data['toDate'];
|
||||
$fromDate = \DateTime::createFromFormat('d-m-Y', $from_Date)->format('Y-m-d');
|
||||
$toDate = \DateTime::createFromFormat('d-m-Y', $to_Date)->format('Y-m-d');
|
||||
$policy_type = $received_data['policy_type'];
|
||||
// print_rr($received_data);
|
||||
if ($received_data['report_type'] == "acc_manager_wise_status"){
|
||||
|
||||
$viewData['account_manager_wise_data'] = $this->accountManagerWiseReport($policy_type,$fromDate,$toDate);
|
||||
// print_rr($viewData);
|
||||
if ($policy_type == 1){
|
||||
$html = view('claims_report_acc_manager_gmc', $viewData);
|
||||
return $this->respond(['status' => true, 'html' => $html], 200);
|
||||
}else{
|
||||
$html = view('claims_report_acc_manager_gpa', $viewData);
|
||||
return $this->respond(['status' => true, 'html' => $html], 200);
|
||||
}
|
||||
|
||||
}elseif ($received_data['report_type'] == 'tpa_wise_status'){
|
||||
|
||||
$viewData['tpa_wise_data'] = $this->tpaWiseReport($policy_type,$fromDate,$toDate);
|
||||
$html = view('claims_report_tpa_wise',$viewData);
|
||||
return $this->respond(['status' => true, 'html' => $html], 200);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function accountManagerWiseReport($policy_type = null ,$start_date = null, $end_date = null){
|
||||
|
||||
if ($policy_type == 1) {
|
||||
$sql = "SELECT
|
||||
u.first_name AS acc_manager_name,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'ID NOT GENERATED' AND master.ticket_type_id = 1 THEN master.id END) AS id_not_generated,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'NON ID' AND master.ticket_type_id = 1 THEN master.id END) AS non_id,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CDA' AND master.ticket_type_id = 1 THEN master.id END) AS cda,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'INFORMATION REQUIRED' AND master.ticket_type_id = 1 THEN master.id END) AS information_required,
|
||||
COUNT(CASE WHEN tcs.claim_status LIKE '%UNDER PROCESS%' AND master.ticket_type_id = 1 THEN master.id END) AS under_process,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'APPROVED' AND master.ticket_type_id = 1 THEN master.id END) AS approved,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'PAYMENT INITIATED' AND master.ticket_type_id = 1 THEN master.id END) AS payment_initiated,
|
||||
(
|
||||
COUNT(CASE WHEN tcs.claim_status = 'ID NOT GENERATED' AND master.ticket_type_id = 1 THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'NON ID' AND master.ticket_type_id = 1 THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CDA' AND master.ticket_type_id = 1 THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'INFORMATION REQUIRED' AND master.ticket_type_id = 1 THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status LIKE '%UNDER PROCESS%' AND master.ticket_type_id = 1 THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'APPROVED' AND master.ticket_type_id = 1 THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'PAYMENT INITIATED' AND master.ticket_type_id = 1 THEN master.id END)
|
||||
) AS total
|
||||
FROM
|
||||
ticket_master master
|
||||
JOIN
|
||||
user_profiles u ON master.acm_id = u.id and u.is_active = 1
|
||||
JOIN
|
||||
ticket_claim_status tcs ON tcs.id = master.claim_status_id and tcs.is_active = 1
|
||||
WHERE
|
||||
master.created_at <= '$end_date' and master.created_at >= '$start_date' and master.is_active = 1
|
||||
GROUP BY
|
||||
u.id;
|
||||
";
|
||||
$result = $this->ticketMasterModel->query($sql)->getResultArray();
|
||||
// dd($result);
|
||||
|
||||
return $result;
|
||||
|
||||
|
||||
}else{
|
||||
$sql = "SELECT u.first_name AS acc_manager_name,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CLAIM INTIMATION' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS claim_intimation,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'INTIMATION TO INSURER' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS int_to_insurer,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CLIENT PENDING' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS client_pending,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'INSURER PENDING' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS information_required,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'INVESTIGATION' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS investigation,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'APPROVED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS approved,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'ON HOLD' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS on_hold,
|
||||
|
||||
(
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CLAIM INTIMATION' AND master.ticket_type_id = '$policy_type' THEN master.id END)+
|
||||
COUNT(CASE WHEN tcs.claim_status = 'INTIMATION TO INSURER' AND master.ticket_type_id = '$policy_type' THEN master.id END)+
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CLIENT PENDING' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'INSURER PENDING' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'INVESTIGATION' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'APPROVED' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'ON HOLD' AND master.ticket_type_id = '$policy_type' THEN master.id END)
|
||||
) AS total1,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'NOT COVERED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS not_covered,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CLOSED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS closed,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'SETTLED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS settled,
|
||||
(
|
||||
COUNT(CASE WHEN tcs.claim_status = 'NOT COVERED' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CLOSED' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'SETTLED' AND master.ticket_type_id = '$policy_type' THEN master.id END)
|
||||
) AS total2
|
||||
FROM
|
||||
ticket_master master
|
||||
JOIN
|
||||
user_profiles u ON master.acm_id = u.id and u.is_active = 1
|
||||
JOIN
|
||||
ticket_claim_status tcs ON tcs.id = master.claim_status_id and tcs.is_active = 1
|
||||
WHERE
|
||||
master.created_at <= '$end_date' and master.created_at >= '$start_date' and master.is_active = 1 and master.ticket_type_id = '$policy_type'
|
||||
GROUP BY
|
||||
u.id;
|
||||
";
|
||||
$result = $this->ticketMasterModel->query($sql)->getResultArray();
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
public function tpaWiseReport($policy_type = null ,$start_date = null,$end_date = null ){
|
||||
// $policy_type = 1;
|
||||
$sql = "SELECT
|
||||
tpa.name AS tpa_name,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'ID NOT GENERATED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS id_not_generated,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'NON ID' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS non_id,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CDA' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS cda,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'INFORMATION REQUIRED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS information_required,
|
||||
COUNT(CASE WHEN tcs.claim_status LIKE '%UNDER PROCESS%' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS under_process,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'APPROVED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS approved,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'PAYMENT INITIATED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS payment_initiated,
|
||||
(
|
||||
COUNT(CASE WHEN tcs.claim_status = 'ID NOT GENERATED' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'NON ID' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CDA' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'INFORMATION REQUIRED' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status LIKE '%UNDER PROCESS%' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'APPROVED' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'PAYMENT INITIATED' AND master.ticket_type_id = '$policy_type' THEN master.id END)
|
||||
) AS total,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CLOSED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS closed,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'SETTLED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS settled,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'RETURNED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS returned,
|
||||
COUNT(CASE WHEN tcs.claim_status = 'REJECTED' AND master.ticket_type_id = '$policy_type' THEN master.id END) AS denied,
|
||||
(
|
||||
COUNT(CASE WHEN tcs.claim_status = 'CLOSED' AND master.ticket_type_id = '$policy_type'THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'SETTLED' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'RETURNED' AND master.ticket_type_id = '$policy_type' THEN master.id END) +
|
||||
COUNT(CASE WHEN tcs.claim_status = 'REJECTED' AND master.ticket_type_id = '$policy_type' THEN master.id END)
|
||||
) AS total2
|
||||
FROM
|
||||
ticket_master master
|
||||
JOIN
|
||||
tpa ON master.tpa_id = tpa.id and tpa.is_active = 1
|
||||
JOIN
|
||||
ticket_claim_status tcs ON tcs.id = master.claim_status_id and tcs.is_active = 1
|
||||
WHERE
|
||||
master.created_at <= '$end_date' and master.created_at >= '$start_date' and master.is_active = 1
|
||||
GROUP BY
|
||||
tpa.id;
|
||||
|
||||
|
||||
";
|
||||
$result = $this->ticketMasterModel->query($sql)->getResultArray();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
169
app/Views/claims_report_acc_manager_gmc.php
Normal file
169
app/Views/claims_report_acc_manager_gmc.php
Normal file
@ -0,0 +1,169 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.right-align-input {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Insurer List</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>Account Manger</th>
|
||||
<th>ID Not Generated</th>
|
||||
<th>Non-ID</th>
|
||||
<th>CDA</th>
|
||||
<th>Information Required</th>
|
||||
<th>Under Process</th>
|
||||
<th>Approved</th>
|
||||
<th>Payment Initiated</th>
|
||||
<th>Total</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($account_manager_wise_data as $data): ?>
|
||||
<tr>
|
||||
<td><?= $data['acc_manager_name'] ?></td>
|
||||
<td><?= $data['id_not_generated'] ?></td>
|
||||
<td><?= $data['non_id'] ?></td>
|
||||
<td><?= $data['cda']?></td>
|
||||
<td><?= $data['information_required'] ?></td>
|
||||
<td><?= $data['under_process'] ?></td>
|
||||
<td><?= $data['approved'] ?></td>
|
||||
<td><?= $data['payment_initiated'] ?></td>
|
||||
<td><?= $data['total'] ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Grand Total</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Insurer-Wise-Report-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Insurer-Wise-Report-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
footerCallback: function(row, data, start, end, display) {
|
||||
var api = this.api();
|
||||
|
||||
// Helper function to parse numbers
|
||||
var parseNumber = function(value) {
|
||||
return typeof value === 'string' ?
|
||||
parseFloat(value.replace(/[\$,]/g, '')) :
|
||||
typeof value === 'number' ? value : 0;
|
||||
};
|
||||
|
||||
// Calculate total for each column
|
||||
var total_id_not_generated = api.column(1).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
var total_non_id = api.column(2).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
var total_cda = api.column(3).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_information_required = api.column(4).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_under_process = api.column(5).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_approved = api.column(6).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_payment_initiated = api.column(7).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_of_total = api.column(8).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
// Update the footer with totals
|
||||
$(api.column(1).footer()).html(total_id_not_generated);
|
||||
$(api.column(2).footer()).html(total_non_id);
|
||||
$(api.column(3).footer()).html(total_cda);
|
||||
$(api.column(4).footer()).html(total_information_required);
|
||||
$(api.column(5).footer()).html(total_under_process);
|
||||
$(api.column(6).footer()).html(total_approved);
|
||||
$(api.column(7).footer()).html(total_payment_initiated);
|
||||
$(api.column(8).footer()).html(total_of_total);
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
203
app/Views/claims_report_acc_manager_gpa.php
Normal file
203
app/Views/claims_report_acc_manager_gpa.php
Normal file
@ -0,0 +1,203 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.right-align-input {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Insurer List</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th style="text-align: center;" colspan="8">OPEN</th>
|
||||
<th style="text-align: center;" colspan="5">CLEARED</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Account Manger</th>
|
||||
<th>Claim Intimation</th>
|
||||
<th>Intimation to Insurer</th>
|
||||
<th>Client Pending</th>
|
||||
<th>Insurer Pending</th>
|
||||
<th>Investigation</th>
|
||||
<th>Approved</th>
|
||||
<th>On Hold</th>
|
||||
<th>Total</th>
|
||||
<th>Not Covered</th>
|
||||
<th>Closed</th>
|
||||
<th>Settled</th>
|
||||
<th>Total</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($account_manager_wise_data as $data): ?>
|
||||
<tr>
|
||||
<td><?= $data['acc_manager_name'] ?></td>
|
||||
<td><?= $data['claim_intimation'] ?></td>
|
||||
<td><?= $data['int_to_insurer'] ?></td>
|
||||
<td><?=$data['client_pending']?></td>
|
||||
<td><?=$data['information_required'] ?></td>
|
||||
<td><?=$data['investigation'] ?></td>
|
||||
<td><?=$data['approved'] ?></td>
|
||||
<td><?=$data['on_hold'] ?></td>
|
||||
<td><?=$data['total1'] ?></td>
|
||||
<td><?=$data['not_covered'] ?></td>
|
||||
<td><?=$data['closed'] ?></td>
|
||||
<td><?=$data['settled'] ?></td>
|
||||
<td><?=$data['total2'] ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Grand Total</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
|
||||
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Insurer-Wise-Report-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Insurer-Wise-Report-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
footerCallback: function(row, data, start, end, display) {
|
||||
var api = this.api();
|
||||
|
||||
// Helper function to parse numbers
|
||||
var parseNumber = function(value) {
|
||||
return typeof value === 'string' ?
|
||||
parseFloat(value.replace(/[\$,]/g, '')) :
|
||||
typeof value === 'number' ? value : 0;
|
||||
};
|
||||
|
||||
// Calculate total for each column
|
||||
var total_claim_intimation = api.column(1).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
var total_int_to_insurer = api.column(2).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
var total_client_pending = api.column(3).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_information_required = api.column(4).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_investigation = api.column(5).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_approved = api.column(6).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_on_hold = api.column(7).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_of_total = api.column(8).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_not_covered = api.column(9).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_closed = api.column(10).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_settled = api.column(11).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_of_total2 = api.column(12).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
// Update the footer with totals
|
||||
$(api.column(1).footer()).html(total_claim_intimation);
|
||||
$(api.column(2).footer()).html(total_int_to_insurer);
|
||||
$(api.column(3).footer()).html(total_client_pending);
|
||||
$(api.column(4).footer()).html(total_information_required);
|
||||
$(api.column(5).footer()).html(total_investigation);
|
||||
$(api.column(6).footer()).html(total_approved);
|
||||
$(api.column(7).footer()).html(total_on_hold);
|
||||
$(api.column(8).footer()).html(total_of_total);
|
||||
$(api.column(9).footer()).html(total_not_covered);
|
||||
$(api.column(10).footer()).html(total_closed);
|
||||
$(api.column(11).footer()).html(total_settled);
|
||||
$(api.column(12).footer()).html(total_of_total2);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
210
app/Views/claims_report_tpa_wise.php
Normal file
210
app/Views/claims_report_tpa_wise.php
Normal file
@ -0,0 +1,210 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.right-align-input {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Insurer List</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th style="text-align: center;" colspan="8">OPEN</th>
|
||||
<th style="text-align: center;" colspan="5">CLEARED</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>TPA</th>
|
||||
<th>ID Not Generated</th>
|
||||
<th>Non-ID</th>
|
||||
<th>CDA</th>
|
||||
<th>Information Required</th>
|
||||
<th>Under Process</th>
|
||||
<th>Approved</th>
|
||||
<th>Payment Initiated</th>
|
||||
<th>Total</th>
|
||||
<th>Closed</th>
|
||||
<th>Settled</th>
|
||||
<th>Returned</th>
|
||||
<th>Denied</th>
|
||||
<th>Total</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($tpa_wise_data as $data): ?>
|
||||
<tr>
|
||||
<td><?= $data['tpa_name'] ?></td>
|
||||
<td><?= $data['id_not_generated'] ?></td>
|
||||
<td><?= $data['non_id'] ?></td>
|
||||
<td><?=$data['cda']?></td>
|
||||
<td><?=$data['information_required'] ?></td>
|
||||
<td><?=$data['under_process'] ?></td>
|
||||
<td><?=$data['approved'] ?></td>
|
||||
<td><?=$data['payment_initiated'] ?></td>
|
||||
<td><?=$data['total'] ?></td>
|
||||
<td><?=$data['closed'] ?></td>
|
||||
<td><?=$data['settled'] ?></td>
|
||||
<td><?=$data['returned'] ?></td>
|
||||
<td><?=$data['denied'] ?></td>
|
||||
<td><?=$data['total2'] ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Grand Total</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Insurer-Wise-Report-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Insurer-Wise-Report-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
footerCallback: function(row, data, start, end, display) {
|
||||
var api = this.api();
|
||||
|
||||
// Helper function to parse numbers
|
||||
var parseNumber = function(value) {
|
||||
return typeof value === 'string' ?
|
||||
parseFloat(value.replace(/[\$,]/g, '')) :
|
||||
typeof value === 'number' ? value : 0;
|
||||
};
|
||||
|
||||
// Calculate total for each column
|
||||
var total_id_not_generated = api.column(1).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
var total_non_id = api.column(2).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
var total_cda = api.column(3).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_information_required = api.column(4).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_under_process = api.column(5).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_approved = api.column(6).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_payment_initiated = api.column(7).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_of_total = api.column(8).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_closed = api.column(9).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_settled = api.column(10).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_returned = api.column(11).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_denied = api.column(12).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
var total_of_total2 = api.column(13).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
// Update the footer with totals
|
||||
$(api.column(1).footer()).html(total_id_not_generated);
|
||||
$(api.column(2).footer()).html(total_non_id);
|
||||
$(api.column(3).footer()).html(total_cda);
|
||||
$(api.column(4).footer()).html(total_information_required);
|
||||
$(api.column(5).footer()).html(total_under_process);
|
||||
$(api.column(6).footer()).html(total_approved);
|
||||
$(api.column(7).footer()).html(total_payment_initiated);
|
||||
$(api.column(8).footer()).html(total_of_total);
|
||||
$(api.column(9).footer()).html(total_closed);
|
||||
$(api.column(10).footer()).html(total_settled);
|
||||
$(api.column(11).footer()).html(total_returned);
|
||||
$(api.column(12).footer()).html(total_denied);
|
||||
$(api.column(13).footer()).html(total_of_total2);
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -658,6 +658,9 @@
|
||||
<li>
|
||||
<a href="<?= base_url('/ticket/mail_template') ?>">Mail Template</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/ticket/ticket_reports') ?>">Claim Reports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
</div>
|
||||
<div id="ticket_mail_editor" name="content" style="height: 300px;"></div>
|
||||
</div>
|
||||
</div><input type="hidden" id="claim_status" name="claim_status" value="<?= $reply_data['claim_status_id'] ?>">
|
||||
</div><input type="hidden" id="claim_status" name="claim_status" value="<?= isset($reply_data['claim_status_id'])??'' ?>">
|
||||
</div>
|
||||
|
||||
<!-- Submit Button -->
|
||||
|
||||
140
app/Views/ticket_reports.php
Normal file
140
app/Views/ticket_reports.php
Normal file
@ -0,0 +1,140 @@
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4" id="date_div">
|
||||
<label>Date<span class="text-danger"></span></label>
|
||||
<div id="reportrange" class="form-control" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
|
||||
<i class="fa fa-calendar"></i>
|
||||
<span></span> <i class="fa fa-caret-down"></i>
|
||||
</div>
|
||||
<input type="hidden" id="startDate" value=<?= $default_start ?>>
|
||||
<input type="hidden" id="endDate" value=<?= $default_end ?>>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Policy Type<span class="text-danger"> *</span></label> <br />
|
||||
<select name="policy_type" class="form-control" id="policy_type" required>
|
||||
<option value="">Select</option>
|
||||
<?php foreach ($policy_type as $policy => $key) : ?>
|
||||
<option value="<?= $policy ?>"><?= $key ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Report Type<span class="text-danger"> *</span></label> <br />
|
||||
<select class="form-control" id="report_type" required>
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($report_type as $reports => $key) : ?>
|
||||
<option value="<?= $reports ?>"><?= $key ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row justify-content-end">
|
||||
|
||||
<div class="col-auto">
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light" id="get-report-page" onclick="fetchReportPage(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-1">
|
||||
|
||||
<div id="report"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
var start = $('#startDate').val();
|
||||
var end = $('#endDate').val();
|
||||
|
||||
var start = moment(start, 'DD/MM/YYYY');
|
||||
var end = moment(end, 'DD/MM/YYYY');
|
||||
|
||||
function cb(start, end) {
|
||||
$('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
|
||||
'Last Year': [moment().subtract(1, 'year').startOf('year'), moment().subtract(1, 'year').endOf('year')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
|
||||
function fetchReportPage() {
|
||||
|
||||
var fromDate = $('#startDate').val();
|
||||
var toDate = $('#endDate').val();
|
||||
var policy_type = $('#policy_type').val();
|
||||
var report_type = $('#report_type').val();
|
||||
var requestData = {
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
policy_type: policy_type,
|
||||
report_type: report_type
|
||||
};
|
||||
// console.log(requestData);
|
||||
var url = '<?= base_url('/ticket/ticket_reports') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
if (response.status == true) {
|
||||
$('#report').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
}else{
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message,'ERROR');
|
||||
}
|
||||
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the report page.', 'ERROR');
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user