FIX_CLAIMS_FILTER

This commit is contained in:
VENKATESHWARAN 2026-03-17 12:10:52 +05:30
parent aec134abb0
commit 0e03cd1da0

View File

@ -126,9 +126,8 @@
<input type="text" class="form-control" id="emp_code" name="emp_code">
</div>
<div class="form-group col-md-12">
<label for="emp_mobile_no">Employee Mobile No<span
class="text-danger"></span></label>
<input type="text" class="form-control" id="emp_mobile_no" name="emp_mobile_no">
<label for="emp_mobile_no">Employee Mobile No<span class="text-danger"></span></label>
<input type="text" class="form-control" id="emp_mobile_no" name="emp_mobile_no" maxlength="10" pattern="[0-9]{10}" inputmode="numeric" oninput="this.value = this.value.replace(/[^0-9]/g, '')">
</div>
<div class="form-group col-md-12">
@ -227,6 +226,7 @@
function fetchTicketListData() {
closeFilterNav();
var ticket_type = $('#ticket_type').val();
var pod_no = $('#pod_no').val();
var claim_no = $('#claim_no').val();
@ -242,9 +242,24 @@
var end_date = $('#endDate').val();
var date_type = $('#date_type').val();
function isEmpty(value) {
return value === null || value === undefined || value.toString().trim() === '' || value == 0;
}
if (isEmpty(claim_no) && isEmpty(emp_code) && isEmpty(claim_status) && isEmpty(emp_mobile_no) && isEmpty(tpa_id) && isEmpty(client_id) && isEmpty(insurer_id) && isEmpty(date_type)) {
toastr.warning('Please enter at least one search criteria.');
return false;
}
if (date_type) {
if (!start_date || !end_date) {
toastr.warning('Please select both Start Date and End Date.');
return false;
}
}
var requestData = {
ticket_type_id: ticket_type,
pod_no: pod_no,
claim_number: claim_no,
emp_code: emp_code,
claim_status_id: claim_status,
@ -412,22 +427,24 @@
$('#pod_no').val('');
$('#claim_no').val('');
$('#emp_code').val('');
$('#claim_status').val('0');
$('#emp_mobile_no').val('');
$('#tpa_id').val('0');
$('#client_id').val('0');
$('#insurer_id').val('0');
$('#date_div').hide();
$('#date_type').val('0');
$('#start_date').val('');
$('#end_date').val('');
$('#claim_status').val('0').select2();
$('#tpa_id').val('0').select2();
$('#client_id').val('0').select2();
$('#insurer_id').val('0').select2();
// Reset the date range picker to default
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
$('#reportrange').data('daterangepicker').setEndDate(moment());
cb(start, end); // Update the displayed date range
localStorage.setItem('filterData', JSON.stringify(filterData));
// localStorage.setItem('filterData', JSON.stringify(filterData));
window.location.href = "<?= base_url("/ticket/list") ?>";
});