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 <gmcharlt@gmail.com>
This commit is contained in:
Galen Charlton 2009-08-23 09:51:50 -04:00
parent 223d1fa6e8
commit b59e016612
1 changed files with 8 additions and 6 deletions

View File

@ -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'} );