From 910f3a9df3bc283e81e32a3db6352000016a5c4f Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 5 Jul 2018 18:05:11 +0000 Subject: [PATCH] Bug 21042: Make 'pay amount' also return lost fines To test: 1 - Checkout an item to a patron, and make it lost ( but not returned) and ensure fine is levied against the account 2 - Add some other fines to their account 3 - Click 'Pay amount' and pay everything they owe 4 - Note the book is not returned 5 - Repeat with 'Pay selected' and note item is returned 6 - Apply patch 7 - Repeat 1-5 and note item is returned in both cases --- Koha/Account.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Koha/Account.pm b/Koha/Account.pm index 493f4ac..112a591 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -168,6 +168,11 @@ sub pay { $fine->amountoutstanding( $old_amountoutstanding - $amount_to_pay ); $fine->store(); + if ( $fine->itemnumber && $fine->accounttype && ( $fine->accounttype eq 'Rep' || $fine->accounttype eq 'L' ) ) + { + C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber ); + } + my $account_offset = Koha::Account::Offset->new( { debit_id => $fine->id, -- 2.1.4