Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation of fees based on the library of the renewal or checkin, instead of the library of the checkout #2683

Closed
pronguen opened this issue Feb 7, 2022 · 3 comments · Fixed by #2678
Assignees
Labels
bug Breaks something but is not blocking f: circulation Concerns the circulation interface or backend p-High High priority (to be solved in the 2-3 next months)
Milestone

Comments

@pronguen
Copy link
Contributor

pronguen commented Feb 7, 2022

Describe the bug

In most of the cases, fees are calculated correctly. In some cases though, they are counted on closed days.

Hypothesis to verify: maybe the fees takes as basis the checkin library opening hours and exception days.

To Reproduce

Unknown, see hypothesis above

Expected behavior

Calculation of overdue incremental fees always takes as basis the checkout library opening hours and exception days.

Context

  • server: bib.rero.ch
  • version: v1.8.0

Example 1

  • Loan pid:269879
  • Applied cipo is pid:22
  • Item library pid:30 (La Chaux-de-Fonds)
  • Checkout library pid:30 (La Chaux-de-Fonds)
  • After last renewal, loan due date was 23.12.21
  • La Chaux-de-Fonds was closed on 24-26.12
  • Grace period (4 days) was applied on 27-30.12
  • La Chaux-de-Fonds was closed on 31.12-03.01
  • Fees started on 03.01 instead of 04.01

Other examples of this error exist in the same user account (fees of CHF 4.-). All are item of La Chaux-de-Fonds checked out in La Chaux-de-Fonds, but checked in in Neuchâtel. Maybe the fees takes as basis the checkin library opening hours and exception days. Indeed, Neuchatel was open on 03.01.

image

@pronguen pronguen added f: circulation Concerns the circulation interface or backend bug Breaks something but is not blocking p-High High priority (to be solved in the 2-3 next months) labels Feb 7, 2022
@zannkukai
Copy link
Contributor

@pronguen. Your hypothesis is correct. At this time, all fees are calculated based on "transaction_location_pid". So in this case, this is the library/39 that was used to build the fee. This library is open every day except sunday. So the fee steps build seems correct.

With the #2678 PR, the library used to build fee steps will be the library related to "checkout_location_pid". So in this case, library/30 (and with calendar of this library)

@zannkukai zannkukai self-assigned this Feb 8, 2022
@zannkukai zannkukai added this to the v1.9.0 milestone Feb 8, 2022
@zannkukai zannkukai linked a pull request Feb 8, 2022 that will close this issue
7 tasks
@pronguen
Copy link
Contributor Author

pronguen commented Feb 8, 2022

Your hypothesis is correct. At this time, all fees are calculated based on "transaction_location_pid"

@zannkukai So if the item (belonging to library A) was checked out at library A, then renewed from library B (by a professional), then the overdue fees will also base on library B?

Case (fees have been added after the first renewal done from another library):
image

@pronguen pronguen changed the title Fees sometimes counted on closed days Calculation of fees based on the library of the renewal or checkin, instead of the library of the checkout Feb 8, 2022
@zannkukai
Copy link
Contributor

So if the item (belonging to library A) was checked out at library A, then renewed from library B (by a professional), then the overdue fees will also base on library B?

@pronguen At this time I think you"re correct. With the PR, fees will always be calculated based on "checkout_library" despite if a librarian from libraryB make a "renew" operation.

@jma jma closed this as completed in #2678 Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks something but is not blocking f: circulation Concerns the circulation interface or backend p-High High priority (to be solved in the 2-3 next months)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants