@if (!item.actions || item.loan || totalAmountOfFee || item.pending_loans || notifications$) {
}
-
+
@if (item.actionDone) {
@@ -59,7 +44,7 @@
}
-
+
-
-
- @if (item.loan) {
-
- @switch (item.status) {
- @case ('on_loan') {
-
- {{ item.status | translate }}
-
-
- {{ item.loan.dueDate | dateTranslate :'shortDate' }}
-
-
- }
- @case ('in_transit') {
-
- {{ item.status | translate }}
- @if (getTransitLocationPid() | getRecord: 'locations' | async; as location) {
- ({{ 'to' | translate }}
- @if (item.loan && item.loan.state === 'ITEM_IN_TRANSIT_FOR_PICKUP') {
- {{ $any(location).metadata.pickup_name }}
- } @else {
- {{ $any(location).metadata.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}
- })
- }
-
- }
- @case ('on_shelf') {
- {{ item.status | translate }}
- }
- @case ('at_desk') {
-
- {{ item.status | translate }}
- @if (item.loan && item.loan.pickup_location) {
- ({{ item.loan.pickup_location.pickup_name }})
- }
- @if (!item.loan && item.pending_loans && item.pending_loans.length > 0 && item.pending_loans[0].pickup_location) {
- ({{ item.pending_loans[0].pickup_location.pickup_name }})
- }
-
- }
- @default {
- {{ item.status | translate }}
- }
- }
-
-
- @if (isCollapsed && item.loan && item.loan.extension_count && (!item.actionDone || item.actionDone !== itemAction.checkin)) {
-
- {{ item.loan.extension_count }}
-
- }
- @if (isCollapsed && totalAmountOfFee > 0) {
-
- {{ totalAmountOfFee | currency: organisation.default_currency }}
-
- }
- @if (isCollapsed && item.pending_loans && item.pending_loans.length) {
-
-
-
- {{ item.pending_loans[0].patron.name }}
-
-
- }
-
-
- } @else {
- {{ item.status | translate }}
- }
-
-
-
- @if (item.actionDone) {
- @switch (item.actionDone) {
- @case (itemAction.checkin) {
-
- checked in
- }
- @case (itemAction.checkout) {
-
- checked out
- }
- @case (itemAction.extend_loan) {
-
- renewed
- }
- @default {
- {{ item.actionDone | translate }}
- }
- }
- }
-
-
+
@if (!isCollapsed) {
-
-
- Call number
-
-
+
+
+ Call number
+
+
@if (item.enumerationAndChronology) {
- Unit
-
+ Unit
+
{{ item.enumerationAndChronology }}
}
@if (item.location.pid | getRecord: 'locations' | async; as location) {
- Location
-
+ Location
+
{{ $any(location).metadata.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}:
{{ $any(location).metadata.name }}
}
@if (item.temporary_location) {
- Temporary location
-
+ Temporary location
+
{{ item.temporary_location.name }}
}
@if (item.collections && item.collections.length > 0) {
- Exhibition/course
-
+ Exhibition/course
+
{{ item.collections.join(', ') }}
}
@if (item.loan && item.loan.extension_count) {
- Renewals
-
+ Renewals
+
{{ item.loan.extension_count }}
@@ -213,14 +104,14 @@
}
@if (item.loan && item.actionDone === 'checkin' && item?.loan?.last_end_date) {
- Due date
-
+ Due date
+
{{ item.loan.last_end_date | dateTranslate :'shortDate' }}
}
@if (item.loan && totalAmountOfFee > 0) {
- Fees
-
+ Fees
+
{{ totalAmountOfFee | currency: organisation.default_currency }}
@@ -228,12 +119,12 @@
}
@if (item.loan && notifications$ | async; as notifications) {
@if (notifications.length > 0) {
- Notifications
-
-
+ Notifications
+
+
@for (notification of notifications; track notification) {
-
+
{{ notification.metadata.process_date
? (notification.metadata.process_date | dateTranslate :'short')
: (notification.metadata.creation_date | dateTranslate : 'shortDate')
@@ -249,8 +140,8 @@
}
}
@if (item.pending_loans) {
- Requests
-
+ Requests
+
@if (item.pending_loans.length > 1) {
{{ item.pending_loans.length }}
@@ -267,48 +158,176 @@
}
@for (note of getCirculationNoteForAction(); track note) {
-
-
- @if (note.type !== NOTEAPI) {
- {{ note.type | translate }}
- } @else {
- {{ 'Note' | translate }}
- }
+
+ @if (note.type !== NOTEAPI) {
+ {{ note.type | translate }}
+ } @else {
+ {{ 'Note' | translate }}
+ }
- {{ note.content }}
+ {{ note.content }}
}
- @if (debugMode) {
-
- Debug
- @if (loan) {
-
- {{ loan | json }}loan
-
- @if (loan | getLoanCipo | async; as cipo) {
-
- {{ cipo | json }}
-
- cipo
-
-
-
- }
- } @else {
-
- {{ item | json }}item
-
+
+
+ }
+
+
+
+ @if (item.loan) {
+
+ @switch (item.status) {
+ @case ('on_loan') {
+
+ {{ item.status | translate }}
+
+
+ {{ item.loan.dueDate | dateTranslate :'shortDate' }}
+
+
+ }
+ @case ('in_transit') {
+
+ {{ item.status | translate }}
+ @if (getTransitLocationPid() | getRecord: 'locations' | async; as location) {
+ ({{ 'to' | translate }}
+ @if (item.loan && item.loan.state === 'ITEM_IN_TRANSIT_FOR_PICKUP') {
+ {{ $any(location).metadata.pickup_name }}
+ } @else {
+ {{ $any(location).metadata.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}
+ })
+ }
+
+ }
+ @case ('on_shelf') {
+ {{ item.status | translate }}
+ }
+ @case ('at_desk') {
+
+ {{ item.status | translate }}
+ @if (item.loan && item.loan.pickup_location) {
+ ({{ item.loan.pickup_location.pickup_name }})
+ }
+ @if (!item.loan && item.pending_loans && item.pending_loans.length > 0 && item.pending_loans[0].pickup_location) {
+ ({{ item.pending_loans[0].pickup_location.pickup_name }})
+
+ }
+
+ }
+ @default {
+ {{ item.status | translate }}
}
}
-
- @if (canUseDebugMode) {
-
-
-
-
+
+
+ @if (isCollapsed && item.loan && item.loan.extension_count && (!item.actionDone || item.actionDone !== itemAction.checkin)) {
+
+ {{ item.loan.extension_count }}
+
+ }
+ @if (isCollapsed && totalAmountOfFee > 0) {
+
+ {{ totalAmountOfFee | currency: organisation.default_currency }}
+
+ }
+ @if (isCollapsed && item.pending_loans && item.pending_loans.length) {
+
+
+
+ {{ item.pending_loans[0].patron.name }}
+
+
+ }
+
+
+ } @else {
+ {{ item.status | translate }}
+ }
+
+
+
+
+ @if (item.actionDone) {
+
+ @switch (item.actionDone) {
+ @case (itemAction.checkin) {
+
+ checked in
+ }
+ @case (itemAction.checkout) {
+
+ checked out
+ }
+ @case (itemAction.extend_loan) {
+
+ renewed
+ }
+ @default {
+ {{ item.actionDone | translate }}
+ }
+ }
+
+ } @else {
+
}
+ @if (canUseDebugMode && !isCollapsed) {
+
+ }
+
+ @if (debugMode && !isCollapsed) {
+
+
{{ 'Debug' | translate }}
+
+ @if (loan) {
+
+
+
Loan
+
+ {{ loan | json }}
+
+
+
+
+ @if (loan | getLoanCipo | async; as cipo) {
+
+
+ {{ 'Circulation policy' | translate }}
+
+
+
+
+
+ {{ cipo | json }}
+
+
+ }
+
+ } @else {
+
+
+
Item
+
+ {{ item | json }}
+
+
+
+ }
+
+
}
}
diff --git a/projects/admin/src/app/circulation/item/item.component.ts b/projects/admin/src/app/circulation/item/item.component.ts
index f2bc990cb..1998972ba 100644
--- a/projects/admin/src/app/circulation/item/item.component.ts
+++ b/projects/admin/src/app/circulation/item/item.component.ts
@@ -30,8 +30,7 @@ import { map } from 'rxjs/operators';
@Component({
selector: 'admin-item',
- templateUrl: './item.component.html',
- styleUrls: ['../circulation.scss']
+ templateUrl: './item.component.html'
})
export class ItemComponent implements OnInit {
diff --git a/projects/admin/src/app/circulation/items-list/items-list.component.html b/projects/admin/src/app/circulation/items-list/items-list.component.html
index 6e58e63a3..129c2b028 100644
--- a/projects/admin/src/app/circulation/items-list/items-list.component.html
+++ b/projects/admin/src/app/circulation/items-list/items-list.component.html
@@ -21,44 +21,52 @@
}
@if ((checkedOutItems && checkedOutItems.length > 0) || (checkedInItems && checkedInItems.length > 0)) {
-
-
-
- {{ 'Items' | translate }}
-
-
Document
-
Circulation info
-
- @if (patron) {
-
+
+
+
+
Document
+
Circulation info
+
+
+
+
+
+
+ @for (item of checkedOutItems; track item) {
+
}
-
-
-
- @for (item of checkedOutItems; track item) {
-
-
- }
-
-
-
- @for (item of checkedInItems; track item) {
-
-
- }
+
+
+ @for (item of checkedInItems; track item) {
+
+ }
+
+
}
diff --git a/projects/admin/src/app/circulation/items-list/items-list.component.ts b/projects/admin/src/app/circulation/items-list/items-list.component.ts
index 6b90bcd1b..a755f7e98 100644
--- a/projects/admin/src/app/circulation/items-list/items-list.component.ts
+++ b/projects/admin/src/app/circulation/items-list/items-list.component.ts
@@ -21,7 +21,6 @@ import { ItemAction } from '../../classes/items';
@Component({
selector: 'admin-circulation-items-list',
- styleUrls: ['./items-list.component.scss'],
templateUrl: './items-list.component.html'
})
export class ItemsListComponent implements OnInit{
diff --git a/projects/admin/src/app/circulation/main-request/main-request.component.html b/projects/admin/src/app/circulation/main-request/main-request.component.html
index dd265ff9c..0c73d4620 100644
--- a/projects/admin/src/app/circulation/main-request/main-request.component.html
+++ b/projects/admin/src/app/circulation/main-request/main-request.component.html
@@ -25,30 +25,49 @@
/>
-
-
+
-
-
0" (onChange)="enableAutoRefresh($event.checked)" />
- Auto refresh
+
+
+
0" (onChange)="enableAutoRefresh($event.checked)" />
+ Auto refresh
+
+
+ @if (refreshInterval > 0) {
+
+
+
+
+
+
+
+
+
+ }
+
+
+
+
+
+
+
+
+
+
+
- @if (refreshInterval > 0) {
-
- }
-
-
@@ -56,7 +75,6 @@
diff --git a/projects/admin/src/app/circulation/main-request/main-request.component.ts b/projects/admin/src/app/circulation/main-request/main-request.component.ts
index 433da8321..31d466297 100644
--- a/projects/admin/src/app/circulation/main-request/main-request.component.ts
+++ b/projects/admin/src/app/circulation/main-request/main-request.component.ts
@@ -38,24 +38,24 @@ export class MainRequestComponent implements OnInit, OnDestroy {
// COMPONENT ATTRIBUTES ==================================================================
/** options used for auto-refresh select box */
public refreshOptions = [
- {value: '15000', label: '15 s', icon: 'fa-clock-o'},
- {value: '30000', label: '30 s', icon: 'fa-clock-o'},
- {value: '60000', label: '1 m', icon: 'fa-clock-o'},
- {value: '300000', label: '5 m', icon: 'fa-clock-o'},
- {value: '600000', label: '10 m', icon: 'fa-clock-o'},
- {value: '3000000', label: '30 m', icon: 'fa-clock-o'}
+ {value: '15000', label: '15 s', icon: 'fa fa-clock-o'},
+ {value: '30000', label: '30 s', icon: 'fa fa-clock-o'},
+ {value: '60000', label: '1 m', icon: 'fa fa-clock-o'},
+ {value: '300000', label: '5 m', icon: 'fa fa-clock-o'},
+ {value: '600000', label: '10 m', icon: 'fa fa-clock-o'},
+ {value: '3000000', label: '30 m', icon: 'fa fa-clock-o'}
];
/** options used to sort requested items list */
public sortingCriteria = [
- {value: 'requestdate', label: this.translateService.instant('Request date'), icon: 'fa-sort-numeric-asc'},
- {value: '-requestdate', label: this.translateService.instant('Request date (desc)'), icon: 'fa-sort-numeric-desc'},
- {value: 'callnumber', label: this.translateService.instant('Call number'), icon: 'fa-sort-alpha-asc'},
- {value: '-callnumber', label: this.translateService.instant('Call number (desc)'), icon: 'fa-sort-alpha-desc'},
- {value: 'location', label: this.translateService.instant('Location'), icon: 'fa-sort-alpha-asc'},
- {value: '-location', label: this.translateService.instant('Location (desc)'), icon: 'fa-sort-alpha-desc'},
- {value: 'pickuplocation', label: this.translateService.instant('Pick-up location'), icon: 'fa-sort-alpha-asc'},
- {value: '-pickuplocation', label: this.translateService.instant('Pick-up location (desc)'), icon: 'fa-sort-alpha-desc'},
+ {value: 'requestdate', label: this.translateService.instant('Request date'), icon: 'fa fa-sort-numeric-asc'},
+ {value: '-requestdate', label: this.translateService.instant('Request date (desc)'), icon: 'fa fa-sort-numeric-desc'},
+ {value: 'callnumber', label: this.translateService.instant('Call number'), icon: 'fa fa-sort-alpha-asc'},
+ {value: '-callnumber', label: this.translateService.instant('Call number (desc)'), icon: 'fa fa-sort-alpha-desc'},
+ {value: 'location', label: this.translateService.instant('Location'), icon: 'fa fa-sort-alpha-asc'},
+ {value: '-location', label: this.translateService.instant('Location (desc)'), icon: 'fa fa-sort-alpha-desc'},
+ {value: 'pickuplocation', label: this.translateService.instant('Pick-up location'), icon: 'fa fa-sort-alpha-asc'},
+ {value: '-pickuplocation', label: this.translateService.instant('Pick-up location (desc)'), icon: 'fa fa-sort-alpha-desc'},
];
/** the placeholder string used on the */
@@ -66,8 +66,6 @@ export class MainRequestComponent implements OnInit, OnDestroy {
public items = null;
/** the interval (in millis) between 2 calls of requested items (0 = no refresh) */
public refreshInterval = 0;
- /** is the requested items detail should be collapsed or not */
- public isDetailCollapsed = true;
/** Focus attribute of the search input */
public searchInputFocus = true;
/** Disabled attribute of the search input */
diff --git a/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.html b/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.html
index 1ee714091..c36f6a38f 100644
--- a/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.html
+++ b/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.html
@@ -1,6 +1,6 @@
@if (document) {
-
-
+
+
+
+
+
+
+
{{ item.loan.creation_date | dateTranslate :'medium' }}
+
@if (item.loan.state === LoanState.PENDING) {
}
-
-
-
- @if (document.title | mainTitle; as title) {
-
- {{ title }}
-
+ @if (!isCollapsed) {
+
+
+ @if (item.enumerationAndChronology) {
+ Unit
+ {{ item.enumerationAndChronology }}
}
-
-
-
-
-
-
{{ item.loan.creation_date | dateTranslate :'medium' }}
-
- @if (!isCollapsed) {
-
-
-
- @if (item.enumerationAndChronology) {
- Unit
- {{ item.enumerationAndChronology }}
- }
-
- Requested by
-
-
- {{ item.loan.patron.name }}
-
-
-
- Location
-
- {{ item.library.name }} -
- @if (item.temporary_location?.name) {
- {{ item.temporary_location.name }}
- } @else {
- {{ item.location.name }}
- }
+
+ Requested by
+
+
+ {{ item.loan.patron.name }}
+
+
+
+ Location
+
+ {{ item.library.name }} -
+ @if (item.temporary_location?.name) {
+ {{ item.temporary_location.name }}
+ } @else {
+ {{ item.location.name }}
+ }
-
- Pick-up location
-
-
-
- @if (item.loan.pickup_location.pickup_name) {
- {{ item.loan.pickup_location.pickup_name }}
- } @else {
- {{ item.loan.pickup_location.library_name }}: {{ item.loan.pickup_location.name }}
- }
-
-
-
- }
+
+
Pick-up location
+
+
+
+ @if (item.loan.pickup_location.pickup_name) {
+ {{ item.loan.pickup_location.pickup_name }}
+ } @else {
+ {{ item.loan.pickup_location.library_name }}: {{ item.loan.pickup_location.name }}
+ }
+
+
+ }
}
diff --git a/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts b/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts
index 1cac3d87b..f71920aee 100644
--- a/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts
+++ b/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts
@@ -21,8 +21,7 @@ import { RecordService } from '@rero/ng-core';
@Component({
selector: 'admin-requested-item',
- templateUrl: './requested-item.component.html',
- styleUrls: ['./requested-item.component.scss']
+ templateUrl: './requested-item.component.html'
})
export class RequestedItemComponent implements OnInit {
@@ -67,7 +66,6 @@ export class RequestedItemComponent implements OnInit {
getCallout() {
return (this.callout !== null)
? `callout ${this.callout}`
- : 'border rounded';
+ : null;
}
-
}
diff --git a/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.html b/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.html
index 5eaee360f..a6154ec86 100644
--- a/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.html
+++ b/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.html
@@ -14,25 +14,42 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see
.
-->
+@defer (when items) {
+
+
+
+
+
+
+
+ Item
+
-
-
Item
-
Document
-
Call number
-
Request date
-
-
-@if (items) {
- @if (items.length > 0) {
- @for (item of items; track item) {
-
+
+
Document
+
Call number
+
Request date
+
+
+
+
+ @if (items.length > 0) {
+
+ @for (item of items; track item) {
+
+ }
+
+ } @else {
+
+ {{ 'no request to validate' | translate }}
+
}
- } @else {
- {{ 'no request to validate' | translate }}
- }
+
+} @placeholder {
+
Loading in progress
}
diff --git a/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts b/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts
index c0bc2cb0e..e31dd851c 100644
--- a/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts
+++ b/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts
@@ -28,11 +28,12 @@ export class RequestedItemsListComponent implements OnChanges {
// COMPONENT ATTRIBUTES ====================================================
/** Item list */
@Input() items: any[];
- /** Is the item detail should be collapsed */
- @Input() isCollapsed: boolean;
+
/** event emit when a request is validated */
@Output() requestValidated = new EventEmitter();
+ /** Is the item detail should be collapsed */
+ isCollapsed: boolean = true;
/** the know item barcode list */
private knownItemBarcodes: Array
= null;
@@ -68,5 +69,4 @@ export class RequestedItemsListComponent implements OnChanges {
validateRequest(itemBarcode: string) {
this.requestValidated.emit(itemBarcode);
}
-
}
diff --git a/projects/admin/src/app/circulation/patron/cancel-request-button.component.ts b/projects/admin/src/app/circulation/patron/cancel-request-button.component.ts
index 35061e00c..ada05bbd7 100644
--- a/projects/admin/src/app/circulation/patron/cancel-request-button.component.ts
+++ b/projects/admin/src/app/circulation/patron/cancel-request-button.component.ts
@@ -24,22 +24,17 @@ import { MessageService } from 'primeng/api';
@Component({
selector: 'admin-cancel-request-button',
template: `
- @if (canCancelRequest()) {
- } @else {
-
- }
`
})
export class CancelRequestButtonComponent {
diff --git a/projects/admin/src/app/circulation/patron/card/card.component.html b/projects/admin/src/app/circulation/patron/card/card.component.html
index 5f66fdb1b..fbc2e9d2d 100644
--- a/projects/admin/src/app/circulation/patron/card/card.component.html
+++ b/projects/admin/src/app/circulation/patron/card/card.component.html
@@ -15,11 +15,11 @@
along with this program. If not, see .
-->
@if (patron?.patron) {
-
+
-
+
-
+
@@ -63,10 +63,10 @@
@if (patron.notes) {
-
+
@for (note of patron.notes; track note) {
- {{ note.type | translate | ucfirst }}
+ {{ note.type | translate | ucfirst }}
}
@@ -75,7 +75,7 @@
}
-
+
@if (displayCirculationMessages) {
@if (patron.circulation_information) {
@@ -88,14 +88,12 @@
/>
}
}
- @for (message of circulationMessages; track message) {
-
- }
+
}
diff --git a/projects/admin/src/app/circulation/patron/card/card.component.scss b/projects/admin/src/app/circulation/patron/card/card.component.scss
index a3ed182c0..220c186e6 100644
--- a/projects/admin/src/app/circulation/patron/card/card.component.scss
+++ b/projects/admin/src/app/circulation/patron/card/card.component.scss
@@ -29,3 +29,7 @@
visibility: hidden;
}
}
+
+.p-message {
+ @extend .mt-0;
+}
diff --git a/projects/admin/src/app/circulation/patron/card/card.component.ts b/projects/admin/src/app/circulation/patron/card/card.component.ts
index a0ee6920d..d9de70be1 100644
--- a/projects/admin/src/app/circulation/patron/card/card.component.ts
+++ b/projects/admin/src/app/circulation/patron/card/card.component.ts
@@ -14,17 +14,16 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see
.
*/
-import { Component, EventEmitter, inject, Input, Output } from '@angular/core';
+import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core';
import { DateTime } from 'luxon';
import { getSeverity } from '../../../utils/utils';
import { CirculationService } from '../../services/circulation.service';
@Component({
selector: 'admin-circulation-patron-detailed',
- templateUrl: './card.component.html',
- styleUrls: ['./card.component.scss']
+ templateUrl: './card.component.html'
})
-export class CardComponent {
+export class CardComponent implements OnInit {
private circulationService: CirculationService = inject(CirculationService);
@@ -42,40 +41,38 @@ export class CardComponent {
/** event emitter when the close button are fired */
@Output() clearPatron = new EventEmitter
();
- // GETTER & SETTER ==========================================================
- /** Build the link used on the patron name */
- get patronLink(): string {
+ /** Link used on the patron name */
+ patronLink: string;
+ /** it's the birthday of the patron */
+ isBirthday: boolean = false;
+ /** Patron age */
+ patronAge: number;
+ /** circulation messages about the loaded patron if exists */
+ circulationMessages: {severity: string, detail: string}[] = [];
+
+ ngOnInit(): void {
if (this.patron) {
- return (this.linkMode === 'detail')
+ this.patronLink = (this.linkMode === 'detail')
? '/records/patrons/detail/' + this.patron.pid
: '/circulation/patron/' + this.barcode + '/loan';
}
- }
- /** Get the patron age */
- get patronAge(): number {
if (this.patron && this.patron.birth_date) {
- const birthDate = DateTime.fromISO(this.patron.birth_date);
- return Math.floor(DateTime.now().diff(birthDate, 'years').years);
+ const today = DateTime.now().toFormat('M-dd');
+ const birthDate = DateTime.fromISO(this.patron.birth_date).toFormat('M-dd');
+ if (today === birthDate) {
+ this.isBirthday = true;
+ }
}
- }
- /** Defined if it's the birthday of the patron */
- get isBirthday(): boolean {
if (this.patron && this.patron.birth_date) {
- const today = DateTime.fromISO(DateTime.now().toFormat('yyyy-M-d'));
const birthDate = DateTime.fromISO(this.patron.birth_date);
- return today.diff(birthDate, 'years').years % 1 === 0;
+ this.patronAge = Math.floor(DateTime.now().diff(birthDate, 'years').years);
}
- return false;
- }
- /** Get the circulation messages about the loaded patron if exists */
- get circulationMessages(): Array<{type: string, content: string}> {
- return this.circulationService.messages();
+ this.circulationMessages = this.circulationService.messages();
}
- // COMPONENT FUNCTIONS ======================================================
/** Clear current patron */
clear(): void {
if (this.patron) {
@@ -91,5 +88,4 @@ export class CardComponent {
getMessageSeverity(level: string): string {
return getSeverity(level);
}
-
}
diff --git a/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.html b/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.html
index 8e105c0bf..b80a3f2a0 100644
--- a/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.html
+++ b/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.html
@@ -16,8 +16,8 @@
-->
@if (form) {