background-color: rgb(248, 248, 248);
}
+.patron-status-color { border: 2px solid transparent; padding: 3px; padding-left: 5px;}
+.patron-status-color.NO_PENALTIES { border-color: lime; }
+.patron-status-color.ONE_PENALTY { border-color: #66FFFF; }
+.patron-status-color.MULTIPLE_PENALTIES { border-color: #FF6633; }
+.patron-status-color.PATRON_HAS_STAFF_ALERT { border-color: blue; }
+.patron-status-color.PATRON_HAS_BILLS { border-color: #FFC266; }
+.patron-status-color.PATRON_HAS_OVERDUES { border-color: #FFC266; }
+.patron-status-color.PATRON_HAS_LOST { border-color: #FFC266; }
+.patron-status-color.PATRON_EXCEEDS_CHECKOUT_COUNT { border-color: #C99DFF; }
+.patron-status-color.PATRON_EXCEEDS_OVERDUE_COUNT { border-color: #C99DFF; }
+.patron-status-color.PATRON_EXCEEDS_FINES { border-color: #C99DFF; }
+.patron-status-color.PATRON_HAS_ALERT { border-color: yellow; }
+.patron-status-color.PATRON_INACTIVE { border-color: #333333; }
+.patron-status-color.PATRON_EXPIRED { border-color: #666666; }
+.patron-status-color.PATRON_BARRED { border-color: #CC3300; }
+.patron-status-color.PATRON_JUVENILE { border-color: lightblue; }
+
+
<div class="patron-summary-container">
- <div class="row d-flex">
- <div class="flex-1 pt-1">
+ <div class="row d-flex patron-status-color rounded {{patronStatusColor()}}">
+ <div class="flex-1 pt-1 {{patronStatusColor()}}">
<h4 class="font-weight-bold" i18n>
{{p().family_name()}},
{{p().first_given_name()}}
</div>
</div>
+ <div class="row mb-1 alert alert-warning p-0" *ngIf="p().juvenile() == 't'">
+ <div class="col-lg-12" i18n>
+ Juvenile Account
+ </div>
+ </div>
+
<div class="row mb-1 alert alert-danger p-0"
*ngFor="let pen of summary.alerts.alertPenalties">
<div class="col-lg-9"
const org = this.org.get(orgId);
return org ? org.shortname() : '';
}
+
+ patronStatusColor(): string {
+
+ const patron = this.p();
+
+ if (patron.barred() === 't') {
+ return 'PATRON_BARRED';
+ }
+
+ if (patron.active() === 'f') {
+ return 'PATRON_INACTIVE';
+ }
+
+ if (this.summary.stats.fines.balance_owed > 0) {
+ return 'PATRON_HAS_BILLS';
+ }
+
+ if (this.summary.stats.checkouts.overdue > 0) {
+ return 'PATRON_HAS_OVERDUES';
+ }
+
+ if (patron.notes().length > 0) {
+ return 'PATRON_HAS_NOTES';
+ }
+
+ if (this.summary.stats.checkouts.lost > 0) {
+ return 'PATRON_HAS_LOST';
+ }
+
+ let penalty: string;
+ let penaltyCount = 0;
+
+ patron.standing_penalties().some(p => {
+ penaltyCount++;
+
+ if (p.standing_penalty().staff_alert() === 't' ||
+ p.standing_penalty().block_list()) {
+ penalty = 'PATRON_HAS_STAFF_ALERT';
+ return true;
+ }
+
+ const name = p.standing_penalty();
+
+ switch (name) {
+ case 'PATRON_EXCEEDS_CHECKOUT_COUNT':
+ case 'PATRON_EXCEEDS_OVERDUE_COUNT':
+ case 'PATRON_EXCEEDS_FINES':
+ penalty = name;
+ return true;
+ }
+ });
+
+ if (penalty) { return penalty; }
+
+ if (penaltyCount === 1) {
+ return 'ONE_PENALTY';
+ } else if (penaltyCount > 1) {
+ return 'MULTIPLE_PENALTIES';
+ }
+
+ if (patron.alert_message()) {
+ return 'PATRON_HAS_ALERT';
+ }
+
+ if (patron.juvenile() === 't') {
+ return 'PATRON_JUVENILE';
+ }
+
+ return 'NO_PENALTIES';
+ }
}