+ @if (log.metadata.loan.item.pid | getRecord:'items' | async; as item) {
+
-
-
-
- {{ 'Checkin' | translate }}
-
-
-
+ }
+
Transaction history
+
+
+
+
+ {{ log.metadata.date | dateTranslate: 'short' }}
+
+
+
+
+
+ {{ 'Checkin' | translate }}
+
+
-
-
-
-
- {{ checkout.metadata.date | dateTranslate: 'short' }}
-
-
-
-
-
- {{ 'Checkout' | translate }}
+
+ @if (checkout) {
+
+
+ {{ checkout.metadata.date | dateTranslate: 'short' }}
-
-
+
+
+
+
+ {{ 'Checkout' | translate }}
+
+
+
-
-
-
-
+ }
+
+
+ }
diff --git a/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts b/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts
index c93109caf..3e29c4e8f 100644
--- a/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts
+++ b/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts
@@ -1,6 +1,6 @@
/*
* RERO ILS UI
- * Copyright (C) 2021-2023 RERO
+ * Copyright (C) 2021-2024 RERO
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -16,8 +16,8 @@
*/
import { Component, Input } from '@angular/core';
-import { ProvisionActivityType } from '@rero/shared';
import { OperationLogsApiService } from '@app/admin/api/operation-logs-api.service';
+import { ProvisionActivityType } from '@rero/shared';
@Component({
selector: 'admin-history-log',
@@ -39,11 +39,9 @@ export class HistoryLogComponent {
/**
* Constructor
- * @param _operationLogsApiService - OperationLogsApiService
+ * @param operationLogsApiService - OperationLogsApiService
*/
- constructor(
- private _operationLogsApiService: OperationLogsApiService
- ) {}
+ constructor(private _operationLogsApiService: OperationLogsApiService) {}
/** Load checkout */
loadCheckout() {
diff --git a/projects/admin/src/app/circulation/patron/history/history.component.html b/projects/admin/src/app/circulation/patron/history/history.component.html
index c76e6054a..5b3188c9c 100644
--- a/projects/admin/src/app/circulation/patron/history/history.component.html
+++ b/projects/admin/src/app/circulation/patron/history/history.component.html
@@ -1,6 +1,6 @@
-
- 0; else noHistory">
-
-
-
Title
-
Authors
-
Return date
-
-
-
-
-
- {{ 'No history.' | translate }}
-
-
+@if (historyLogs$ | async; as logs) {
+
+ @if (logs.length > 0) {
+
+
+
Title
+
Authors
+
Return date
+
+
+ @for (log of logs; track log) {
+
+ }
+ } @else {
+ {{ 'No history.' | translate }}
+ }
+
+}
diff --git a/projects/admin/src/app/circulation/patron/history/history.component.ts b/projects/admin/src/app/circulation/patron/history/history.component.ts
index ef4340409..db719bfc7 100644
--- a/projects/admin/src/app/circulation/patron/history/history.component.ts
+++ b/projects/admin/src/app/circulation/patron/history/history.component.ts
@@ -1,6 +1,6 @@
/*
* RERO ILS UI
- * Copyright (C) 2020 RERO
+ * Copyright (C) 2020-2024 RERO
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -33,19 +33,19 @@ export class HistoryComponent implements OnInit {
/**
* Constructor
- * @param _patronService - PatronService
- * @param _operationLogsApiService - OperationLogsApiService
+ * @param patronService - PatronService
+ * @param operationLogsApiService - OperationLogsApiService
*/
constructor(
- private _patronService: PatronService,
- private _operationLogsApiService: OperationLogsApiService
+ private patronService: PatronService,
+ private operationLogsApiService: OperationLogsApiService
) {}
/** OnInit hook */
ngOnInit() {
- this.historyLogs$ = this._patronService.currentPatron$.pipe(
+ this.historyLogs$ = this.patronService.currentPatron$.pipe(
switchMap((patron: any) => {
- return this._operationLogsApiService.getCheckInHistory(
+ return this.operationLogsApiService.getCheckInHistory(
patron.pid,
1,
RecordService.MAX_REST_RESULTS_SIZE
diff --git a/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.html b/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.html
index 34b5184f1..4ed73d962 100644
--- a/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.html
+++ b/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.html
@@ -1,6 +1,6 @@
-
-
-
-
- - Publisher
- - {{ record.metadata.document.publisher }}
-
-
-
- - Year
- - {{ record.metadata.document.year }}
-
-
-
- - Identifier
- - {{ record.metadata.document.identifier }}
-
-
-
- - Source
+
+ @if (!isCollapsed) {
+
+
+
+ @if (record.metadata.document.publisher) {
+ - Publisher
+ - {{ record.metadata.document.publisher }}
+ }
+
+ @if (record.metadata.document.year) {
+ - Year
+ - {{ record.metadata.document.year }}
+ }
+
+ @if (record.metadata.document.identifier) {
+ - Identifier
+ - {{ record.metadata.document.identifier }}
+ }
+
+ @if (record.metadata.document.source) {
+ - Source
+ -
+ @if (record.metadata.document.source.volume || record.metadata.document.source.number) {
+ {{ record.metadata.document.source | journalVolume }}
+ }
+
+ }
+
+ - Scope
-
-
- {{ record.metadata.document.source | journalVolume }}
-
+ @if (record.metadata.copy) {
+ {{ 'Copy' | translate }}
+ } @else {
+ {{ 'Loan' | translate }}
+ }
-
-
- - Scope
- -
- {{ 'Copy' | translate }}
- {{ 'Loan' | translate }}
-
-
-
- - Pages
- - {{ record.metadata.pages }}
-
-
-
- - Found in
+
+ @if (record.metadata.copy && record.metadata.pages) {
+ - Pages
+ - {{ record.metadata.pages }}
+ }
+
+ @if (record.metadata.found_in) {
+ - Found in
+ -
+ {{ record.metadata.found_in.url }}
+ {{ record.metadata.found_in.source }}
+
+ }
+
+ - Request status
-
- {{ record.metadata.found_in.url }}
- {{ record.metadata.found_in.source }}
+ {{ record.metadata.status }}
-
-
- - Request status
- -
- {{ record.metadata.status }}
-
-
- 0">
- - Note
- -
-
-
-
-
-
-
-
+
+ @if (record.metadata.notes && record.metadata.notes.length > 0) {
+ - Note
+ -
+
+
+ @for (note of record.metadata.notes; track note) {
+
+ }
+
+
+
+ }
+
+
+ }
diff --git a/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.ts b/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.ts
index 045f19e9a..7e9a8d4bf 100644
--- a/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.ts
+++ b/projects/admin/src/app/circulation/patron/ill-request/ill-request-item/ill-request-item.component.ts
@@ -1,6 +1,6 @@
/*
* RERO ILS UI
- * Copyright (C) 2019-2023 RERO
+ * Copyright (C) 2019-2024 RERO
* Copyright (C) 2019-2023 UCLouvain
*
* This program is free software: you can redistribute it and/or modify
@@ -35,15 +35,13 @@ export class IllRequestItemComponent {
// CONSTRUCTOR & HOOKS ======================================================
/**
* Constructor
- * @param _illRequestService - IllRequestsService
+ * @param illRequestService - IllRequestsService
*/
- constructor(
- private _illRequestService: IllRequestsService,
- ) {}
+ constructor(private illRequestService: IllRequestsService) {}
// COMPONENT FUNCTIONS ======================================================
/** get the bootstrap color to apply on the request status badge */
badgeColor(status: string): string {
- return this._illRequestService.badgeColor(status);
+ return this.illRequestService.badgeColor(status);
}
}
diff --git a/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.html b/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.html
index 55c6b8298..1b0c09676 100644
--- a/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.html
+++ b/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.html
@@ -1,6 +1,6 @@
-
- 0; else noResult">
-
-
-
Document
-
Pickup location
-
Request date
-
Loan status
-
-
-
-
-
- {{ 'No ill request.' | translate }}
-
-
+@if (illRequests$ | async; as illRequests) {
+
+ @if (illRequests.length > 0) {
+
+
+
Document
+
Pickup location
+
Request date
+
Loan status
+
+
+ @for (record of illRequests; track record) {
+
+ }
+ } @else {
+ {{ 'No ill request.' | translate }}
+ }
+
+}
diff --git a/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.ts b/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.ts
index 7f17289c9..18006968b 100644
--- a/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.ts
+++ b/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.ts
@@ -1,6 +1,6 @@
/*
* RERO ILS UI
- * Copyright (C) 2019-2023 RERO
+ * Copyright (C) 2019-2024 RERO
* Copyright (C) 2019-2023 UCLouvain
*
* This program is free software: you can redistribute it and/or modify
@@ -34,21 +34,21 @@ export class IllRequestComponent implements OnInit {
// CONSTRUCTOR & HOOKS ======================================================
/**
* Constructor
- * @param _illRequestApiService - IllRequestApiService
- * @param _patronService - PatronService
+ * @param illRequestApiService - IllRequestApiService
+ * @param patronService - PatronService
*/
constructor(
- private _illRequestApiService: IllRequestApiService,
- private _patronService: PatronService
+ private illRequestApiService: IllRequestApiService,
+ private patronService: PatronService
) { }
/** OnInit hook */
ngOnInit(): void {
- this.illRequests$ = this._patronService.currentPatron$.pipe(
+ this.illRequests$ = this.patronService.currentPatron$.pipe(
switchMap((patron: any) => {
return (!patron)
? of(null)
- : this._illRequestApiService.getByPatronPid(patron.pid)
+ : this.illRequestApiService.getByPatronPid(patron.pid)
}
));
}
diff --git a/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.html b/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.html
index 7673be09f..bf2f97969 100644
--- a/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.html
+++ b/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.html
@@ -1,6 +1,6 @@
diff --git a/projects/admin/src/app/circulation/patron/loan/loan.component.ts b/projects/admin/src/app/circulation/patron/loan/loan.component.ts
index a4c9a197f..08059f0af 100644
--- a/projects/admin/src/app/circulation/patron/loan/loan.component.ts
+++ b/projects/admin/src/app/circulation/patron/loan/loan.component.ts
@@ -1,6 +1,6 @@
/*
* RERO ILS UI
- * Copyright (C) 2019-2023 RERO
+ * Copyright (C) 2019-2024 RERO
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -63,20 +63,20 @@ export class LoanComponent implements OnInit, OnDestroy {
currentLibraryPid: string;
/** ready to pickup items */
- private _pickupItems = [];
+ private pickupItems = [];
/** Observable subscription */
- private _subscription = new Subscription();
+ private subscription = new Subscription();
/** checkout list sort criteria */
- private _sortCriteria = '-transaction_date';
+ private sortCriteria = '-transaction_date';
/** modal reference */
- private _modalRef: BsModalRef;
+ private modalRef: BsModalRef;
/** checkout circulation special settings */
- private _checkoutCirculationSettings: CirculationSetting[] = [];
+ private checkoutCirculationSettings: CirculationSetting[] = [];
// GETTER & SETTER ================================================
/** Return the circulation special settings */
get checkoutSettings(): CirculationSetting[] | null {
- return this._checkoutCirculationSettings;
+ return this.checkoutCirculationSettings;
}
/**
@@ -85,7 +85,7 @@ export class LoanComponent implements OnInit, OnDestroy {
*/
private _setCheckoutSetting(setting: CirculationSetting) {
this.removeCheckoutSettings(setting.key);
- this._checkoutCirculationSettings.push(setting);
+ this.checkoutCirculationSettings.push(setting);
}
/**
@@ -94,7 +94,7 @@ export class LoanComponent implements OnInit, OnDestroy {
* @return the value of the setting. null if key isn't found
*/
private _getCheckoutSetting(key: string): any | null {
- const setting = this._checkoutCirculationSettings.find(element => element.key === key);
+ const setting = this.checkoutCirculationSettings.find(element => element.key === key);
return (setting !== undefined)
? setting.value
: null;
@@ -106,47 +106,47 @@ export class LoanComponent implements OnInit, OnDestroy {
* @return the circulation setting removed or null if the setting is not found
*/
removeCheckoutSettings(key: string): CirculationSetting | CirculationSetting[] | null {
- const idx = this._checkoutCirculationSettings.findIndex(setting => setting.key === key);
+ const idx = this.checkoutCirculationSettings.findIndex(setting => setting.key === key);
if (idx >= 0) {
- if (key === 'endDate' && this._checkoutCirculationSettings[idx].extra.remember) {
- this._loanFixedDateService.remove();
+ if (key === 'endDate' && this.checkoutCirculationSettings[idx].extra.remember) {
+ this.loanFixedDateService.remove();
}
- return this._checkoutCirculationSettings.splice(idx, 1);
+ return this.checkoutCirculationSettings.splice(idx, 1);
}
}
// CONSTRUCTOR & HOOKS ============================================
/**
* Constructor
- * @param _itemsService - Items Service
- * @param _translateService - Translate Service
- * @param _toastService - Toastr Service
- * @param _patronService - Patron Service
- * @param _userService - UserService
- * @param _modalService - BsModalService
- * @param _dateTranslatePipe - DateTranslatePipe
- * @param _circulationService - CirculationService
- * @param _loanFixedDateService - LoanFixedDateService
+ * @param itemsService - Items Service
+ * @param translateService - Translate Service
+ * @param toastService - Toastr Service
+ * @param patronService - Patron Service
+ * @param userService - UserService
+ * @param modalService - BsModalService
+ * @param dateTranslatePipe - DateTranslatePipe
+ * @param circulationService - CirculationService
+ * @param loanFixedDateService - LoanFixedDateService
*/
constructor(
- private _itemsService: ItemsService,
- private _translateService: TranslateService,
- private _toastService: ToastrService,
- private _patronService: PatronService,
- private _userService: UserService,
- private _modalService: BsModalService,
- private _dateTranslatePipe: DateTranslatePipe,
- private _circulationService: CirculationService,
- private _loanFixedDateService: LoanFixedDateService
+ private itemsService: ItemsService,
+ private translateService: TranslateService,
+ private toastService: ToastrService,
+ private patronService: PatronService,
+ private userService: UserService,
+ private modalService: BsModalService,
+ private dateTranslatePipe: DateTranslatePipe,
+ private circulationService: CirculationService,
+ private loanFixedDateService: LoanFixedDateService
) {}
/** OnInit hook */
ngOnInit(): void {
- this._subscription.add(this._patronService.currentPatron$.subscribe((patron: any) => {
+ this.subscription.add(this.patronService.currentPatron$.subscribe((patron: any) => {
this.patron = patron;
if (patron) {
- const loanedItems$ = this._patronService.getItems(patron.pid, this._sortCriteria);
- const pickupItems$ = this._patronService.getItemsPickup(patron.pid);
+ const loanedItems$ = this.patronService.getItems(patron.pid, this.sortCriteria);
+ const pickupItems$ = this.patronService.getItemsPickup(patron.pid);
forkJoin([loanedItems$, pickupItems$]).subscribe(
([loanedItems, pickupItems]) => {
// loanedItems is an array of brief item data (pid, barcode). For each one, we need to
@@ -155,20 +155,20 @@ export class LoanComponent implements OnInit, OnDestroy {
this.checkedOutItems = loanedItems;
// for each checkedOutElement call the detail item service.
loanedItems.forEach((data: any, index) => {
- this._patronService.getItem(data.barcode).subscribe(item => loanedItems[index] = item);
+ this.patronService.getItem(data.barcode).subscribe(item => loanedItems[index] = item);
});
// we need to know which items are ready to pickup to decrement the counter if a checkout
// operation is done on one of this items.
- this._pickupItems = pickupItems;
+ this.pickupItems = pickupItems;
}, error => {}
);
}
}));
- this.currentLibraryPid = this._userService.user.currentLibrary;
+ this.currentLibraryPid = this.userService.user.currentLibrary;
this.searchInputFocus = true;
// Assignment of end date if present in locale storage
- const fixedDateValue = this._loanFixedDateService.get();
+ const fixedDateValue = this.loanFixedDateService.get();
if (fixedDateValue) {
this.setCheckoutDateSetting(fixedDateValue, true);
}
@@ -176,7 +176,7 @@ export class LoanComponent implements OnInit, OnDestroy {
/** OnDestroy hook */
ngOnDestroy(): void {
- this._subscription.unsubscribe();
+ this.subscription.unsubscribe();
}
// COMPONENT FUNCTIONS ========================================================
@@ -204,38 +204,38 @@ export class LoanComponent implements OnInit, OnDestroy {
item.currentAction = ItemAction.checkin;
this.applyItems([item]);
if (item.pending_loans) {
- this._toastService.warning(
- this._translateService.instant('The item has a request'),
- this._translateService.instant('Checkin')
+ this.toastService.warning(
+ this.translateService.instant('The item has a request'),
+ this.translateService.instant('Checkin')
);
}
if (item.status === ItemStatus.IN_TRANSIT) {
- this._toastService.warning(
- this._translateService.instant('The item is in transit'),
- this._translateService.instant('Checkin')
+ this.toastService.warning(
+ this.translateService.instant('The item is in transit'),
+ this.translateService.instant('Checkin')
);
}
} else {
- this._itemsService.getItem(barcode, this.patron.pid).subscribe(
+ this.itemsService.getItem(barcode, this.patron.pid).subscribe(
newItem => {
if (newItem === null) {
- this._toastService.error(
- this._translateService.instant('Item not found'),
- this._translateService.instant('Checkout')
+ this.toastService.error(
+ this.translateService.instant('Item not found'),
+ this.translateService.instant('Checkout')
);
this._resetSearchInput();
} else {
if (newItem.status === ItemStatus.ON_LOAN) {
- this._toastService.error(
- this._translateService.instant('Checkout impossible: the item is already on loan for another patron'),
- this._translateService.instant('Checkout')
+ this.toastService.error(
+ this.translateService.instant('Checkout impossible: the item is already on loan for another patron'),
+ this.translateService.instant('Checkout')
);
this._resetSearchInput();
} else {
if (newItem.pending_loans && newItem.pending_loans[0].patron_pid !== this.patron.pid) {
- this._toastService.error(
- this._translateService.instant('Checkout impossible: the item is requested by another patron'),
- this._translateService.instant('Checkout')
+ this.toastService.error(
+ this.translateService.instant('Checkout impossible: the item is requested by another patron'),
+ this.translateService.instant('Checkout')
);
this._resetSearchInput();
} else {
@@ -246,9 +246,9 @@ export class LoanComponent implements OnInit, OnDestroy {
}
},
error => {
- this._toastService.error(
- this._translateService.instant(error.message),
- this._translateService.instant('Checkout')
+ this.toastService.error(
+ this.translateService.instant(error.message),
+ this.translateService.instant('Checkout')
);
this._resetSearchInput();
}
@@ -266,14 +266,14 @@ export class LoanComponent implements OnInit, OnDestroy {
if (item.currentAction !== ItemAction.no) {
const additionalParams = {};
if (item.currentAction === ItemAction.checkout) {
- this._checkoutCirculationSettings.map(setting => additionalParams[setting.key] = setting.value);
+ this.checkoutCirculationSettings.map(setting => additionalParams[setting.key] = setting.value);
}
observables.push(
- this._itemsService.doAction(
+ this.itemsService.doAction(
item,
this.currentLibraryPid,
// TODO: user or patron ?
- this._userService.user.patronLibrarian.pid,
+ this.userService.user.patronLibrarian.pid,
this.patron.pid,
additionalParams
)
@@ -291,13 +291,13 @@ export class LoanComponent implements OnInit, OnDestroy {
// display a toast message if the item goes in transit...
if (newItem.status === ItemStatus.IN_TRANSIT) {
const destination = newItem.loan.item_destination.library_name;
- this._toastService.warning(
- this._translateService.instant('The item is in transit to [{{ destination }}]', {destination}),
- this._translateService.instant('Checkin')
+ this.toastService.warning(
+ this.translateService.instant('The item is in transit to [{{ destination }}]', {destination}),
+ this.translateService.instant('Checkin')
);
}
- this._circulationService.decrementCirculationStatistic('loans');
- this._circulationService.incrementCirculationStatistic('history');
+ this.circulationService.decrementCirculationStatistic('loans');
+ this.circulationService.incrementCirculationStatistic('history');
break;
}
case ItemAction.checkout: {
@@ -305,12 +305,12 @@ export class LoanComponent implements OnInit, OnDestroy {
this._displayCirculationNote(newItem, ItemNoteType.CHECKOUT);
this.checkedOutItems.unshift(newItem);
this.checkedInItems = this.checkedInItems.filter(currItem => currItem.pid !== newItem.pid);
- this._circulationService.incrementCirculationStatistic('loans');
+ this.circulationService.incrementCirculationStatistic('loans');
// check if items was ready to pickup. if yes, then we need to decrement the counter
- const idx = this._pickupItems.findIndex(item => item.metadata.item.pid === newItem.pid);
+ const idx = this.pickupItems.findIndex(item => item.metadata.item.pid === newItem.pid);
if (idx > -1) {
- this._pickupItems.splice(idx, 1);
- this._circulationService.decrementCirculationStatistic('pickup');
+ this.pickupItems.splice(idx, 1);
+ this.circulationService.decrementCirculationStatistic('pickup');
}
break;
}
@@ -330,23 +330,23 @@ export class LoanComponent implements OnInit, OnDestroy {
errorMessage = err.error.message;
}
if (err.error.status === 403) {
- let message = this._translateService.instant(errorMessage) || this._translateService.instant('Checkout is not allowed by circulation policy');
- let title = this._translateService.instant('Circulation');
+ let message = this.translateService.instant(errorMessage) || this.translateService.instant('Checkout is not allowed by circulation policy');
+ let title = this.translateService.instant('Circulation');
if (message.includes(': ')) {
const splittedData = message.split(': ', 2);
title = splittedData[0].trim();
message = splittedData[1].trim();
message = message.charAt(0).toUpperCase() + message.slice(1);
}
- this._toastService.error(
+ this.toastService.error(
message,
title,
{disableTimeOut: true, closeButton: true, enableHtml: true}
);
} else {
- this._toastService.error(
- this._translateService.instant('An error occurred on the server: ') + errorMessage,
- this._translateService.instant('Circulation'),
+ this.toastService.error(
+ this.translateService.instant('An error occurred on the server: ') + errorMessage,
+ this.translateService.instant('Circulation'),
{disableTimeOut: true, closeButton: true, enableHtml: true}
);
}
@@ -363,7 +363,7 @@ export class LoanComponent implements OnInit, OnDestroy {
private _displayCirculationNote(item: Item, noteType: ItemNoteType): void {
const note = item.getNote(noteType);
if (note != null) {
- this._toastService.warning(
+ this.toastService.warning(
note.content, null,
{
closeButton: true, // add a close button to the toastr message
@@ -390,9 +390,9 @@ export class LoanComponent implements OnInit, OnDestroy {
settingEndDate.getMonth() !== loanEndDate.getMonth() ||
settingEndDate.getDate() !== loanEndDate.getDate()
) {
- this._toastService.warning(
- this._translateService.instant('The due date has been set to the next business day, since the selected day is closed.'),
- this._translateService.instant('Checkout')
+ this.toastService.warning(
+ this.translateService.instant('The due date has been set to the next business day, since the selected day is closed.'),
+ this.translateService.instant('Checkout')
);
}
}
@@ -404,9 +404,9 @@ export class LoanComponent implements OnInit, OnDestroy {
*/
hasFees(event: boolean): void {
if (event) {
- this._toastService.error(
- this._translateService.instant('The item has fees'),
- this._translateService.instant('Checkin')
+ this.toastService.error(
+ this.translateService.instant('The item has fees'),
+ this.translateService.instant('Checkin')
);
}
}
@@ -443,15 +443,15 @@ export class LoanComponent implements OnInit, OnDestroy {
* Subscribe to modal onHide event to get data entered by user and perform job if needed.
*/
openFixedEndDateDialog(): void {
- this._modalRef = this._modalService.show(FixedDateFormComponent, {
+ this.modalRef = this.modalService.show(FixedDateFormComponent, {
ignoreBackdropClick: true,
keyboard: true
});
- this._modalRef.content.onSubmit.subscribe(result => {
+ this.modalRef.content.onSubmit.subscribe(result => {
if ('action' in result && result.action === 'submit') {
const date = this.setCheckoutDateSetting(result.content.endDate, result.content.remember);
if (result.content.remember) {
- this._loanFixedDateService.set(date);
+ this.loanFixedDateService.set(date);
}
}
});
@@ -465,10 +465,10 @@ export class LoanComponent implements OnInit, OnDestroy {
*/
setCheckoutDateSetting(endDate: string, remember: boolean): string {
const checkoutEndDate = moment(endDate, FixedDateFormComponent.DATE_FORMAT).toDate().setHours(23, 59);
- const formattedDate = this._dateTranslatePipe.transform(checkoutEndDate, 'shortDate');
+ const formattedDate = this.dateTranslatePipe.transform(checkoutEndDate, 'shortDate');
const setting = {
key: 'endDate',
- label: this._translateService.instant('Active chosen due date: {{ endDate }}', {endDate: formattedDate}),
+ label: this.translateService.instant('Active chosen due date: {{ endDate }}', {endDate: formattedDate}),
value: new Date(checkoutEndDate).toISOString(),
extra: {
remember,
@@ -487,7 +487,7 @@ export class LoanComponent implements OnInit, OnDestroy {
overrideBlocking(): void {
this._setCheckoutSetting({
key: 'overrideBlocking',
- label: this._translateService.instant('Override blockings'),
+ label: this.translateService.instant('Override blockings'),
value: true
});
}
diff --git a/projects/admin/src/app/circulation/patron/main/main.component.html b/projects/admin/src/app/circulation/patron/main/main.component.html
index ae4e9d492..4a5d949e3 100644
--- a/projects/admin/src/app/circulation/patron/main/main.component.html
+++ b/projects/admin/src/app/circulation/patron/main/main.component.html
@@ -1,6 +1,6 @@
-
-
+@if (patron) {
{{ 'On loan' | translate }}
- 0" class="badge badge-info font-weight-normal">
- {{ statLoan }}
-
+ @if (statLoan > 0) {
+ {{ statLoan }}
+ }
@@ -48,9 +47,9 @@
[routerLinkActiveOptions]="{exact: true}"
[routerLink]="['/circulation', 'patron', barcode, 'pickup']">
{{ 'To pick up' | translate }}
- 0" class="badge badge-info font-weight-normal">
- {{ statPickup }}
-
+ @if (statPickup > 0) {
+ {{ statPickup }}
+ }
@@ -61,9 +60,9 @@
[routerLinkActiveOptions]="{exact: true}"
[routerLink]="['/circulation', 'patron', barcode, 'pending']">
{{ 'Pending' | translate }}
- 0" class="badge badge-info font-weight-normal">
- {{ statPending }}
-
+ @if (statPending > 0) {
+ {{ statPending }}
+ }
@@ -74,9 +73,9 @@
[routerLinkActiveOptions]="{exact: true}"
[routerLink]="['/circulation', 'patron', barcode, 'ill']">
{{ 'Interlibrary loan' | translate }}
- 0" class="badge badge-info font-weight-normal">
- {{ statIll }}
-
+ @if (statIll > 0) {
+ {{ statIll }}
+ }
@@ -87,8 +86,7 @@
[routerLinkActiveOptions]="{exact: true}"
[routerLink]="['/circulation', 'patron', barcode, 'profile']"
translate
- >Profile
+ >Profile
{{ 'Fees' | translate }}
- 0" class="badge badge-warning font-weight-normal">
- {{ feesTotalAmount | currency: organisation.default_currency }}
-
-
-
-
-
- {{ 'History' | translate }}
-
- {{ historyCount }}
-
+ @if (feesTotalAmount > 0) {
+
+ {{ feesTotalAmount | currency: organisation.default_currency }}
+
+ }
+ @if (patron.keep_history) {
+
+
+ {{ 'History' | translate }}
+ {{ historyCount }}
+
+
+ }
-
+}
diff --git a/projects/admin/src/app/circulation/patron/main/main.component.ts b/projects/admin/src/app/circulation/patron/main/main.component.ts
index 84a810fd4..8e1f4e6ba 100644
--- a/projects/admin/src/app/circulation/patron/main/main.component.ts
+++ b/projects/admin/src/app/circulation/patron/main/main.component.ts
@@ -1,6 +1,6 @@
/*
* RERO ILS UI
- * Copyright (C) 2019-2022 RERO
+ * Copyright (C) 2019-2024 RERO
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -16,12 +16,12 @@
*/
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
-import { HotkeysService } from '@ngneat/hotkeys';
-import { TranslateService } from '@ngx-translate/core';
-import { RecordService } from '@rero/ng-core';
import { LoanState } from '@app/admin/classes/loans';
import { OrganisationService } from '@app/admin/service/organisation.service';
import { PatronService } from '@app/admin/service/patron.service';
+import { HotkeysService } from '@ngneat/hotkeys';
+import { TranslateService } from '@ngx-translate/core';
+import { RecordService } from '@rero/ng-core';
import { Subscription } from 'rxjs';
import { OperationLogsApiService } from '../../../api/operation-logs-api.service';
import { CirculationService } from '../../services/circulation.service';
@@ -38,45 +38,45 @@ export class MainComponent implements OnInit, OnDestroy {
private _shortcuts = [
{
keys: 'shift.1',
- group: this._translateService.instant('Patron profile shortcuts'),
- description: this._translateService.instant('Go to "circulation" tab'),
+ group: this.translateService.instant('Patron profile shortcuts'),
+ description: this.translateService.instant('Go to "circulation" tab'),
callback: ($event) => {
- this._router.navigate(['/circulation', 'patron', this._patronBarcode, 'loan']);
+ this.router.navigate(['/circulation', 'patron', this.barcode, 'loan']);
}
}, {
keys: 'shift.2',
- group: this._translateService.instant('Patron profile shortcuts'),
- description: this._translateService.instant('Go to "pickup" tab'),
+ group: this.translateService.instant('Patron profile shortcuts'),
+ description: this.translateService.instant('Go to "pickup" tab'),
callback: ($event) => {
- this._router.navigate(['/circulation', 'patron', this._patronBarcode, 'pickup']);
+ this.router.navigate(['/circulation', 'patron', this.barcode, 'pickup']);
}
}, {
keys: 'shift.3',
- group: this._translateService.instant('Patron profile shortcuts'),
- description: this._translateService.instant('Go to "pending" tab'),
+ group: this.translateService.instant('Patron profile shortcuts'),
+ description: this.translateService.instant('Go to "pending" tab'),
callback: ($event) => {
- this._router.navigate(['/circulation', 'patron', this._patronBarcode, 'pending']);
+ this.router.navigate(['/circulation', 'patron', this.barcode, 'pending']);
}
}, {
keys: 'shift.4',
- group: this._translateService.instant('Patron profile shortcuts'),
- description: this._translateService.instant('Go to "patron profile" tab'),
+ group: this.translateService.instant('Patron profile shortcuts'),
+ description: this.translateService.instant('Go to "patron profile" tab'),
callback: ($event) => {
- this._router.navigate(['/circulation', 'patron', this._patronBarcode, 'profile']);
+ this.router.navigate(['/circulation', 'patron', this.barcode, 'profile']);
}
}, {
keys: 'shift.5',
- group: this._translateService.instant('Patron profile shortcuts'),
- description: this._translateService.instant('Go to "fees" tab'),
+ group: this.translateService.instant('Patron profile shortcuts'),
+ description: this.translateService.instant('Go to "fees" tab'),
callback: ($event) => {
- this._router.navigate(['/circulation', 'patron', this._patronBarcode, 'fees']);
+ this.router.navigate(['/circulation', 'patron', this.barcode, 'fees']);
}
}, {
keys: 'shift.6',
- group: this._translateService.instant('Patron profile shortcuts'),
- description: this._translateService.instant('Go to "history" tab'),
+ group: this.translateService.instant('Patron profile shortcuts'),
+ description: this.translateService.instant('Go to "history" tab'),
callback: ($event) => {
- this._router.navigate(['/circulation', 'patron', this._patronBarcode, 'history']);
+ this.router.navigate(['/circulation', 'patron', this.barcode, 'history']);
}
}
];
@@ -85,7 +85,7 @@ export class MainComponent implements OnInit, OnDestroy {
patron: any = undefined;
/** the current patron barcode */
- _patronBarcode: string;
+ barcode: string;
/** the total amount of all fees related to the current patron */
feesTotalAmount = 0;
@@ -105,47 +105,39 @@ export class MainComponent implements OnInit, OnDestroy {
* @return current organisation
*/
get organisation() {
- return this._organisationService.organisation;
- }
-
- /**
- * Get barcode for current patron
- * @return string, barcode
- */
- get barcode() {
- return this._patronBarcode;
+ return this.organisationService.organisation;
}
// CONSTRUCTOR & HOOKS ====================================================
/**
* Constructor
- * @param _route - ActivatedRoute
- * @param _router - Router
- * @param _patronService - PatronService
- * @param _patronTransactionService - PatronTransactionService
- * @param _organisationService - OrganisationService
- * @param _hotKeysService - HotkeysService
- * @param _translateService - TranslateService
- * @param _circulationService - CirculationService
- * @param _recordService: RecordService
+ * @param route - ActivatedRoute
+ * @param router - Router
+ * @param patronService - PatronService
+ * @param patronTransactionService - PatronTransactionService
+ * @param organisationService - OrganisationService
+ * @param hotKeysService - HotkeysService
+ * @param translateService - TranslateService
+ * @param circulationService - CirculationService
+ * @param recordService: RecordService
*/
constructor(
- private _route: ActivatedRoute,
- private _router: Router,
- private _patronService: PatronService,
- private _patronTransactionService: PatronTransactionService,
- private _organisationService: OrganisationService,
- private _hotKeysService: HotkeysService,
- private _translateService: TranslateService,
- private _circulationService: CirculationService,
- private _operationLogsApiService: OperationLogsApiService,
- private _recordService: RecordService
+ private route: ActivatedRoute,
+ private router: Router,
+ private patronService: PatronService,
+ private patronTransactionService: PatronTransactionService,
+ private organisationService: OrganisationService,
+ private hotKeysService: HotkeysService,
+ private translateService: TranslateService,
+ private circulationService: CirculationService,
+ private operationLogsApiService: OperationLogsApiService,
+ private recordService: RecordService
) { }
/** OnInit hook */
ngOnInit(): void {
/** load patron if the barcode changes */
- this._route.params.subscribe((data: any) => {
+ this.route.params.subscribe((data: any) => {
if (data.hasOwnProperty('barcode')) {
this.load(data.barcode);
}
@@ -161,7 +153,7 @@ export class MainComponent implements OnInit, OnDestroy {
if (this._patronSubscription$) {
this._patronSubscription$.unsubscribe();
}
- this._patronService.clearPatron();
+ this.patronService.clearPatron();
}
// COMPONENT FUNCTIONS ====================================================
@@ -170,26 +162,26 @@ export class MainComponent implements OnInit, OnDestroy {
* @param barcode: string, patron barcode
*/
load(barcode: string): void {
- this._patronBarcode = barcode;
- this._patronSubscription$ = this._patronService.getPatron(barcode).subscribe((patron: any) => {
+ this.barcode = barcode;
+ this._patronSubscription$ = this.patronService.getPatron(barcode).subscribe((patron: any) => {
if (patron) {
this.patron = patron;
// We need to unregister/register the shortcuts after the patron was loaded. Otherwise, the patron could be considered has
// null and this will cause error for navigation url construction
this._unregisterShortcuts();
this._registerShortcuts();
- this._operationLogsApiService.getCheckInHistory(patron.pid, 1, 1).subscribe((result: any) => {
- this.historyCount = this._recordService.totalHits(result.hits.total);
+ this.operationLogsApiService.getCheckInHistory(patron.pid, 1, 1).subscribe((result: any) => {
+ this.historyCount = this.recordService.totalHits(result.hits.total);
});
- this._patronService.getCirculationInformations(patron.pid).subscribe((data) => {
- this._circulationService.clear();
+ this.patronService.getCirculationInformations(patron.pid).subscribe((data) => {
+ this.circulationService.clear();
this.feesTotalAmount = data.fees.engaged + data.fees.preview;
this._parseStatistics(data.statistics || {});
for (const message of (data.messages || [])) {
- this._circulationService.addCirculationMessage(message as any);
+ this.circulationService.addCirculationMessage(message as any);
}
// subscribe to fees accounting operations for this patron
- this._patronFeesOperationSubscription$ = this._patronTransactionService.patronFeesOperationSubject$.subscribe(
+ this._patronFeesOperationSubscription$ = this.patronTransactionService.patronFeesOperationSubject$.subscribe(
(amount) => {
const total = this.feesTotalAmount + amount;
this.feesTotalAmount = (total > 0) ? total : 0;
@@ -202,26 +194,26 @@ export class MainComponent implements OnInit, OnDestroy {
/** reset the patron currently viewed */
clearPatron(): void {
- this._patronService.clearPatron();
- this._router.navigate(['/circulation']);
+ this.patronService.clearPatron();
+ this.router.navigate(['/circulation']);
}
/** Register all component shortcuts on the hotkeysService */
private _registerShortcuts(): void {
for (const shortcut of this._shortcuts) {
- const callback = shortcut.callback;
+ const { callback } = shortcut;
delete shortcut.callback;
- this._hotKeysService.addShortcut(shortcut).subscribe($event => callback($event));
+ this.hotKeysService.addShortcut(shortcut).subscribe($event => callback($event));
}
}
/** Unregister all component shortcuts from the hotkeysService (if they are registered) */
private _unregisterShortcuts(): void {
- const registeredHotKeys = this._hotKeysService.getHotkeys().map(shortcut => shortcut.keys);
+ const registeredHotKeys = this.hotKeysService.getHotkeys().map(shortcut => shortcut.keys);
const componentShortcuts = this._shortcuts.map(shortcut => shortcut.keys);
const intersectionShortcuts = registeredHotKeys.filter(value => componentShortcuts.includes(value));
if (intersectionShortcuts.length > 0) {
- this._hotKeysService.removeShortcuts(intersectionShortcuts);
+ this.hotKeysService.removeShortcuts(intersectionShortcuts);
}
}
@@ -230,7 +222,7 @@ export class MainComponent implements OnInit, OnDestroy {
* @param type: the type of circulation statistics to find.
*/
getCirculationStatistics(type: string): number {
- const stats = this._circulationService?.circulationInformations?.statistics;
+ const stats = this.circulationService?.circulationInformations?.statistics;
return stats && type in stats
? stats[type]
: 0;
@@ -245,21 +237,21 @@ export class MainComponent implements OnInit, OnDestroy {
switch (key) {
case LoanState[LoanState.PENDING]:
case LoanState[LoanState.ITEM_IN_TRANSIT_FOR_PICKUP]:
- this._circulationService.incrementCirculationStatistic('pending', Number(data[key]));
+ this.circulationService.incrementCirculationStatistic('pending', Number(data[key]));
break;
case LoanState[LoanState.ITEM_AT_DESK]:
- this._circulationService.incrementCirculationStatistic('pickup', Number(data[key]));
+ this.circulationService.incrementCirculationStatistic('pickup', Number(data[key]));
break;
case LoanState[LoanState.ITEM_ON_LOAN]:
- this._circulationService.incrementCirculationStatistic('loans', Number(data[key]));
+ this.circulationService.incrementCirculationStatistic('loans', Number(data[key]));
break;
case LoanState[LoanState.CANCELLED]:
case LoanState[LoanState.ITEM_IN_TRANSIT_TO_HOUSE]:
case LoanState[LoanState.ITEM_RETURNED]:
- this._circulationService.incrementCirculationStatistic('history', Number(data[key]));
+ this.circulationService.incrementCirculationStatistic('history', Number(data[key]));
break;
case 'ill_requests':
- this._circulationService.incrementCirculationStatistic('ill', Number(data[key]));
+ this.circulationService.incrementCirculationStatistic('ill', Number(data[key]));
break;
}
}
diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.html b/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.html
index da30ed867..4ac3ac9da 100644
--- a/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.html
+++ b/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.html
@@ -1,6 +1,6 @@
-
0" class="col mr-1 p-2 border rounded">
-
-
-
- {{ transaction.loan.end_date.toDate() | dateTranslate :'shortDate' }}
+@if (transaction !== undefined && transaction.fees.total > 0) {
+
+
+
+
+ {{ transaction.loan.end_date.toDate() | dateTranslate :'shortDate' }}
+
+
+ @if (document && document.title | mainTitle; as title) {
+
+ {{ title | truncateText: 15 }}
+
+ }
+
+
{{ transaction.fees.total | currency: organisation.default_currency }}
+
-
-
{{ transaction.fees.total | currency: organisation.default_currency }}
-
-
-
-
-
Details
-
-
-
-
-
Call number
-
+ @if (!isCollapsed) {
+
+
+
Details
+
+ @if (item) {
+
+
+
+
Borrowed on
+
{{ transaction.loan.start_date.toDate() | dateTranslate :'short' }}
+
+
+
Borrowed at
+
+ {{ location.metadata.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}: {{ location.metadata.name }}
+
+
+ }
+
+
+
Transaction history
+
+ @for (event of transaction.fees.steps; track event) {
+
+ }
-
-
Borrowed on
-
{{ transaction.loan.start_date.toDate() | dateTranslate :'short' }}
-
-
-
Borrowed at
-
- {{ location.metadata.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}: {{ location.metadata.name }}
-
-
-
-
-
-
Transaction history
-
+
+ }
-
+}
diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.ts b/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.ts
index 24dff76d9..d967c7369 100644
--- a/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.ts
+++ b/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.ts
@@ -1,6 +1,6 @@
/*
* RERO ILS UI
- * Copyright (C) 2019 RERO
+ * Copyright (C) 2019-2024 RERO
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -16,12 +16,12 @@
*/
import { Component, Input, OnInit } from '@angular/core';
-import { RecordService } from '@rero/ng-core';
+import { Item } from '@app/admin/classes/items';
import { Loan, LoanOverduePreview } from '@app/admin/classes/loans';
+import { PatronTransactionEvent, PatronTransactionEventType } from '@app/admin/classes/patron-transaction';
import { OrganisationService } from '@app/admin/service/organisation.service';
+import { RecordService } from '@rero/ng-core';
import { forkJoin } from 'rxjs';
-import { Item } from '@app/admin/classes/items';
-import { PatronTransactionEvent, PatronTransactionEventType } from '@app/admin/classes/patron-transaction';
@Component({
selector: 'admin-overdue-transaction',
@@ -44,24 +44,24 @@ export class OverdueTransactionComponent implements OnInit {
* @return: current organisation
*/
get organisation() {
- return this._organisationService.organisation;
+ return this.organisationService.organisation;
}
// CONSTRUCTOR & HOOKS =====================================================
/**
* constructor
- * @param _organisationService - OrganisationService
- * @param _recordService - RecordService
+ * @param organisationService - OrganisationService
+ * @param recordService - RecordService
*/
constructor(
- private _organisationService: OrganisationService,
- private _recordService: RecordService
+ private organisationService: OrganisationService,
+ private recordService: RecordService
) { }
/** OnInit hook */
ngOnInit(): void {
- const itemRecord$ = this._recordService.getRecord('items', this.transaction.loan.item_pid.value);
- const documentRecord$ = this._recordService.getRecord('documents', this.transaction.loan.document_pid);
+ const itemRecord$ = this.recordService.getRecord('items', this.transaction.loan.item_pid.value);
+ const documentRecord$ = this.recordService.getRecord('documents', this.transaction.loan.document_pid);
forkJoin([itemRecord$, documentRecord$]).subscribe(
([itemData, documentData]) => {
this.item = new Item(itemData.metadata);
diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/patron-fee/patron-fee.component.html b/projects/admin/src/app/circulation/patron/patron-transactions/patron-fee/patron-fee.component.html
index 249a2bb21..4095cb254 100644
--- a/projects/admin/src/app/circulation/patron/patron-transactions/patron-fee/patron-fee.component.html
+++ b/projects/admin/src/app/circulation/patron/patron-transactions/patron-fee/patron-fee.component.html
@@ -1,6 +1,6 @@
-
-
-
-
-
+}
diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/patron-fee/patron-fee.component.ts b/projects/admin/src/app/circulation/patron/patron-transactions/patron-fee/patron-fee.component.ts
index 2059de7a1..ab8ae9b04 100644
--- a/projects/admin/src/app/circulation/patron/patron-transactions/patron-fee/patron-fee.component.ts
+++ b/projects/admin/src/app/circulation/patron/patron-transactions/patron-fee/patron-fee.component.ts
@@ -21,13 +21,12 @@ import { FormlyFieldConfig } from '@ngx-formly/core';
import { TranslateService } from '@ngx-translate/core';
import { ApiService, RecordService } from '@rero/ng-core';
import { UserService } from '@rero/shared';
+import { DateTime } from 'luxon';
import { BsModalRef } from 'ngx-bootstrap/modal';
import { ToastrService } from 'ngx-toastr';
import { PatronTransactionApiService } from 'projects/admin/src/app/api/patron-transaction-api.service';
import { OrganisationService } from 'projects/admin/src/app/service/organisation.service';
-import { DateTime } from 'luxon';
-
@Component({
selector: 'admin-patron-fee',
templateUrl: './patron-fee.component.html',
@@ -53,24 +52,24 @@ export class PatronFeeComponent implements OnInit {
// CONSTRUCTOR & HOOKS ======================================================
/**
* Constructor
- * @param _recordService - RecordService
- * @param _bsModalRef - BsModalRef
- * @param _toastr - ToastrService
- * @param _translateService - TranslateService
- * @param _organisationService - OrganisationService
- * @param _userService - UserService
- * @param _patronTransactionApiService - PatronTransactionApiService
- * @param _apiService - ApiService
+ * @param recordService - RecordService
+ * @param bsModalRef - BsModalRef
+ * @param toastr - ToastrService
+ * @param translateService - TranslateService
+ * @param organisationService - OrganisationService
+ * @param userService - UserService
+ * @param patronTransactionApiService - PatronTransactionApiService
+ * @param apiService - ApiService
*/
constructor(
- private _recordService: RecordService,
- private _bsModalRef: BsModalRef,
- private _toastr: ToastrService,
- private _translateService: TranslateService,
- private _organisationService: OrganisationService,
- private _userService: UserService,
- private _patronTransactionApiService: PatronTransactionApiService,
- private _apiService: ApiService
+ private recordService: RecordService,
+ private bsModalRef: BsModalRef,
+ private toastr: ToastrService,
+ private translateService: TranslateService,
+ private organisationService: OrganisationService,
+ private userService: UserService,
+ private patronTransactionApiService: PatronTransactionApiService,
+ private apiService: ApiService
) { }
/** OnInit Hook */
@@ -78,7 +77,7 @@ export class PatronFeeComponent implements OnInit {
if (!this.patronPid) {
this.closeModal();
}
- const librarySchema$ = this._recordService.getSchemaForm('patron_transactions');
+ const librarySchema$ = this.recordService.getSchemaForm('patron_transactions');
librarySchema$.subscribe((schema: any) => {
this._initForm(schema.schema.properties);
});
@@ -93,19 +92,19 @@ export class PatronFeeComponent implements OnInit {
if (model.creation_date instanceof Date) {
model.creation_date = DateTime.fromObject(model.creation_date).toISO();
}
- this._patronTransactionApiService.addFee(model).subscribe(
+ this.patronTransactionApiService.addFee(model).subscribe(
() => {
this.onSubmit.next('submit');
this.closeModal();
- this._toastr.success(
- this._translateService.instant('Added a new fee.'),
- this._translateService.instant('Patron transaction')
+ this.toastr.success(
+ this.translateService.instant('Added a new fee.'),
+ this.translateService.instant('Patron transaction')
);
},
() => {
- this._toastr.error(
- this._translateService.instant('An error has occurred. Please try again.'),
- this._translateService.instant('Patron transaction'),
+ this.toastr.error(
+ this.translateService.instant('An error has occurred. Please try again.'),
+ this.translateService.instant('Patron transaction'),
{ disableTimeOut: true }
);
}
@@ -114,7 +113,7 @@ export class PatronFeeComponent implements OnInit {
/** Close modal box */
closeModal(): void {
- this._bsModalRef.hide();
+ this.bsModalRef.hide();
}
/** Init form model */
@@ -135,7 +134,7 @@ export class PatronFeeComponent implements OnInit {
label: 'Amount',
required: true,
addonLeft: [
- getCurrencySymbol(this._organisationService.organisation.default_currency, 'wide')
+ getCurrencySymbol(this.organisationService.organisation.default_currency, 'wide')
]
}
}, {
@@ -161,21 +160,21 @@ export class PatronFeeComponent implements OnInit {
total_amount: null,
creation_date: new Date(),
patron: {
- $ref: this._apiService.getRefEndpoint('patrons', this.patronPid)
+ $ref: this.apiService.getRefEndpoint('patrons', this.patronPid)
},
organisation: {
- $ref: this._apiService.getRefEndpoint('organisations', this.organisationPid)
+ $ref: this.apiService.getRefEndpoint('organisations', this.organisationPid)
},
library: {
- $ref: this._apiService.getRefEndpoint('libraries', this._userService.user.currentLibrary)
+ $ref: this.apiService.getRefEndpoint('libraries', this.userService.user.currentLibrary)
},
status: 'open',
event: {
operator: {
- $ref: this._apiService.getRefEndpoint('patrons', this._userService.user.patronLibrarian.pid)
+ $ref: this.apiService.getRefEndpoint('patrons', this.userService.user.patronLibrarian.pid)
},
library: {
- $ref: this._apiService.getRefEndpoint('libraries', this._userService.user.currentLibrary)
+ $ref: this.apiService.getRefEndpoint('libraries', this.userService.user.currentLibrary)
}
}
}
diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.html b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.html
index 538b2ff39..832803685 100644
--- a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.html
+++ b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.html
@@ -1,6 +1,6 @@
-
+@if (transactions) {