LP1904036 Improve checkin transit/hold handling
authorBill Erickson <berickxx@gmail.com>
Mon, 19 Jul 2021 19:47:37 +0000 (15:47 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:35 +0000 (20:13 -0400)
Be sure we fetch the latest transit for ROUTE_ITEM handling.

Avoid treating fulfilled holds, returned as info for a canceled hold
transit, as the basis for a new hold transit.

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/route-dialog.component.ts

index 1891887..40ce831 100644 (file)
@@ -912,7 +912,8 @@ export class CircService {
                 this.audio.play(result.hold ?
                     'info.checkin.transit.hold' : 'info.checkin.transit');
                 this.components.routeDialog.checkin = result;
-                return this.components.routeDialog.open().toPromise()
+                return this.findCopyTransit(result)
+                .then(_ => this.components.routeDialog.open().toPromise())
                 .then(_ => result);
 
             case 'ASSET_COPY_NOT_FOUND':
index 52eb795..55fad58 100644 (file)
@@ -104,7 +104,12 @@ export class RouteDialogComponent extends DialogComponent {
     applySettings(): Promise<boolean> {
 
         if (this.checkin.transit) {
-            if (this.checkin.patron) {
+            if (this.checkin.patron && this.checkin.hold &&
+                // It's possible to recieve a fulfilled hold in the
+                // checkin response when a checkin results in canceling
+                // a hold transit for a hold that was fulfilled while
+                // the item was in transit.
+                !this.checkin.hold.fulfillment_time()) {
                 this.slip = 'hold_transit_slip';
             } else {
                 this.slip = 'transit_slip';