lost: number,
out: number,
total_out: number,
- long_overdue: number
+ long_overdue: number,
+ noncat: number
};
+ holds: {
+ ready: number;
+ total: number;
+ }
}
@Injectable()
this.accountExpired = false;
this.accountExpiresSoon = false;
+ // When quickly navigating patron search results it's possible
+ // for this.patron to be cleared right before this function
+ // is called. Exit early instead of making an unneeded call.
+ // For this func. in particular a nasty JS error is thrown.
+ if (!this.patron) { return Promise.resolve(); }
+
return this.patronService.testExpire(this.patron)
.then(value => {
if (value === 'expired') {
getPatronStats(id: number): Promise<any> {
+ // When quickly navigating patron search results it's possible
+ // for this.patron to be cleared right before this function
+ // is called. Exit early instead of making an unneeded call.
+ if (!this.patron) { return Promise.resolve(); }
+
return this.net.request(
'open-ils.actor',
'open-ils.actor.user.opac.vital_stats.authoritative',
stats.checkouts.total_out += stats.checkouts.lost
}
- return this.patronStats = stats;
+ this.patronStats = stats;
+
+ }).then(_ => {
+
+ if (!this.patron) { return; }
+
+ return this.net.request(
+ 'open-ils.circ',
+ 'open-ils.circ.open_non_cataloged_circulation.user.authoritative',
+ this.auth.token(), id).toPromise()
+
+ }).then(noncats => {
+ if (noncats && this.patronStats) {
+ this.patronStats.checkouts.noncat = noncats.length;
+ }
});
}
}
</div>
<div class="row mb-1">
<div class="col-lg-5" i18n>Non-Cataloged</div>
- <div class="col-lg-7">XXXX</div>
+ <div class="col-lg-7">{{context.patronStats.checkouts.noncat}}</div>
</div>
<div class="row">
<div class="col-lg-5" i18n>Holds</div>
- <div class="col-lg-7">XX / YY</div>
+ <div class="col-lg-7">
+ {{context.patronStats.holds.ready}} / {{context.patronStats.holds.total}}
+ </div>
</div>
<hr class="m-1"/>