From fd21f24c451025295197caaa02bf2c6f61122248 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Fri, 10 Apr 2026 03:20:15 +0530 Subject: [PATCH] Fix OPD status badges to use full DataTable counts --- app/Views/billing/opd_appointment_list.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Views/billing/opd_appointment_list.php b/app/Views/billing/opd_appointment_list.php index d2de3eb..641773c 100644 --- a/app/Views/billing/opd_appointment_list.php +++ b/app/Views/billing/opd_appointment_list.php @@ -325,7 +325,9 @@ $mergedGroups = [ } function syncWaitingHintAndBadge() { - var $waitingRows = $('#opdAllTable tbody tr[data-opd-status="waiting"]'); + var $waitingRows = opdDataTable + ? $(opdDataTable.rows({ page: 'all', search: 'none' }).nodes()).filter('[data-opd-status="waiting"]') + : $('#opdAllTable tbody tr[data-opd-status="waiting"]'); var missingCount = 0; $waitingRows.each(function() { @@ -353,7 +355,11 @@ $mergedGroups = [ cancelled: 0 }; - $('#opdAllTable tbody tr[data-opd-id]').each(function() { + var $rows = opdDataTable + ? $(opdDataTable.rows({ page: 'all', search: 'none' }).nodes()).filter('[data-opd-id]') + : $('#opdAllTable tbody tr[data-opd-id]'); + + $rows.each(function() { var status = (($(this).attr('data-opd-status') || '').toLowerCase()); counts.all += 1; if (Object.prototype.hasOwnProperty.call(counts, status)) {