Bug 31998

Summary: gather_print_notices can only split notices based on patron home library
Product: Koha Reporter: Laura O'Neil <laura>
Component: NoticesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: alex, andrew, catrina, dmeininger591, esther.melander, hebah, jsasse, laura, lucas
Version: 21.11   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31991
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Crowdfunding committed: 0
Crowdfunding contact: Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Laura O'Neil 2022-10-26 18:42:11 UTC
Overdue notices are currently sent to the patron’s home library, not the owning or issuing library. The problem is the letter template used is based on either the owning or the issuing library (based on the cronjob option --frombranch). That means if a Library A patron has an overdue checked out/owned by Library B, then Library A will receive a print notice formatted with Library B’s template.

To resolve this we can do one of two things:
A) Add an option to format the notice using the template from the patron’s home library

B) Add an option to send notices for print to the patron’s home library, but to the owning/checkout library

(A) is a simpler solution, though (B) may be wanted by library systems that are more “independent” and don’t want to mail notices for overdues at other libraries.
Comment 1 Katrin Fischer 2022-10-26 20:36:34 UTC
We had a similar issue with the email, just linking the 2 in case there is some similarity.
Comment 2 Katrin Fischer 2022-10-26 20:38:12 UTC
Laura, can you please clarify:

* Is the wrong notice template used?
* Is the email sent to the wrong library? (and is this the CC, the one for users without email or some other mail?)
Comment 3 Alex Carver [Acerock7] 2024-08-23 15:31:13 UTC
Commenting here to +1 an enhancement of this type. For my system, the problem is that some of our libraries are fine free and others are not. We determine fines by issuing library and not home library. Because Overdue notices are gathered by patron Home Library, it's not always their rules that the item was checked out under. If there are fines and fees, they may well be fines and fees from the issuing library. 

Overdue notices and the associated fines are connected, so fine free libraries may not be comfortable communicating fines and fees that they are not asking for and have no connection to.
Comment 4 Andrew Fuerste-Henry 2026-02-24 15:02:07 UTC
The issue here is that the overdue_notices cron is more flexible than the gather_print_notices cron. Overdue_notices can be grouped by item home library, issuing library, or patron home library. Gather_print can only be grouped by patron home library. 

If overdues are grouped by patron home library, everything matches up and the correct library gets the correct print notices to print and send.

If overdues are grouped by item home library or issuing library, the overdues cron uses the correct template and includes the correct wording, but then gather_print gives that notice to the wrong library to print and send.

Currently, once a message is generated and in the message_queue it no longer has a link to a specific checkout or item that could be used to code out more options in how messages get split between libraries. We could resolve that by adding a branch column to message_queue that records the branch used when generating the message.