From 5a6ca034cd53eb4300bc973c2e474164762a9629 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Fri, 10 Apr 2026 03:35:27 +0530 Subject: [PATCH] Prevent duplicate Consult button in waiting rows --- app/Views/billing/opd_appointment_list.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Views/billing/opd_appointment_list.php b/app/Views/billing/opd_appointment_list.php index 03ab499..6b13ca5 100644 --- a/app/Views/billing/opd_appointment_list.php +++ b/app/Views/billing/opd_appointment_list.php @@ -406,7 +406,13 @@ $mergedGroups = [ $actionCell.find('.btn-opd-create-queue').remove(); - if (canOpenPrescription && $actionCell.find('.btn-opd-consult-open, a[title="Consult"]').length === 0) { + var $consultAnchor = $actionCell.find('a[href*="/Opd_prescription/Prescription/"], a[href*="Opd_prescription/Prescription/"]'); + if ($consultAnchor.length && $actionCell.find('.btn-opd-consult-open').length) { + // Keep a single Consult action when a native anchor is already present. + $actionCell.find('.btn-opd-consult-open').remove(); + } + + if (canOpenPrescription && $actionCell.find('.btn-opd-consult-open').length === 0 && $consultAnchor.length === 0) { var $consultBtn = $(''); $consultBtn.attr('data-opdid', opdId); $actionCell.append($consultBtn).append(' ');