@@ -, +, @@ empty, but it would still get appended to the 'renew_outcomes' array which results in some 'dirty' messages in the UI. checkout) Set finesMode = production perl misc/cronjobs/fines.pl -v the following items were paid off, renewal results are displayed below: No title ( ): Not renewed - Unknown error" error message. --- Koha/Account.pm | 2 +- Koha/Account/Line.pm | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) --- a/Koha/Account.pm +++ a/Koha/Account.pm @@ -203,7 +203,7 @@ sub pay { # If we need to make a note of the item associated with this line, # in order that we can potentially renew it, do so. my $amt = $old_amountoutstanding - $amount_to_pay; - if ($fine->renewable) { + if ( C4::Context->preference('RenewAccruingItemWhenPaid') && $fine->renewable ) { my $outcome = $fine->renew_item; push @{$renew_outcomes}, $outcome; } --- a/Koha/Account/Line.pm +++ a/Koha/Account/Line.pm @@ -901,7 +901,9 @@ sub renewable { $self->debit_type_code && $self->debit_type_code eq 'OVERDUE' && $self->status && - $self->status eq 'UNRETURNED' + $self->status eq 'UNRETURNED' && + $self->item && + $self->patron ) ? 1 : 0; } @@ -919,19 +921,14 @@ sub renew_item { my $outcome = {}; - # We want to reject the call to renew if any of these apply: + # We want to reject the call to renew if: # - The RenewAccruingItemWhenPaid syspref is off - # - The line item doesn't have an item attached to it - # - The line item doesn't have a patron attached to it - # + # OR # - The RenewAccruingItemInOpac syspref is off - # AND # - There is an interface param passed and it's value is 'opac' if ( !C4::Context->preference('RenewAccruingItemWhenPaid') || - !$self->item || - !$self->patron || ( !C4::Context->preference('RenewAccruingItemInOpac') && $params->{interface} && --