Bug 4372 - Fix for bookcount.pl not counting started transfers as seeing an item

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Chris Cormack 2010-04-26 07:44:33 +12:00 committed by Galen Charlton
parent 88d522aec1
commit 8478586cf1
2 changed files with 7 additions and 3 deletions

View file

@ -326,8 +326,9 @@ sub transferbook {
# don't need to update MARC anymore, we do it in batch now
$messages->{'WasTransfered'} = 1;
ModDateLastSeen( $itemnumber );
}
ModDateLastSeen( $itemnumber );
return ( $dotransfer, $messages, $biblio );
}

View file

@ -162,9 +162,12 @@ sub lastseenat {
$sth->execute( $itm, $brc, $itm, $brc );
my ($date1) = $sth->fetchrow_array;
$sth = $dbh->prepare(
"SELECT max(datearrived) FROM branchtransfers WHERE itemnumber=? AND tobranch = ?"
"SELECT MAX(transfer) FROM (SELECT max(datearrived) AS transfer FROM branchtransfers WHERE itemnumber=? AND tobranch = ?
UNION ALL
SELECT max(datesent) AS transfer FROM branchtransfers WHERE itemnumber=? AND frombranch = ?
) tmp"
);
$sth->execute( $itm, $brc );
$sth->execute( $itm, $brc, $itm, $brc );
my ($date2) = $sth->fetchrow_array;
my $date = ( $date1 lt $date2 ) ? $date2 : $date1 ;