LP1904036 checkin; route dialogs
authorBill Erickson <berickxx@gmail.com>
Fri, 9 Apr 2021 16:50:38 +0000 (12:50 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:30 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts
Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html
Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html
Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.ts

index e347c1a..619e31f 100644 (file)
@@ -260,18 +260,13 @@ export class CircService {
         // the transit we want, since a transit close + open in the API
         // returns the closed transit.
 
-         return this.pcrud.search('atc',
-            {   dest_recv_time : null, cancel_time : null},
-            {   flesh : 1,
+         return this.pcrud.search('atc', {
+                dest_recv_time : null,
+                cancel_time : null,
+                target_copy: result.copy.id()
+            }, {
+                flesh : 1,
                 flesh_fields : {atc : ['target_copy']},
-                join : {
-                    acp : {
-                        filter : {
-                            barcode : result.params.copy_barcode,
-                            deleted : 'f'
-                        }
-                    }
-                },
                 limit : 1,
                 order_by : {atc : 'source_send_time desc'},
             }, {authoritative : true}
@@ -627,6 +622,12 @@ export class CircService {
                     return this.components.routeToCatalogingDialog.open()
                     .toPromise().then(_ => result);
                 }
+
+            case 'ROUTE_ITEM':
+                this.components.routeDialog.checkin = result;
+                return this.components.routeDialog.open().toPromise()
+                .then(_ => result);
+
         }
 
         return Promise.resolve(result);
index 1850598..a8d85eb 100644 (file)
@@ -7,6 +7,8 @@
     </button>
   </div>
   <div class="modal-body">
+
+    ROUTE DIALOG
   </div>
   <div class="modal-footer">
     <button type="button" class="btn btn-success" (click)="close()" i18n>Submit</button>
index d488a51..94da527 100644 (file)
@@ -17,8 +17,8 @@ import {PrintService} from '@eg/share/print/print.service';
 /** Route Item Dialog */
 
 @Component({
-  templateUrl: 'components.component.html',
-  selector: 'eg-circ-components'
+  templateUrl: 'route-dialog.component.html',
+  selector: 'eg-circ-route-dialog'
 })
 export class RouteDialogComponent extends DialogComponent {
 
@@ -42,6 +42,10 @@ export class RouteDialogComponent extends DialogComponent {
 
     open(ops?: NgbModalOptions): Observable<any> {
 
+        // Depending on various settings, the dialog may never open.
+        // But in some cases we still have to collect the data
+        // for printing.
+
         return from(this.applySettings())
 
         .pipe(concatMap(exit => {
@@ -88,7 +92,7 @@ export class RouteDialogComponent extends DialogComponent {
             promise = promise.then(_ => this.circ.findCopyTransit(this.checkin))
             .then(transit => {
                 this.checkin.transit = transit;
-                return this.org.settings('lib.courier_code', transit.dest.id())
+                return this.org.settings('lib.courier_code', transit.dest().id())
                 .then(sets => this.destCourierCode = sets['lib.courier_code']);
             });
         }