LP1904036 patron tab counts
authorBill Erickson <berickxx@gmail.com>
Tue, 9 Mar 2021 15:25:17 +0000 (10:25 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:25 +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/patron.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.ts

index 53024df..e92bdfd 100644 (file)
@@ -56,7 +56,9 @@
         </li>
 
         <li ngbNavItem="items_out" [disabled]="!context.patron">
-          <a ngbNavLink i18n>Items Out</a>
+          <a ngbNavLink i18n>
+            Items Out ({{counts('checkouts', 'total_out')}})
+          </a>
           <ng-template ngbNavContent>
             <div class="">
               <eg-patron-items [patronId]="patronId"></eg-patron-items>
         </li>
 
         <li ngbNavItem="holds" [disabled]="!context.patron">
-          <a ngbNavLink i18n>Holds</a>
+          <a ngbNavLink i18n>
+            Holds ({{counts('holds', 'ready')}} / {{counts('holds', 'total')}})
+          </a>
           <ng-template ngbNavContent>
             <eg-patron-holds></eg-patron-holds>
           </ng-template>
         </li>
 
         <li ngbNavItem="bills" [disabled]="!context.patron">
-          <a ngbNavLink i18n>Bills</a>
+          <a ngbNavLink i18n>
+            Bills 
+            <span [ngClass]="{'text-danger': counts('fines', 'balance_owed') > 0}">
+              ({{counts('fines', 'balance_owed') | currency}})
+            </span>
+          </a>
           <ng-template ngbNavContent>
             <eg-patron-bills [patronId]="patronId"></eg-patron-bills>
           </ng-template>
index 9c28ee7..6c5eeba 100644 (file)
@@ -178,5 +178,13 @@ export class PatronComponent implements OnInit, AfterViewInit {
         // show scary warning, etc.
 
     }
+
+    counts(part: string, field: string): number {
+        if (this.context && this.context.patronStats) {
+            return this.context.patronStats[part][field];
+        } else {
+            return 0;
+        }
+    }
 }