LP1956986 Holdings View display correct copy alerts count
authorBill Erickson <berickxx@gmail.com>
Wed, 13 Jul 2022 15:56:13 +0000 (11:56 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 27 Jul 2022 20:36:04 +0000 (16:36 -0400)
Avoid counting ACK'ed copies as active copy alerts in the catalog
Holdings View, copy alert column.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Elaine Hardy <ehardy@georgialibraries.org>
Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts

index 0c31d59..d946bb4 100644 (file)
@@ -704,6 +704,11 @@ export class HoldingsMaintenanceComponent implements OnInit {
                 copy.parts().map(p => p.label()).join(',');
         }
 
+        // Ignore alerts that have already been ACK'ed
+        // Over a long enough time, this list could grow large, so
+        // consider fetching non-ack'ed copy alerts separately.
+        copy.copy_alerts(copy.copy_alerts().filter(a => !a.ack_time()));
+
         if (stat === 1 /* checked out */ || stat === 16 /* long overdue */) {
             // Avoid looking up circs on items that are not checked out.
             this.itemCircsNeeded.push(copy);