From 0ee2fc47812a6225b5019b8cb5075555e78011c9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 4 Feb 2020 15:14:22 +0100 Subject: [PATCH] Bug 24474: A try This does not work --- Koha/Account.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Koha/Account.pm b/Koha/Account.pm index ae6bebbb7a..8ac690c3d3 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -120,7 +120,8 @@ sub pay { && $fine->debit_type_code && ( $fine->debit_type_code eq 'LOST' ) ) { - C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber ); + my $checkout = Koha::Checkouts->find($fine->itemnumber); + C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber ) unless $checkout; } my $account_offset = Koha::Account::Offset->new( @@ -179,7 +180,8 @@ sub pay { && $fine->debit_type_code && ( $fine->debit_type_code eq 'LOST' ) ) { - C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber ); + my $checkout = Koha::Checkouts->find($fine->itemnumber); + C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber ) unless $checkout; } my $account_offset = Koha::Account::Offset->new( -- 2.11.0