From c3c78223eb5c4bc7c6122af0e91427aed6e157c2 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 13 Mar 2013 08:36:57 -0400 Subject: [PATCH] Bug 9805 - Lost items are un-lost if returned, but not if renewed. If an item has a lost status, that status is removed when the item is returned. However, it is not removed if the item is renewed. Test Plan: 1) Check an item out to a patron, back date the due date 6 months 2) Run misc/cronjobs/longoverdue.pl -l 30=2 --confirm 3) Verify the item is now checked out but lost 4) Renew the item, verify the item is still lost 5) Apply this patch 6) Renew the item again, verify the item is no longer lost Signed-off-by: Paul Poulain --- C4/Circulation.pm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 35651f2..a190c0a 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2927,7 +2927,23 @@ sub AddRenewal { # Update the renewal count on the item, and tell zebra to reindex $renews = $biblio->{'renewals'} + 1; - ModItem({ renewals => $renews, onloan => $datedue->strftime('%Y-%m-%d %H:%M')}, $biblio->{'biblionumber'}, $itemnumber); + + # If item was lost, it has now been found, reverse any list item charges if neccessary. + if ( $item->{'itemlost'} ) { + if ( C4::Context->preference('RefundLostItemFeeOnReturn') ) { + _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); + } + } + + ModItem( + { + renewals => $renews, + onloan => $datedue->strftime('%Y-%m-%d %H:%M'), + itemlost => 0, + }, + $biblio->{'biblionumber'}, + $itemnumber + ); # Charge a new rental fee, if applicable? my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); -- 1.7.10.4