LP#1751368 Items-out checkin of deleted copies user/jeffdavis/lp1751368-deleted-copy-checkin-signoff
authorBill Erickson <berickxx@gmail.com>
Tue, 19 Jun 2018 18:23:42 +0000 (14:23 -0400)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 29 Jun 2018 22:08:17 +0000 (15:08 -0700)
Allow deleted copies to be checked in from the patron items out list.
Checkin is based on copy ID instead of barcode.  Note that both values
are sent to the server, to reduce the number of changes in the UI code,
but the API inspects the ID first.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js

index 4543797..e1bcf2a 100644 (file)
@@ -504,16 +504,21 @@ function($scope , $q , $routeParams , $timeout , egCore , egUser , patronSvc ,
 
     $scope.checkin = function(items) {
         if (!items.length) return;
-        var barcodes = items.map(function(circ) 
-            { return circ.target_copy().barcode() });
+        var copies = items.map(function(circ) { return circ.target_copy() });
+        var barcodes = copies.map(function(copy) { return copy.barcode() });
 
         return egConfirmDialog.open(
             egCore.strings.CHECK_IN_CONFIRM, barcodes.join(' '), {
 
         }).result.then(function() {
+            var copy;
             function do_one() {
-                if (bc = barcodes.pop()) {
-                    egCirc.checkin({copy_barcode : bc})
+                if (copy = copies.pop()) {
+                    // Checkin expects a barcode, but will pass other
+                    // parameters too.  Passing the copy ID allows
+                    // for the checkin of deleted copies on the server.
+                    egCirc.checkin(
+                        {copy_barcode: copy.barcode(), copy_id: copy.id()})
                     .finally(do_one);
                 } else {
                     reset_page();