From b571ab2546eace9de294fe117eede3125026ba8c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 24 Mar 2021 17:13:57 +0000 Subject: [PATCH] Bug 27927: Prevent renewal on lost forgive The `RenewAccruingItemWhenPaid` preference should only renew upon payment (and writeoff) and not upon automatic forgival triggered by `WhenLostForgiveFine`. Test plan 1/ Enable `WhenLostForgiveFine` and `RenewAccruingItemWhenPaid` 2/ Checkout an item and backdate it's due date 3/ Run longeroverdue.pl to mark the item as lost and create the fine 4/ Confirm that the item is not renewed as part of the process 5/ Signoff Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit ac233efccf089c9981e81bba30554339007729f4) Signed-off-by: Fridolin Somers (cherry picked from commit dc7c62ec4d671ca35ce5d87131acb8dc48a0f5b5) Signed-off-by: Andrew Fuerste-Henry --- Koha/Account/Line.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index bed7c54d00..d40e386001 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -500,8 +500,8 @@ sub apply { # Attempt to renew the item associated with this debit if # appropriate - if ($debit->renewable) { - $debit->renew_item($params->{interface}); + if ( $self->credit_type_code ne 'FORGIVEN' && $debit->renewable ) { + $debit->renew_item( { interface => $params->{interface} } ); } # Same logic exists in Koha::Account::pay -- 2.39.5