Bug 21886: Add option to send notices from owning library instead of issuing library
authorStefan Berndtsson <stefan.berndtsson@ub.gu.se>
Tue, 20 Nov 2018 10:35:45 +0000 (11:35 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 4 Jan 2021 15:33:15 +0000 (16:33 +0100)
commit9d765eb5c994df4cc62ec243d1728f2e13e03ba4
tree7b91ce55e9d93ccd2bc174e818f01f31bf9b7de2
parent8fe582f0669eed1ede5145ca50f8343ca9cd2a26
Bug 21886: Add option to send notices from owning library instead of issuing library

The provided patch adds the following functionality:

* Add --owning to both advance_notice.pl and overdue_notice.pl
* Add --library to advance_notice.pl like the way overdue_notice.pl already works

When specifying "--owning" both scripts will use items.homebranch instead of
issues.branchcode to determine sending library.

For advance_notice.pl this affects non-digest DUE and PREDUE, but not digest notices.

To test:

1.  Have a patron who wants advance notices as email with 2 days in advance (not digest)
2.  Have the first overdue date set 3 days past due date
3.  Have issue for that patron where date_due is 2 days away where the item homebranch differs from the issuing branch
4.  Have issue for that patron where date_due is 3 days old
5.  Run advance_notices.pl without --owning
6.  Run overdue_notices.pl without --owning
7.  Confirm that two messages were created for that patron with the sender being the issuing branch
8.  Delete messages or create two more issues according to (3) and (4)
9.  Run advance_notices.pl with --owning
10. Run overdue_notices.pl with --owning
11. Confirm that the two messages created has the item homebranch as sender

Extra feature for advance_notices.pl is that it adds "--library" the same way overdue_notices.pl has.
Adding variants of that flag in steps (5) and (9) above can confirm this option as well.

Sponsored-by: Gothenburg University Library
Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Signed-off-by: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Circulation.pm
misc/cronjobs/advance_notices.pl
misc/cronjobs/overdue_notices.pl