LP1904036 Circ service refactor; renewal failures
authorBill Erickson <berickxx@gmail.com>
Thu, 15 Jul 2021 20:36:04 +0000 (16:36 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:35 +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

index 40ce831..422ddda 100644 (file)
@@ -292,11 +292,18 @@ export class CircService {
         // NOTE: result.transit may exist, but it's not necessarily
         // the transit we want, since a transit close + open in the API
         // returns the closed transit.
+        return this.findCopyTransitById(result.copy.id())
+        .then(transit => {
+            result.transit = transit;
+            return transit;
+         });
+    }
 
-         return this.pcrud.search('atc', {
+    findCopyTransitById(copyId: number): Promise<IdlObject> {
+        return this.pcrud.search('atc', {
                 dest_recv_time : null,
                 cancel_time : null,
-                target_copy: result.copy.id()
+                target_copy: copyId
             }, {
                 limit : 1,
                 order_by : {atc : 'source_send_time desc'},
@@ -305,7 +312,6 @@ export class CircService {
             if (transit) {
                 transit.source(this.org.get(transit.source()));
                 transit.dest(this.org.get(transit.dest()));
-                result.transit = transit;
                 return transit;
             }
 
@@ -487,6 +493,7 @@ export class CircService {
             case 'PATRON_INACTIVE':
             case 'PATRON_ACCOUNT_EXPIRED':
             case 'CIRC_CLAIMS_RETURNED':
+            case 'ACTOR_USER_NOT_FOUND':
                 this.audio.play(`warning.${key}`);
                 return this.exitAlert({
                     textcode: result.firstEvent.textcode,
index 691e917..3a445e7 100644 (file)
 <eg-string key="staff.circ.events.ASSET_COPY_NOT_FOUND" i18n-text
   text="Item was not found and cannot be renewed."></eg-string>
 
+<eg-string key="staff.circ.events.ACTOR_USER_NOT_FOUND" i18n-text
+  text="Item is not checked out cannot be renewed."></eg-string>
+
+
 <ng-template #claimsReturnsTmpl>
   Item "{{barcode}}" is marked as Claims Returned</ng-template>
 <eg-string key="staff.circ.events.CIRC_CLAIMS_RETURNED"