lp1749502 Holds Pull List Print Order
authorKyle Huckins <khuckins@catalyte.io>
Thu, 17 May 2018 21:08:27 +0000 (21:08 +0000)
committerJason Stephenson <jason@sigio.com>
Tue, 19 Mar 2019 21:17:45 +0000 (17:17 -0400)
- Ensure copy shelf location position is available for each hold on
holds shelf.
- Add _copy_location_position to hold_data while printing.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2
modified:   Open-ILS/web/js/ui/default/staff/circ/services/holds.js

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Josh Stompro <stompro@stompro.org>
Signed-off-by: John Amundson <jamundson@cwmars.org>
Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2
Open-ILS/web/js/ui/default/staff/circ/services/holds.js

index 47be206..8be65d4 100644 (file)
@@ -29,7 +29,7 @@ Template for printing a table of holds to pull. Fields include:
     </tr>
   </thead>
   <tbody>
-    <tr ng-repeat="hold_data in holds">
+    <tr ng-repeat="hold_data in holds | orderBy : ['hold._copy_location_position', 'volume.label']">
       <td>{{hold_data.hold.hold_type}}</td>
       <td>{{hold_data.title}}</td>
       <td>{{hold_data.author}}</td>
index f76d92b..0401ac2 100644 (file)
@@ -490,7 +490,7 @@ function($uibModal , $q , egCore , egConfirmDialog , egAlertDialog) {
         // current_copy is not always fleshed in the API
         if (hold.current_copy() && typeof hold.current_copy() != 'object') {
             hold.current_copy(hold_data.copy);
-            
+
             // likewise, current_copy's status isn't fleshed in the API
             if(hold.current_copy().status() !== null &&
                typeof hold.current_copy().status() != 'object')
@@ -498,6 +498,25 @@ function($uibModal , $q , egCore , egConfirmDialog , egAlertDialog) {
                     ).then(function(c) { hold.current_copy().status(c) });
         }
 
+        // current_copy's shelving location position isn't always accessible
+        if (hold.current_copy().location()) {
+            console.debug('fetching hold copy location order');
+            var location_id;
+            if (typeof hold.current_copy().location() != 'object') {
+                location_id = hold.current_copy().location();
+            } else {
+                location_id = hold.current_copy().location().id();
+            }
+            egCore.pcrud.search(
+                'acplo',
+                {location: location_id, org: egCore.auth.user().ws_ou()},
+                null,
+                {atomic:true}
+            ).then(function(orders) {
+                hold_data.hold._copy_location_position = orders[0].position();
+            });
+        }
+
         if (volume) {
             //Call number affixes are not always fleshed in the API
             if (volume.prefix() && typeof volume.prefix() != 'object') {