@@ -, +, @@ --- Koha/Account/Line.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) --- a/Koha/Account/Line.pm +++ a/Koha/Account/Line.pm @@ -597,7 +597,8 @@ sub apply { # Attempt to renew the item associated with this debit if # appropriate if ($debit->renewable) { - $debit->renew_item($params->{interface}); + $debit->renew_item( + { interface => $params->{interface}, credit => $self } ); } # Same logic exists in Koha::Account::pay @@ -929,15 +930,18 @@ sub renew_item { # - 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} && - $params->{interface} eq 'opac' + exists $params->{credit} + && $params->{credit}->credit_type_code eq 'FORGIVEN' ) - ) { + || !C4::Context->preference('RenewAccruingItemWhenPaid') + || !$self->item + || !$self->patron + || ( !C4::Context->preference('RenewAccruingItemInOpac') + && $params->{interface} + && $params->{interface} eq 'opac' ) + ) + { return; } --