From b59e0166125efdd381078ccf57ef7fd7b03b1cd4 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Sun, 23 Aug 2009 09:51:50 -0400 Subject: [PATCH] AddReturn now always updates holdingbranch Prior to this patch, this was done only when returning an item after it had been out on loan. Even if the item had not been on loan, the fact that it was checked in means that it is now in fact at the new holding library. Signed-off-by: Galen Charlton --- C4/Circulation.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 5930bed56b..5edc736603 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1469,15 +1469,17 @@ sub AddReturn { $messages->{'WasReturned'} = 1; # FIXME is the "= 1" right? This could be the borrower hash. } - # the holdingbranch is updated if the document is returned to another location. - if ($item->{'holdingbranch'} ne $branch) { - UpdateHoldingbranch($branch, $item->{'itemnumber'}); - $item->{'holdingbranch'} = $branch; # update item data holdingbranch too - } - ModDateLastSeen( $item->{'itemnumber'} ); ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'}); } + # the holdingbranch is updated if the document is returned to another location. + # this is always done regardless of whether the item was on loan or not + if ($item->{'holdingbranch'} ne $branch) { + UpdateHoldingbranch($branch, $item->{'itemnumber'}); + $item->{'holdingbranch'} = $branch; # update item data holdingbranch too + } + ModDateLastSeen( $item->{'itemnumber'} ); + # check if we have a transfer for this document my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->{'itemnumber'} ); -- 2.39.5