From b74f544231dcf059af0301412792b20522253ae7 Mon Sep 17 00:00:00 2001 From: Caroline Cyr La Rose Date: Wed, 8 Apr 2026 14:14:44 -0400 Subject: [PATCH] Bug 42309: JS error when there are no cash registers This patch corrects a JavaScript error that appears on the cash registers page when there are no cash registers yet. To test : BEFORE applying the patch 0. Make sure there are no cash registers in the database (reset_all if using ktd, or delete them) 1. Enable UseCashRegisters 1.1. Go to Administration > System preferences 1.2. Search for UseCashRegisters 1.3. Set UseCashRegisters to Use 1.4. Click Save all Accounting preferences 2. Open the browser developer tools (F12) and select the Console tab 3. Go to Administration > Cash registers --> Uncaught TypeError: can't access property "DataTable", crtable is undefined 4. Apply the patch 5. Refresh the cash registers page --> The error is gone! Signed-off-by: David Nind Signed-off-by: Brendan Lawlor Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt index 48d8ea0511..86efde6010 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt @@ -240,7 +240,7 @@ order: [[1, "asc"]], paginationType: "full", }); - var crtable_dt = crtable.DataTable(); + var crtable_dt = crtable?.DataTable(); $("#branch_filter").on("change", function () { // Table must be filtered by the