LP1904036 Sanity check lack of barcode (card)
authorBill Erickson <berickxx@gmail.com>
Mon, 10 May 2021 16:44:42 +0000 (12:44 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:34 +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/circ/patron/edit.component.ts

index 1ebfd9d..e0ab319 100644 (file)
@@ -735,6 +735,10 @@ export class EditComponent implements OnInit, AfterViewInit {
         if (this.patron.waiver_entries().length === 0) {
             this.addWaiver();
         }
+
+        if (!this.patron.card()) {
+            this.replaceBarcode();
+        }
     }
 
     createNewPatron() {
@@ -1564,8 +1568,10 @@ export class EditComponent implements OnInit, AfterViewInit {
 
     replaceBarcode() {
         // Disable current card
-        this.patron.card().active('f');
-        this.patron.card().ischanged(true);
+        if (this.patron.card()) {
+            this.patron.card().active('f');
+            this.patron.card().ischanged(true);
+        }
 
         const card = this.idl.create('ac');
         card.isnew(true);