From 8bd80a6896c851341ac22deb3477ced0684e931c Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Sat, 7 Dec 2024 10:32:32 +0530 Subject: [PATCH] FIX_PAYMENT METHOD FILTER, FEAT_ TABLE FILTER FOR EMAIL ADDED --- app/Views/notify_the_expiry_subscribers.php | 34 ++++++++++++++++++++- app/Views/received_payments_report.php | 4 +-- app/Views/report_general_invoice.php | 16 +++++----- 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/app/Views/notify_the_expiry_subscribers.php b/app/Views/notify_the_expiry_subscribers.php index c1d6dcdc..b947f817 100755 --- a/app/Views/notify_the_expiry_subscribers.php +++ b/app/Views/notify_the_expiry_subscribers.php @@ -28,7 +28,7 @@ - + @@ -55,6 +55,8 @@ "searching": true, "autoWidth":true }); + + var $select_data = ''; var dateRangeFilter = $('input.input-daterange-datepicker').daterangepicker({ locale: { @@ -154,9 +156,13 @@ item.mode, status ]); + }); + table.draw(); + regenerateFilters(table); $('#modal_table').show(); + // table.draw(); } else { tableBody.append(''); @@ -169,6 +175,32 @@ } }); } +function regenerateFilters(table) { + $('#datatable-buttons thead tr:eq(1)').remove(); + $('#datatable-buttons thead tr').clone(true).appendTo('#datatable-buttons thead'); + + $('#datatable-buttons thead tr:eq(1) th').each(function(i) { + var title = $(this).text(); + var column = table.column(i); + + var uniqueValues = column.data().unique().sort(); + + var select = $('') + .appendTo($(this).empty()) + .on('change', function() { + var val = $.fn.dataTable.util.escapeRegex($(this).val()); + column + .search(val ? '^' + val + '$' : '', true, false) + .draw(); + }); + + uniqueValues.each(function(d) { + if (d) { + select.append(''); + } + }); + }); +} diff --git a/app/Views/received_payments_report.php b/app/Views/received_payments_report.php index 214796d0..633c3b5e 100644 --- a/app/Views/received_payments_report.php +++ b/app/Views/received_payments_report.php @@ -179,8 +179,8 @@ paymentMethod = 'Cash on delivery'; } table.column(3) - .search(paymentMethod, true, false) - .draw(); + .search('^' + paymentMethod + '$', true, false) // Use regex for exact match + .draw(); updateTotal(); }); diff --git a/app/Views/report_general_invoice.php b/app/Views/report_general_invoice.php index 240291cd..f46540ce 100755 --- a/app/Views/report_general_invoice.php +++ b/app/Views/report_general_invoice.php @@ -102,31 +102,31 @@ Customer Name
- GST + Count

- Discount + Invoice Type

- Count + Status

- OT Charges + Payment

- Total + Discount

- Status + OT Charges

- Type of Invoice + GST

- Payment + Total

Customer Name Sent Date Membership ID
No data available