Bug 40445: (QA follow-up) Show cashup summary modal when completing from registers.pl

When a single-register cashup is completed from the Cash summary page
(registers.pl), pos/register.pl redirected back to registers.pl without
the '#cashup-<id>' hash, so the hash-watcher in registers.tt never
triggered the cashup summary modal. Completing the same cashup from the
Transaction history page (register.pl) worked because that branch
already appended the hash.

Append '#cashup-<id>' to the registers.pl redirect URL too, so both the
'Record cashup' (quick) and 'Complete cashup' (two-phase) actions on the
Cash summary page open the summary modal on return.

Test plan:
1. Have at least one register with cash transactions.
2. From Cash summary (registers.pl), click 'Record cashup' on a register
   with no cashup in progress; complete it.
   => On return, cashup summary modal opens automatically.
3. Start a two-phase cashup; from Cash summary click 'Complete cashup'
   and confirm.
   => On return, cashup summary modal opens automatically.
4. From Transaction history (register.pl), complete a cashup as before.
   => Modal still opens (regression check).

Sponsored-by: OpenFifth <https://openfifth.co.uk/>
Signed-off-by: Jackie Usher <jackie.usher@westsussex.gov.uk>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2026-05-07 17:06:34 +01:00 committed by Pedro Amorim
parent c51f4b7cca
commit 53d498e145
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 2 additions and 1 deletions

View File

@ -195,7 +195,8 @@ if ( !$registers->count ) {
my $redirect_to = $input->param('redirect_to') || 'register';
if ( $redirect_to eq 'registers' ) {
print $input->redirect("/cgi-bin/koha/pos/registers.pl?cashup_complete_success=1");
print $input->redirect(
"/cgi-bin/koha/pos/registers.pl?cashup_complete_success=1#cashup-" . $cashup->id );
} else {
print $input->redirect(
"/cgi-bin/koha/pos/register.pl?registerid=" . $registerid . "#cashup-" . $cashup->id );