LP1904036 Ang Checkout Support Auto-Renew
authorBill Erickson <berickxx@gmail.com>
Tue, 18 Jan 2022 22:10:45 +0000 (17:10 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:40 +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/open-circ-dialog.component.html

index 38c1762..636af45 100644 (file)
@@ -500,6 +500,12 @@ export class CircService {
                 return this.handlePrecat(result);
 
             case 'OPEN_CIRCULATION_EXISTS':
+
+                if (result.firstEvent.payload.auto_renew) {
+                    const coParams = Object.assign({}, result.params); // clone
+                    return this.renew(coParams);
+                }
+
                 return this.handleOpenCirc(result);
 
             case 'COPY_IN_TRANSIT':
@@ -590,7 +596,7 @@ export class CircService {
             this.components.openCircDialog.sameUser = sameUser;
             this.components.openCircDialog.circDate = circ.xact_start();
 
-            return this.components.openCircDialog.open().toPromise();
+            return this.components.openCircDialog.open({size: 'lg'}).toPromise();
         })
 
         .then(fromDialog => {
@@ -600,7 +606,7 @@ export class CircService {
 
             const coParams = Object.assign({}, result.params); // clone
 
-            if (sameUser) {
+            if (fromDialog.renew) {
                 coParams.void_overdues = fromDialog.forgiveFines;
                 return this.renew(coParams);
             }
index c50d7c3..ba5e812 100644 (file)
     <div class="flex-1"></div>
 
     <div>
-      <button type="button" class="btn btn-success" *ngIf="!sameUser"
-        (click)="close({forgiveFines: forgiveFines})" i18n>
+      <button type="button" class="btn btn-success"
+        (click)="close({checkout: true, forgiveFines: forgiveFines})" i18n>
         Normal Checkin Then Checkout</button>
 
-      <button type="button" class="btn btn-success" *ngIf="sameUser"
-        (click)="close({forgiveFines: forgiveFines})" i18n>Renew</button>
+      <button type="button" class="btn btn-info ml-2" *ngIf="sameUser"
+        (click)="close({renew: true, forgiveFines: forgiveFines})" i18n>Renew</button>
 
       <button type="button" class="btn btn-warning ml-2"
         (click)="close()" i18n>Cancel</button>