LP#1522635 Webstaff lost (etc.) checkout completes
authorBill Erickson <berickxx@gmail.com>
Thu, 4 Aug 2016 21:56:32 +0000 (17:56 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 18 Aug 2016 19:34:23 +0000 (15:34 -0400)
Resolves an issue in the browser client where checkout of LOST
(and other non status='checked out' copies) failed to show the
open-circ-exists dialog.  In short, when searching for an existing
open circulation, look for any open circulation linked to the copy,
regardless of the status of the copy.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 7f953d6..753f54b 100644 (file)
@@ -843,18 +843,12 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,
         if (angular.isArray(evt)) evt = evt[0];
 
         if (!evt.payload.old_circ) {
-            return egCore.net.request(
-                'open-ils.search',
-                'open-ils.search.asset.copy.fleshed2.find_by_barcode',
-                params.copy_barcode
-            ).then(function(resp){
-                console.log(resp);
-                if (egCore.evt.parse(resp)) {
-                    console.error(egCore.evt.parse(resp));
-                } else {
-                   evt.payload.old_circ = resp.circulations()[0];
-                   return service.circ_exists_dialog_impl( evt, params, options );
-                }
+            return egCore.pcrud.search('circ',
+                {target_copy : evt.payload.copy.id(), checkin_time : null},
+                {limit : 1} // should only ever be 1
+            ).then(function(old_circ) {
+                evt.payload.old_circ = old_circ;
+               return service.circ_exists_dialog_impl(evt, params, options);
             });
         } else {
             return service.circ_exists_dialog_impl( evt, params, options );