Fix to update onloan to 0 even if the item isnt out to a borrower

Bug 1681

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Chris Cormack 2007-12-20 13:34:47 -06:00 committed by Joshua Ferraro
parent aa7a90738a
commit d9cfae182f
1 changed files with 9 additions and 9 deletions

View File

@ -1186,16 +1186,16 @@ sub AddReturn {
$iteminformation->{'holdingbranch'} = C4::Context->userenv->{'branch'};
}
ModDateLastSeen( $iteminformation->{'itemnumber'} );
my $sth = $dbh->prepare("UPDATE items SET onloan = NULL where itemnumber = ?");
$sth->execute($iteminformation->{'itemnumber'});
$sth->finish();
my $record = GetMarcItem( $iteminformation->{'biblionumber'}, $iteminformation->{'itemnumber'} );
my $frameworkcode = GetFrameworkCode( $iteminformation->{'biblionumber'} );
ModItemInMarc( $record, $iteminformation->{'biblionumber'}, $iteminformation->{'itemnumber'}, $frameworkcode );
if ($iteminformation->{borrowernumber}){
my $sth = $dbh->prepare("UPDATE items SET onloan = NULL where itemnumber = ?");
$sth->execute($iteminformation->{'itemnumber'});
$sth->finish();
my $record = GetMarcItem( $iteminformation->{'biblionumber'}, $iteminformation->{'itemnumber'} );
my $frameworkcode = GetFrameworkCode( $iteminformation->{'biblionumber'} );
ModItemInMarc( $record, $iteminformation->{'biblionumber'}, $iteminformation->{'itemnumber'}, $frameworkcode );
}
($borrower) = C4::Members::GetMemberDetails( $iteminformation->{borrowernumber}, 0 );
($borrower) = C4::Members::GetMemberDetails( $iteminformation->{borrowernumber}, 0 );
}
# fix up the accounts.....
if ( $iteminformation->{'itemlost'} ) {
$messages->{'WasLost'} = 1;