Bug 23296 - Auto Renewal Notice does not use Library specific notices
Summary: Auto Renewal Notice does not use Library specific notices
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal with 1 vote (vote)
Assignee: Lucas Gass
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-11 00:03 UTC by Kelly McElligott
Modified: 2024-04-25 19:28 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00


Attachments
Bug 23296: Set patron branchcode when preparing non-digest version (1.51 KB, patch)
2024-01-25 21:59 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 23296: Set patron branchcode when preparing non-digest version (1.56 KB, patch)
2024-02-13 18:48 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 23296: Set patron branchcode when preparing non-digest version (1.68 KB, patch)
2024-04-05 07:08 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kelly McElligott 2019-07-11 00:03:09 UTC
All notices in Koha are created to be a default ALL libraries notice, however, with branch systems, there is also the ability to create a library specific notice that can be used instead.  However, the notice AUTO_RENEWALS is not currently capable of being library specific - instead, the ALL Library Notice for AUTO_RENEWALS is the only one that Koha send. 

To adjust this, it would be recommended that a library specific notice like all the others in Koha can be created.  Following circ control, would be the suggested way to go as with most notices in Koha.
Comment 1 Lucas Gass 2019-07-24 17:58:27 UTC
Until this is fixed here is a workaround. Edit the (All libraries) AUTO_RENEWALS notice like so:

[% whichbranch = borrower.branchcode %]
[% IF whichbranch == "BRANCHCODE" %]
some specific branch notice stuff about auto renewal
[% ELSE %]
some generic notice stuff about auto renewal
[% END %]
Comment 2 Katrin Fischer 2021-10-31 17:06:25 UTC
Lucas examples uses the patron's homebranch and I think this is also the behaviour I would expect. The patron's homebranch is a singular value, we will end up with one notice, either default or a branch specific one.

The CircControl preference states it's used for determining how to calculate fines and for which circulation rule to use, it doesn't state anything about notices. It also has an option for "where you are logged in" that doesn't apply well to automatically send notices.

And last, if it was set to "where the item is from" and you have items from multiple branches, we'd have to split into multiple notices to follow that preference.

... and we really should document somewhere how the multiple notices work regarding to who the notices are sent from and which templates are used. It's not only about the template, but also about the email addresses that appear as sender etc.
Comment 3 Katrin Fischer 2021-10-31 17:41:15 UTC
Hm, was discussing this at length with Putti on IRC, but it's quite confusing still.

Bug 7001, comment 44 points to the use of CircControl for the notices too.

> You will be happy to know that with CircControl set to "the library you are
> logged in at" the notices all work the way one would expect.

But what would is the expected behaviour in this case?

I think the least we should do is clear this up, document and amend the text of the system preference.

I am always pro consistency ... and documentation :)
Comment 4 Lucas Gass 2024-01-25 21:52:36 UTC
I think this should be consistent with the behavior of the digest version of the notice. So we should send the notice based on the patron's branch.
Comment 5 Lucas Gass 2024-01-25 21:59:51 UTC
Created attachment 161469 [details] [review]
Bug 23296: Set patron branchcode when preparing non-digest version

To test:
1. APPLY PATCH
2. Set up circ rules to allow for auto renewals.
3. Set AutoRenewalNotices to 'according to message prefs'
4. Make a branch specific version of the the AUTO_RENEWAL notice.
5. Find a patron belonging to that branch and set the message prefs to allow for a AUTO_RENEWAL. But no digest option!
6. Check some things out and make sure they are eligble for auto renewal.
7. Run the cron.
8. Make sure the patron gets the branch specific notice.
9. Delete the branch specific notice.
10. DO 6-7 again.
11. Make sure they now get the all library notice.
Comment 6 Brendan Lawlor 2024-02-13 18:48:24 UTC
Created attachment 162127 [details] [review]
Bug 23296: Set patron branchcode when preparing non-digest version

To test:
1. APPLY PATCH
2. Set up circ rules to allow for auto renewals.
3. Set AutoRenewalNotices to 'according to message prefs'
4. Make a branch specific version of the the AUTO_RENEWAL notice.
5. Find a patron belonging to that branch and set the message prefs to allow for a AUTO_RENEWAL. But no digest option!
6. Check some things out and make sure they are eligble for auto renewal.
7. Run the cron.
8. Make sure the patron gets the branch specific notice.
9. Delete the branch specific notice.
10. DO 6-7 again.
11. Make sure they now get the all library notice.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 7 Brendan Lawlor 2024-02-13 18:54:23 UTC
Some notes to make testing autorenewals easier:

In circulation and fine rules
loan period: 3
renewal period: 3
No automatic renewal before: 3
Automatic renewal : yes

In system preferences
NoRenewalBeforePrecision: date

after checking out items run ./misc/cronjobs/automatic_renewals.pl to confirm items would be renewed then run again with options -c -v before checking the notices tab for the patron
Comment 8 Marcel de Rooy 2024-04-05 07:08:36 UTC
Created attachment 164452 [details] [review]
Bug 23296: Set patron branchcode when preparing non-digest version

To test:
1. APPLY PATCH
2. Set up circ rules to allow for auto renewals.
3. Set AutoRenewalNotices to 'according to message prefs'
4. Make a branch specific version of the the AUTO_RENEWAL notice.
5. Find a patron belonging to that branch and set the message prefs to allow for a AUTO_RENEWAL. But no digest option!
6. Check some things out and make sure they are eligble for auto renewal.
7. Run the cron.
8. Make sure the patron gets the branch specific notice.
9. Delete the branch specific notice.
10. DO 6-7 again.
11. Make sure they now get the all library notice.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Tidied one line.
Comment 9 Katrin Fischer 2024-04-05 09:52:09 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 10 Laura O'Neil 2024-04-25 19:28:37 UTC
Might this be backported to 23.11 or 23.05?