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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-1 / +1 lines)
Lines 190-196 Link Here
190
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
190
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
191
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
191
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
192
            [% INCLUDE 'csrf-token.inc' %]
192
            [% INCLUDE 'csrf-token.inc' %]
193
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
193
            <input type="hidden" name="op" value="cud-cancel">
194
            <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]">
194
            <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]">
195
            <button type="submit" class="btn btn-default btn-xs cancel-action">
195
            <button type="submit" class="btn btn-default btn-xs cancel-action">
196
                <i class="fa fa-ban"></i>
196
                <i class="fa fa-ban"></i>
(-)a/members/cancel-charge.pl (-13 / +18 lines)
Lines 32-46 my $flags = { Link Here
32
my $type = 'intranet';
32
my $type = 'intranet';
33
my ($user, $cookie) = C4::Auth::checkauth($cgi, $authnotrequired, $flags, $type);
33
my ($user, $cookie) = C4::Auth::checkauth($cgi, $authnotrequired, $flags, $type);
34
34
35
my $borrowernumber = $cgi->param('borrowernumber');
35
my $op = $cgi->param('op') // q{};
36
my $accountlines_id = $cgi->param('accountlines_id');
36
37
37
if ( $op eq "cud-cancel" ) {
38
my $charge = Koha::Account::Lines->find($accountlines_id);
38
    my $accountlines_id = $cgi->param('accountlines_id');
39
$charge->cancel(
39
40
    {
40
    my $charge         = Koha::Account::Lines->find($accountlines_id);
41
        branch   => C4::Context->userenv->{'branch'},
41
    my $borrowernumber = $charge->patron->borrowernumber;
42
        staff_id => C4::Context->userenv->{'number'}
42
    $charge->cancel(
43
    }
43
        {
44
);
44
            branch   => C4::Context->userenv->{'branch'},
45
45
            staff_id => C4::Context->userenv->{'number'}
46
print $cgi->redirect('/cgi-bin/koha/members/boraccount.pl?borrowernumber=' . $borrowernumber);
46
        }
47
    );
48
    print $cgi->redirect( '/cgi-bin/koha/members/boraccount.pl?borrowernumber=' . $borrowernumber );
49
    exit;
50
}
51
52
print $cgi->redirect('/cgi-bin/koha/errors/403.pl');
47
- 

Return to bug 37786