Bug 19840: Fix - display patron note on checkin
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 19 Dec 2017 18:40:45 +0000 (15:40 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 22 Dec 2017 16:15:36 +0000 (13:15 -0300)
If a patron let a note on the checkout (AllowCheckoutNotes), it is
supposed to be displayed when checked in.

Test plan:
1/ Enable AllowCheckoutNotes
2/ Check an item out
3/ At the opac let a note on the checkout
4/ Check the item in
   => With this patch applied you should see the notes displayed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

circ/returns.pl

index 91eb5cb..c69310b 100755 (executable)
@@ -281,9 +281,8 @@ if ($barcode) {
         my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => '', kohafield =>'items.materials', authorised_value => $materials });
         $materials = $descriptions->{lib} // $materials;
 
-        my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } );
-
-        my $biblio = $item->biblio;
+        my $checkout = $item->checkout;
+        my $biblio   = $item->biblio;
         $template->param(
             title            => $biblio->title,
             homebranch       => $item->homebranch,
@@ -297,7 +296,7 @@ if ($barcode) {
             biblionumber     => $biblio->biblionumber,
             borrower         => $borrower,
             additional_materials => $materials,
-            issue            => $issue,
+            issue            => $checkout,
         );
     } # FIXME else we should not call AddReturn but set BadBarcode directly instead