diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt index e449fef31c..828ac21e6d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -286,8 +286,10 @@ - - + + + + + + + + + - - + + + - - + + + [% INCLUDE 'modals/cashup_summary.inc' %] @@ -223,7 +240,7 @@ var rfloat = button.data('float'); $('#floatc').text(rfloat); var rid = button.data('registerid'); - $('#cashup_confirm').attr("href", '/cgi-bin/koha/pos/registers.pl?op=cashup®isterid='+rid); + $('#cashup_registerid').val(rid); }); }); diff --git a/pos/register.pl b/pos/register.pl index 53bb5d2325..7ab0f887ff 100755 --- a/pos/register.pl +++ b/pos/register.pl @@ -104,7 +104,7 @@ else { $template->param( trange_t => $end, ); my $op = $input->param('op') // ''; - if ( $op eq 'cashup' ) { + if ( $op eq 'cud-cashup' ) { if ( $logged_in_user->has_permission( { cash_management => 'cashup' } ) ) { $cash_register->add_cashup( { @@ -112,8 +112,11 @@ else { amount => $cash_register->outstanding_accountlines->total } ); - } - else { + + # Redirect to prevent duplicate submissions (POST/REDIRECT/GET pattern) + print $input->redirect( "/cgi-bin/koha/pos/register.pl?registerid=" . $registerid ); + exit; + } else { $template->param( error_cashup_permission => 1 ); } } diff --git a/pos/registers.pl b/pos/registers.pl index 7a9c3a1699..80f14b0778 100755 --- a/pos/registers.pl +++ b/pos/registers.pl @@ -55,7 +55,7 @@ else { } my $op = $input->param('op') // ''; -if ( $op eq 'cashup' ) { +if ( $op eq 'cud-cashup' ) { if ( $logged_in_user->has_permission( { cash_management => 'cashup' } ) ) { my $registerid = $input->param('registerid'); if ($registerid) { @@ -77,8 +77,11 @@ if ( $op eq 'cashup' ) { ); } } - } - else { + + # Redirect to prevent duplicate submissions (POST/REDIRECT/GET pattern) + print $input->redirect("/cgi-bin/koha/pos/registers.pl"); + exit; + } else { $template->param( error_cashup_permission => 1 ); } }