From 7d8c8f16f7da716186544e7382e799e3348d3e13 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 12 Jan 2026 15:14:57 +0000 Subject: [PATCH] Bug 40445: (follow-up) Allow cashup with non-cash transactions Previously, the "Record cashup" buttons on both the register and registers pages were disabled when there were zero CASH/SIP00 transactions, even if other payment types (Card, etc.) had transactions. This was incorrect - cashup should be allowed as long as there are ANY transactions, regardless of payment type. Staff still need to record cashups even when all transactions were Card or other non-cash payment methods. Changes: - register.tt: Check total_transactions instead of total_bankable to determine if cashup button should be enabled - registers.tt: Check rtotal instead of rbankable for both checkbox and button enable/disable logic Test plan: 1. Create transactions on a register using only Card payment type 2. Visit the register page - verify "Record cashup" button is enabled 3. Visit the registers page - verify the register checkbox is enabled and "Record cashup" button is enabled 4. Perform a cashup - verify it completes successfully Signed-off-by: Jackie Usher --- koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt index 8946faa30a0..19f820f9061 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt @@ -157,13 +157,14 @@ [% SET bankable = 0, ctotal = 0, dtotal = 0, cctotal = 0, cdtotal = 0 %] [% FOREACH register IN registers %] [% SET rbankable = ( register.outstanding_accountlines.total( payment_type => [ 'CASH', 'SIP00' ]) * -1 ) %] + [% SET rtotal = ( register.outstanding_accountlines.total() * -1 ) %] [% IF CAN_user_cash_management_cashup %] [% IF register.cashup_in_progress %] - [% ELSIF rbankable == 0 %] - + [% ELSIF rtotal == 0 %] + [% ELSE %] [% END %] @@ -223,7 +224,7 @@ data-bankable="[% rbankable | $Price %]" data-float="[% register.starting_float | $Price %]" data-registerid="[% register.id | html %]" - [% IF rbankable == 0 %]disabled title="No bankable transactions"[% END %] + [% IF rtotal == 0 %]disabled title="No transactions"[% END %] > Record cashup [% END %] -- 2.53.0