CHANGE_IRDA_REPORT : RV
This commit is contained in:
parent
9a7d46a066
commit
30926f6eb9
@ -491,6 +491,7 @@ $routes->group("/bdsReport", ["filter" => "authMVC"], function ($routes) {
|
|||||||
$routes->match( ['get', 'post'], 'irba_report','BDSReportController::irba_report');
|
$routes->match( ['get', 'post'], 'irba_report','BDSReportController::irba_report');
|
||||||
$routes->get('insurer_wise_data/(:any)','BDSReportController::Insurer_wise_Data/$1');
|
$routes->get('insurer_wise_data/(:any)','BDSReportController::Insurer_wise_Data/$1');
|
||||||
$routes->get('bap_wise_data/(:any)','BDSReportController::Bap_Wise_Data/$1');
|
$routes->get('bap_wise_data/(:any)','BDSReportController::Bap_Wise_Data/$1');
|
||||||
|
$routes->match( ['get', 'post'], 'renewal_report','BDSReportController::renewalReport');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -896,4 +896,25 @@ class BDSReportController extends AdminController
|
|||||||
// return [];
|
// return [];
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// ---------------RENEWAL REPORT-----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
public function renewalReport()
|
||||||
|
{
|
||||||
|
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['page_name'] = "Renewal Report";
|
||||||
|
return $this->loadLayout('renewal_search', $data);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$data['page_name'] = "Renewal Report";
|
||||||
|
$html = view('bds_renewal_report_list', $data);
|
||||||
|
return $this->respond(['status' => true, 'html' => $html], 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
0
app/Views/bds_renewal_report_list.php
Normal file
0
app/Views/bds_renewal_report_list.php
Normal file
@ -20,6 +20,17 @@ table.dataTable tbody td {
|
|||||||
.right-align-input {
|
.right-align-input {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.right-align-input:nth-child(4n+1),
|
||||||
|
.right-align-input:nth-child(4n+2) {
|
||||||
|
background-color: #f9f9f9; /* Light gray shade */
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-align-input:nth-child(4n+3),
|
||||||
|
.right-align-input:nth-child(4n+4) {
|
||||||
|
background-color: #ffffff; /* White shade */
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="col-12" id="second_page">
|
<div class="col-12" id="second_page">
|
||||||
@ -46,8 +57,8 @@ table.dataTable tbody td {
|
|||||||
<th colspan="2" style="text-align: center;">Life</th>
|
<th colspan="2" style="text-align: center;">Life</th>
|
||||||
<th colspan="2" style="text-align: center;">Marine Cargo</th>
|
<th colspan="2" style="text-align: center;">Marine Cargo</th>
|
||||||
<th colspan="2" style="text-align: center;">Misc</th>
|
<th colspan="2" style="text-align: center;">Misc</th>
|
||||||
<th colspan="2" style="text-align: center;">Motor</th>
|
|
||||||
<th colspan="2" style="text-align: center;">Marine Hull</th>
|
<th colspan="2" style="text-align: center;">Marine Hull</th>
|
||||||
|
<th colspan="2" style="text-align: center;">Motor</th>
|
||||||
<th colspan="2" style="text-align: center;">Grand Total</th>
|
<th colspan="2" style="text-align: center;">Grand Total</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@ -118,7 +129,6 @@ table.dataTable tbody td {
|
|||||||
<td class="right-align-input"><?php echo $row['marine_hull_policy_count']; ?></td>
|
<td class="right-align-input"><?php echo $row['marine_hull_policy_count']; ?></td>
|
||||||
<td class="right-align-input"><?php echo $row['marine_hull_premium']; ?></td>
|
<td class="right-align-input"><?php echo $row['marine_hull_premium']; ?></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="right-align-input"><?php echo $row['misc_policy_count']; ?></td>
|
<td class="right-align-input"><?php echo $row['misc_policy_count']; ?></td>
|
||||||
<td class="right-align-input"><?php echo $row['misc_premium']; ?></td>
|
<td class="right-align-input"><?php echo $row['misc_premium']; ?></td>
|
||||||
|
|
||||||
|
|||||||
@ -44,8 +44,8 @@ table.dataTable tbody td {
|
|||||||
<th colspan="3" style="text-align: center;">Life</th>
|
<th colspan="3" style="text-align: center;">Life</th>
|
||||||
<th colspan="3" style="text-align: center;">Marine Cargo</th>
|
<th colspan="3" style="text-align: center;">Marine Cargo</th>
|
||||||
<th colspan="3" style="text-align: center;">Misc</th>
|
<th colspan="3" style="text-align: center;">Misc</th>
|
||||||
<th colspan="3" style="text-align: center;">Motor</th>
|
|
||||||
<th colspan="3" style="text-align: center;">Marine Hull</th>
|
<th colspan="3" style="text-align: center;">Marine Hull</th>
|
||||||
|
<th colspan="3" style="text-align: center;">Motor</th>
|
||||||
<th colspan="3" style="text-align: center;">Grand Total</th>
|
<th colspan="3" style="text-align: center;">Grand Total</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ table.dataTable tbody td {
|
|||||||
|
|
||||||
<td class="right-align-input"><?php echo $row['liability_policy_count']; ?></td>
|
<td class="right-align-input"><?php echo $row['liability_policy_count']; ?></td>
|
||||||
<td class="right-align-input"><?php echo $row['liability_premium']; ?></td>
|
<td class="right-align-input"><?php echo $row['liability_premium']; ?></td>
|
||||||
<td class="right-align-input"><?php echo $row['liability_revenue']== 0.00 ? $row['health_exp_amt'] : $row['liability_revenue']; ?></td>
|
<td class="right-align-input"><?php echo $row['liability_revenue']== 0.00 ? $row['liability_exp_amt'] : $row['liability_revenue']; ?></td>
|
||||||
|
|
||||||
<td class="right-align-input"><?php echo $row['life_policy_count']; ?></td>
|
<td class="right-align-input"><?php echo $row['life_policy_count']; ?></td>
|
||||||
<td class="right-align-input"><?php echo $row['life_premium']; ?></td>
|
<td class="right-align-input"><?php echo $row['life_premium']; ?></td>
|
||||||
@ -133,7 +133,6 @@ table.dataTable tbody td {
|
|||||||
<td class="right-align-input"><?php echo $row['marine_hull_premium']; ?></td>
|
<td class="right-align-input"><?php echo $row['marine_hull_premium']; ?></td>
|
||||||
<td class="right-align-input"><?php echo $row['marine_hull_revenue']== 0.00 ? $row['marine_hull_exp_amt'] : $row['marine_hull_revenue'];?></td>
|
<td class="right-align-input"><?php echo $row['marine_hull_revenue']== 0.00 ? $row['marine_hull_exp_amt'] : $row['marine_hull_revenue'];?></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="right-align-input"><?php echo $row['misc_policy_count']; ?></td>
|
<td class="right-align-input"><?php echo $row['misc_policy_count']; ?></td>
|
||||||
<td class="right-align-input"><?php echo $row['misc_premium']; ?></td>
|
<td class="right-align-input"><?php echo $row['misc_premium']; ?></td>
|
||||||
<td class="right-align-input"><?php echo $row['misc_revenue']== 0.00 ? $row['misc_exp_amt'] : $row['misc_revenue']; ?></td>
|
<td class="right-align-input"><?php echo $row['misc_revenue']== 0.00 ? $row['misc_exp_amt'] : $row['misc_revenue']; ?></td>
|
||||||
|
|||||||
159
app/Views/renewal_search.php
Normal file
159
app/Views/renewal_search.php
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
<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-3 client_type_div">
|
||||||
|
<label for="client_type">Client Type<span class="text-danger">*</span></label>
|
||||||
|
<select class="form-control" id="client_type" name="client_type" required>
|
||||||
|
<option value="">Select Client type</option>
|
||||||
|
<option value="1">Group</option>
|
||||||
|
<option value="2">Individual</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<label for="client_branch">Client<span class="text-danger">*</span></label>
|
||||||
|
<select class="form-control" id="client_id" name="client_id" required>
|
||||||
|
<option value="">Select Client</option>
|
||||||
|
</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>
|
||||||
|
$('#category').on('click', function() {
|
||||||
|
|
||||||
|
var choosed_option = $('#category').val();
|
||||||
|
$("#report_type").val('0');
|
||||||
|
if (choosed_option == 'life') {
|
||||||
|
$("#report_type option[value='insurer']").show();
|
||||||
|
$("#report_type option[value='bap']").hide();
|
||||||
|
$("#report_type option[value='bapClient']").hide();
|
||||||
|
$("#report_type option[value='bapInsurer']").hide();
|
||||||
|
$("#report_type option[value='client']").show();
|
||||||
|
|
||||||
|
} else if (choosed_option == 'nonLife') {
|
||||||
|
$("#report_type option[value='insurer']").show();
|
||||||
|
$("#report_type option[value='bap']").show();
|
||||||
|
$("#report_type option[value='bapClient']").show();
|
||||||
|
$("#report_type option[value='bapInsurer']").show();
|
||||||
|
$("#report_type option[value='client']").hide();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function fetchReportPage() {
|
||||||
|
|
||||||
|
var fromDate = $('#startDate').val();
|
||||||
|
var toDate = $('#endDate').val();
|
||||||
|
var client_id = $('#client_id').val();
|
||||||
|
var report_type = $('#report_type').val();
|
||||||
|
var requestData = {
|
||||||
|
fromDate: fromDate,
|
||||||
|
toDate: toDate,
|
||||||
|
category: category,
|
||||||
|
report_type: report_type
|
||||||
|
};
|
||||||
|
console.log(typeof fromDate);
|
||||||
|
var url = '<?= base_url('/bdsReport/renewal_report') ?>';
|
||||||
|
$('.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