diff --git a/app/Views/bds_renewal_report_list.php b/app/Views/bds_renewal_report_list.php index a3147bd1..9d44a633 100644 --- a/app/Views/bds_renewal_report_list.php +++ b/app/Views/bds_renewal_report_list.php @@ -7,6 +7,13 @@ table.dataTable tbody td { padding: 4px 4px !important; } + .column-header { + margin-right: 10px; /* Adjust this value as needed */ + } + + table[data-custom-table-css="table"].dataTable thead th { + padding-right: 20px !important; + }
diff --git a/app/Views/outstanding_report_list.php b/app/Views/outstanding_report_list.php index 203c4151..53b807d9 100644 --- a/app/Views/outstanding_report_list.php +++ b/app/Views/outstanding_report_list.php @@ -21,6 +21,18 @@ .center-align-input { text-align: center; } + + .column-header { + margin-right: 10px; /* Adjust this value as needed */ + } + + /* Center align header text and icons */ + table[data-custom-table-css="table"].dataTable thead th { + padding-top: 3px !important; + padding-bottom: 4px !important; + padding-right: 15px !important; + padding-left: 15px !important; + }
@@ -107,21 +119,21 @@
- +
- + - - - - - - - - - - + + + + + + + + + + @@ -213,8 +225,12 @@ ] }], language: { - search: "_INPUT_", - searchPlaceholder: "Search..." + search: ` +
+ _INPUT_ + +
`, + searchPlaceholder: "Search" }, paging: true, // Enable pagination pageLength: 25 // Set default number of rows per page (optional) diff --git a/app/Views/report_bds_filter.php b/app/Views/report_bds_filter.php index bc5db80b..d55ab379 100644 --- a/app/Views/report_bds_filter.php +++ b/app/Views/report_bds_filter.php @@ -169,8 +169,6 @@ $(document).ready(function() { - getClientAndBranchAndPolicy() - getURLParams() $('#client_id').select2(); $('#client_branch_id').select2(); $('#insurer_id').select2(); @@ -179,7 +177,9 @@ $('#client_policy_id').select2(); $('#user_id').select2(); - }) + getClientAndBranchAndPolicy(); + }); + function fetchEmpolyeeList(event) { event.preventDefault(); // Prevent default action @@ -223,21 +223,30 @@ return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&'); } + function getSafeParam(params, paramName) { + const val = params.get(paramName); + if (val === null || val === '' || val === 'null' || val === 'undefined' || val === undefined) { + return ''; + } + return val; + } + + function getURLParams() { const url = new URL(window.location.href); const params = new URLSearchParams(url.search); - const startDate = params.get('start_date') || 0; // Default to 0 if not found - const endDate = params.get('end_date') || 0; // Default to 0 if not found - const client_id = params.get('client_id') || 0; // Default to 0 if not found - const insurer_id = params.get('insurer_id') || 0; // Default to 0 if not found - const policy_type_id = params.get('policy_type_id') || 0; // Default to 0 if not found - const date_type = params.get('date_type') || 0; // Default to 0 if not found - const issuer = params.get('issuer') || 0; // Default to 0 if not found - const client_branch_id = params.get('client_branch_id') || 0; // Default to 0 if not found - const insurer_branch_id = params.get('insurer_branch_id') || 0; // Default to 0 if not found - const client_policy_id = params.get('client_policy_id') || 0; // Default to 0 if not found - const user_id = params.get('user_id') || 0; // Default to 0 if not found + const startDate = getSafeParam(params, 'start_date'); + const endDate = getSafeParam(params, 'end_date'); + const client_id = getSafeParam(params, 'client_id'); + const insurer_id = getSafeParam(params, 'insurer_id'); + const policy_type_id = getSafeParam(params, 'policy_type_id'); + const date_type = getSafeParam(params, 'date_type'); + const issuer = getSafeParam(params, 'issuer'); + const client_branch_id = getSafeParam(params, 'client_branch_id'); + const insurer_branch_id = getSafeParam(params, 'insurer_branch_id'); + const client_policy_id = getSafeParam(params, 'client_policy_id'); + const user_id = getSafeParam(params, 'user_id'); hideDateField(date_type) @@ -258,24 +267,38 @@ console.log('End Date:', endDate); if (startDate != 0 && endDate != 0) { - setTimeout(function() { - $('#start_date').val(startDate) - $('#end_date').val(endDate) - $('#client_id').val(client_id).select2() - $('#insurer_id').val(insurer_id).select2() - $('#user_id').val(user_id).select2() - $('#policy_type_id').val(policy_type_id).select2() - $('#date_type').val(date_type).trigger('change'); - $('#issuer').val(issuer) - setTimeout(function() { - $('#client_branch_id').val(client_branch_id).select2() - $('#insurer_branch_id').val(insurer_branch_id).select2() + // wait for dropdowns (Select2) to be loaded setTimeout(function() { - $('#client_policy_id').val(client_policy_id).select2(); - }, 1000); - }, 2000) - }, 1000) + // Step 1: Set top-level fields first + $('#startDate').val(startDate); + $('#endDate').val(endDate); + $('#client_id').val(client_id).trigger('change.select2'); + $('#insurer_id').val(insurer_id).trigger('change.select2'); + $('#user_id').val(user_id).trigger('change.select2'); + $('#policy_type_id').val(policy_type_id).trigger('change.select2'); + $('#date_type').val(date_type).trigger('change'); + $('#issuer').val(issuer); + // Step 2: Wait a bit to let change events happen + setTimeout(function() { + // populate branch dropdowns manually if data exists + if (client_id && branch_list[client_id]) { + appendBranch(branch_list[client_id]); + } + if (insurer_id && insurer_branch_list[insurer_id]) { + appendInsurerBranch(insurer_branch_list[insurer_id]); + } + + // Step 3: Set branch selections + $('#client_branch_id').val(client_branch_id).trigger('change.select2'); + $('#insurer_branch_id').val(insurer_branch_id).trigger('change.select2'); + + // Step 4: After branches, handle client policies + setTimeout(function() { + $('#client_policy_id').val(client_policy_id).trigger('change.select2'); + }, 500); + }, 500); + }, 500); } } @@ -370,6 +393,7 @@ insurer_branch_list = res.insurer_branch_data; appendClients(res.client_data); appendInsurer(res.insurer_data); + getURLParams(); } else { console.log('No data found'); } @@ -401,6 +425,7 @@ }); $('#client_id').append(option); + }); } @@ -469,7 +494,6 @@ function appendPolicies(data) { // console.log('appendPolicies', data); // console.log('appendPolicies', $('#client_policy_id')); - $('#client_policy_id').empty(); $('#client_policy_id').append($('
S.No 
S.No
Insurer Insurer
Branch 
Statement
Month 
Statement
No 
Invoice No Invoice Status Invoice Date Invoice Amount Realization
Amount 
Outstanding
Amount 
Insurer
Insurer
Branch
Statement
Month
Statement
No
Invoice No
Invoice Status
Invoice Date
Invoice Amount
Realization
Amount
Outstanding
Amount