Bug 24492: (RM follow-up) Redirect to correct page after cashup
Cashup of a single register was resulting in a redirect to the register details page. It should return to the branch details page instead. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
8f7a3bf5ea
commit
8b003f4b73
|
|
@ -176,7 +176,7 @@
|
|||
var rfloat = button.data('float');
|
||||
$('#floatc').text(rfloat);
|
||||
var rid = button.data('registerid');
|
||||
$('#cashup_confirm').attr("href", '/cgi-bin/koha/pos/register.pl?op=cashup®isterid='+rid);
|
||||
$('#cashup_confirm').attr("href", '/cgi-bin/koha/pos/registers.pl?op=cashup®isterid='+rid);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -55,13 +55,24 @@ else {
|
|||
|
||||
my $op = $input->param('op') // '';
|
||||
if ( $op eq 'cashup' ) {
|
||||
for my $register ( $registers->as_list ) {
|
||||
my $registerid = $input->param('registerid');
|
||||
if ( $registerid ) {
|
||||
my $register = Koha::Cash::Registers->find( { id => $registerid } );
|
||||
$register->add_cashup(
|
||||
{
|
||||
user_id => $logged_in_user->id,
|
||||
amount => $register->outstanding_accountlines->total
|
||||
}
|
||||
);
|
||||
} else {
|
||||
for my $register ( $registers->as_list ) {
|
||||
$register->add_cashup(
|
||||
{
|
||||
user_id => $logged_in_user->id,
|
||||
amount => $register->outstanding_accountlines->total
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue