@@ -, +, @@ --- Koha/Account/Line.pm | 10 ++++++++++ .../prog/en/modules/members/boraccount.tt | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) --- a/Koha/Account/Line.pm +++ a/Koha/Account/Line.pm @@ -360,6 +360,16 @@ sub void { return $void; } +=head3 can_be_cancelled + +=cut + +sub can_be_cancelled { + my ($self) = @_; + + return $self->debit_offsets->filter_by_reversable->count ? 1 : 0; +} + =head3 cancel $debit_accountline->cancel(); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -116,7 +116,7 @@ [% IF account.is_credit && account.status != 'VOID' %] Void payment [% END %] - [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %] + [% IF account.is_debit && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') && !(account.debit_type_code == 'VOID') && !account.can_be_cancelled %]
--