Bug 17981: (QA follow-up) Fix and update pod in svc/letters/get
[koha-ffzg.git] / svc / checkin
index c10a1b8..78db9d9 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2014 ByWater Solutions
+# Copyright 2016 Aleisha Amohia <aleisha@catalyst.net.nz>
 #
 # This file is part of Koha.
 #
@@ -26,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;
 
@@ -72,6 +74,9 @@ if ( C4::Context->preference("ReturnToShelvingCart") ) {
     ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
 }
 
+my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber });
+$data->{patronnote} = $checkout ? $checkout->note : q||;
+
 ( $data->{returned} ) = AddReturn( $barcode, $branchcode, $exempt_fine );
 
 print to_json($data);