View | Details | Raw Unified | Return to bug 38728
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt (+9 lines)
Lines 573-578 Link Here
573
                }
573
                }
574
            ]
574
            ]
575
        }, null, 1);
575
        }, null, 1);
576
577
        $(document).ready(function() {
578
            [% IF cashup_id %]
579
            let $button = $('[data-cashup="[% cashup_id | html %]"]');
580
            if ($button.length) {
581
                $button[0].click();
582
            }
583
            [% END %]
584
        });
576
    </script>
585
    </script>
577
[% END %]
586
[% END %]
578
587
(-)a/pos/register.pl (-3 / +2 lines)
Lines 104-110 if ( !$registers->count ) { Link Here
104
    my $op = $input->param('op') // '';
104
    my $op = $input->param('op') // '';
105
    if ( $op eq 'cud-cashup' ) {
105
    if ( $op eq 'cud-cashup' ) {
106
        if ( $logged_in_user->has_permission( { cash_management => 'cashup' } ) ) {
106
        if ( $logged_in_user->has_permission( { cash_management => 'cashup' } ) ) {
107
            $cash_register->add_cashup(
107
            my $cashup = $cash_register->add_cashup(
108
                {
108
                {
109
                    manager_id => $logged_in_user->id,
109
                    manager_id => $logged_in_user->id,
110
                    amount     => $cash_register->outstanding_accountlines->total
110
                    amount     => $cash_register->outstanding_accountlines->total
Lines 112-118 if ( !$registers->count ) { Link Here
112
            );
112
            );
113
113
114
            # Redirect to prevent duplicate submissions (POST/REDIRECT/GET pattern)
114
            # Redirect to prevent duplicate submissions (POST/REDIRECT/GET pattern)
115
            print $input->redirect( "/cgi-bin/koha/pos/register.pl?registerid=" . $registerid );
115
            print $input->redirect( "/cgi-bin/koha/pos/register.pl?registerid=" . $registerid  . "&cashup_id=" . $cashup->id );
116
            exit;
116
            exit;
117
        } else {
117
        } else {
118
            $template->param( error_cashup_permission => 1 );
118
            $template->param( error_cashup_permission => 1 );
119
- 

Return to bug 38728