// 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}
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);
/** 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 {
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 => {
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']);
});
}