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

(-)a/Koha/Account/Line.pm (+10 lines)
Lines 360-365 sub void { Link Here
360
    return $void;
360
    return $void;
361
}
361
}
362
362
363
=head3 can_be_cancelled
364
365
=cut
366
367
sub can_be_cancelled {
368
    my ($self) = @_;
369
370
    return $self->debit_offsets->filter_by_reversable->count ? 1 : 0;
371
}
372
363
=head3 cancel
373
=head3 cancel
364
374
365
  $debit_accountline->cancel();
375
  $debit_accountline->cancel();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-3 / +2 lines)
Lines 113-122 Link Here
113
        [% IF account.is_debit && account.amountoutstanding > 0 %]
113
        [% IF account.is_debit && account.amountoutstanding > 0 %]
114
            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% account.borrowernumber | html %]&pay_individual=1&debit_type_code=[% account.debit_type_code | html %]&amount=[% account.amount | html %]&amountoutstanding=[% account.amountoutstanding | html %]&description=[% account.description | html %]&itemnumber=[% account.itemnumber | html %]&accountlines_id=[% account.accountlines_id | html %]"><i class="fa fa-money"></i> Pay</a>
114
            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% account.borrowernumber | html %]&pay_individual=1&debit_type_code=[% account.debit_type_code | html %]&amount=[% account.amount | html %]&amountoutstanding=[% account.amountoutstanding | html %]&description=[% account.description | html %]&itemnumber=[% account.itemnumber | html %]&accountlines_id=[% account.accountlines_id | html %]"><i class="fa fa-money"></i> Pay</a>
115
        [% END %]
115
        [% END %]
116
        [% IF account.is_credit && account.status != 'VOID' %]
116
        [% IF account.is_credit && account.status != 'VOID' && !(account.credit_type_code == 'CANCELLATION') %]
117
          <a href="boraccount.pl?action=void&amp;accountlines_id=[% account.accountlines_id | uri %]&amp;borrowernumber=[% account.borrowernumber | uri %]" class="btn btn-default btn-xs void"><i class="fa fa-ban"></i> Void payment</a>
117
          <a href="boraccount.pl?action=void&amp;accountlines_id=[% account.accountlines_id | uri %]&amp;borrowernumber=[% account.borrowernumber | uri %]" class="btn btn-default btn-xs void"><i class="fa fa-ban"></i> Void payment</a>
118
        [% END %]
118
        [% END %]
119
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
119
        [% IF account.is_debit && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') && !(account.debit_type_code == 'VOID') && !account.can_be_cancelled %]
120
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
120
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
121
            <input type="hidden" name="csrf_token" value="[% csrf_token | html %]">
121
            <input type="hidden" name="csrf_token" value="[% csrf_token | html %]">
122
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
122
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
123
- 

Return to bug 28656