From 2dd76096f991ea4d91f97b7025a05c96edc56889 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 4 Jun 2020 11:17:35 -0400 Subject: [PATCH] Bug 25552: Mark issue as returned if MarkLostItemsAsReturned, even if not charging a lost fee Signed-off-by: Marti Fyerst Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit 0e46d4017f310d6011ef66eb2611b6524dc4044c) Signed-off-by: Fridolin Somers --- Koha/Checkout.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Koha/Checkout.pm b/Koha/Checkout.pm index 944c0b1d73..6af0179fe5 100644 --- a/Koha/Checkout.pm +++ b/Koha/Checkout.pm @@ -24,6 +24,7 @@ use Carp; use DateTime; use Try::Tiny; +use C4::Circulation qw(MarkIssueReturned); use Koha::Checkouts::ReturnClaims; use Koha::Database; use Koha::DateUtils; @@ -175,7 +176,13 @@ sub claim_returned { $ClaimReturnedChargeFee eq 'charge' ? 1 : $ClaimReturnedChargeFee eq 'no_charge' ? 0 : $charge_lost_fee; # $ClaimReturnedChargeFee eq 'ask' - C4::Circulation::LostItem( $self->itemnumber, 'claim_returned' ) if $charge_lost_fee; + + if ( $charge_lost_fee ) { + C4::Circulation::LostItem( $self->itemnumber, 'claim_returned' ); + } + elsif ( C4::Context->preference( 'MarkLostItemsAsReturned' ) =~ m/claim_returned/ ) { + C4::Circulation::MarkIssueReturned( $self->borrowernumber, $self->itemnumber, undef, $self->patron->privacy ); + } return $claim; } -- 2.39.5