@@ -, +, @@ --- Koha/ArticleRequest.pm | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) --- a/Koha/ArticleRequest.pm +++ a/Koha/ArticleRequest.pm @@ -104,35 +104,16 @@ sub cancel { $self->notes($notes) if $notes; if ( $self->debit_line_id ) { my $line = Koha::Account::Lines->find( $self->debit_line_id ); - if ( $line->amount != $line->amountoutstanding ) { - $self->borrower->account->add_credit( - { - amount => $line->amount, - user_id => C4::Context->userenv - ? C4::Context->userenv->{'number'} - : undef, - interface => C4::Context->interface, - library_id => C4::Context->userenv - ? C4::Context->userenv->{'branch'} - : undef, - type => 'CREDIT', - description => 'Article request cancelled', - item_id => $self->itemnumber - } - ); - } - else { - $line->cancel( - { - branch => C4::Context->userenv - ? C4::Context->userenv->{'branch'} - : undef, - staff_id => C4::Context->userenv - ? C4::Context->userenv->{'number'} - : undef, - } - ) unless $line->status && $line->status eq 'CANCELLED'; - } + $line->cancel( + { + branch => C4::Context->userenv + ? C4::Context->userenv->{'branch'} + : undef, + staff_id => C4::Context->userenv + ? C4::Context->userenv->{'number'} + : undef, + } + ); } $self->store(); --