Getting there, it seems to be doing what it should now
authorChris Cormack <chrisc@catalyst.net.nz>
Wed, 5 Mar 2014 00:45:48 +0000 (13:45 +1300)
committerChris Cormack <chrisc@catalyst.net.nz>
Wed, 5 Mar 2014 00:45:48 +0000 (13:45 +1300)
lib/NCIP/ILS/Koha.pm
templates/problem.tt

index 3ac4288..171d1f1 100644 (file)
@@ -58,6 +58,7 @@ sub checkin {
         iteminformation => $issue,
         borrower        => $borrower
     };
+
     return $result;
 }
 
@@ -153,7 +154,20 @@ sub acceptitem {
         $result = { success => 0, messages => { NO_HOLD => 1 } };
         return $result;
     }
-    $result = $self->checkin( $barcode, $branchcode );
+    my ( $success, $messages, $issue, $borrower ) =
+      AddReturn( $barcode, $branch, $exemptfine, $dropbox );
+    if ( $messages->{'NotIssued'} ) {
+        $success = 1
+          ; # we do this because we are only doing the return to trigger the reserve
+    }
+
+    my $result = {
+        success         => $success,
+        messages        => $messages,
+        iteminformation => $issue,
+        borrower        => $borrower
+    };
+
     return $result;
 }
 1;
index 99dec61..c8d153b 100644 (file)
@@ -1,4 +1,4 @@
-[% INCLUDE 'includes/header.inc' %]
+[%# INCLUDE 'includes/header.inc' %]
   <[% messagetype %]>
     [% IF processingerror %]
     <Problem>