@@ -, +, @@ --- svc/checkin | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) --- a/svc/checkin +++ a/svc/checkin @@ -27,6 +27,7 @@ use C4::Circulation; use C4::Items qw(GetBarcodeFromItemnumber GetItem ModItem); use C4::Context; use C4::Auth qw(check_cookie_auth); +use Koha::Checkouts; my $input = new CGI; @@ -73,13 +74,8 @@ if ( C4::Context->preference("ReturnToShelvingCart") ) { ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} ); } -my $dbh = C4::Context->dbh; -my $query = "SELECT note FROM issues WHERE itemnumber = ?"; -my $sth = $dbh->prepare($query); -$sth->execute($itemnumber); -my $issue = $sth->fetchrow_hashref; -my $patronnote = $issue->{note}; -$data->{patronnote} = $patronnote; +my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber }); +$data->{patronnote} = $checkout ? $checkout->note : q||; ( $data->{returned} ) = AddReturn( $barcode, $branchcode, $exempt_fine ); --