Bug 32740 - Add a new option patron home library to OverdueNoticeFrom
Summary: Add a new option patron home library to OverdueNoticeFrom
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Hammat wele
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-27 16:15 UTC by Hammat wele
Modified: 2024-01-17 20:53 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/817
Text to go in the release notes:
Version(s) released in:
23.11.00


Attachments
Bug 32740: Add a new option patron home library to OverdueNoticeFrom (9.07 KB, patch)
2023-01-27 21:06 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 32740: Add a new option patron home library to OverdueNoticeFrom (9.13 KB, patch)
2023-04-14 15:42 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 32740: Add a new option patron home library to OverdueNoticeFrom (9.19 KB, patch)
2023-05-08 19:35 UTC, Hinemoea Viault
Details | Diff | Splinter Review
Bug 32740: Add a new option patron home library to OverdueNoticeFrom (9.74 KB, patch)
2023-09-12 08:19 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Hammat wele 2023-01-27 16:15:45 UTC
This patch will add 'patron home library' option to the OverdueNoticeFrom preference. When it's selected notification messages for overdues will be bundled and sent from the borrowing user's home library.
Comment 1 Hammat wele 2023-01-27 21:06:34 UTC
Created attachment 145779 [details] [review]
Bug 32740: Add a new option patron home library to OverdueNoticeFrom

This patch add 'patron home library' option to the OverdueNoticeFrom preference. When it's selected notification messages for overdues will be bundled and sent from the borrowing user's home library

To Test
1. Create 3 libraries B1, B2 and B3
    1.1. Go to Koha administration, click on Libraries
    1.2. Click New library
    1.3. Fill the Library Code (ex. B1), Name(ex. B1) and email(ex. b1@test.com) fields.
2. Create a user belonging to B1
    2.1. Go to patron module, click on New patron and patron
    2.2. Fill the Surname,Card number,Primary email,Card number field and select B1 as Library.
3. Create 2 notices : the first belongs to B2 and the second belong to B3
    3.1. Go to Cataloging module and click on new
    3.2. field the required field (000 subfield 0, 003 subfield 0,  005 subfield 0, 008 subfield 0, 040 subfield c,245 subfield a, and 942 subfield c )
    3.3. Click on save
    3.4. In the item form, Select Home library = B2 and Current library = B2 and type a Barcode.
    3.5. Repeat 3.1 3.2 3.3 3.4 to create a second notice belong to B3
4. Have (or create) a default notice for all branches in Notices and Slips Module
5. Make sure you connected to branch B2 or Switch to branch B2
6. checkout item I2 (belonging to B2) to the user created in step 2 (specifying as due date the day before (1 day overdue))
7. switch to branch B3
8. checkout item I3 (belonging to B3) to the user created in step 2 (specifying as due date the day before (1 day overdue))
9. make sure you have defined 'Overdue notice/status triggers' for that patron category, ie with Delay=1 so that 'Overdue Notice' is selected and 'Email' is checked.
Note: we have a user belong to B1, two item: I2 belong to B2, I3 belong to B3 and the user has borrowed I2 from B2 and I3 from B3.
10. Test
    10.1. Search for OverdueNoticeFrom in System preferences and select item home library
    10.2. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => Two new entries will be generated in message_queue DB table, coming from different branches that have the SAME list of overdue items.
        => The sender address is the item home library address for each entry.
11. Apply the patch
12. Search for OverdueNoticeFrom in System preferences
        => There is now 'patron home library' in the options list
13. Select patron home library
14. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => You will see that only one message had been created. Its content shows both B2 and B3 overdue items
        => The sender address matches B1 address (the patron home library).
15. Search for OverdueNoticeFrom in System preferences and select cron
16. from cli run './misc/cronjobs/overdue_notices.pl --frombranch patron-homebranch'
    => you will get the same result at step 14
Comment 2 Lucas Gass 2023-04-14 15:41:50 UTC
This works as described, glad to see this patch as this is the behavior some libraries would like to see.
Comment 3 Lucas Gass 2023-04-14 15:42:36 UTC
Created attachment 149695 [details] [review]
Bug 32740: Add a new option patron home library to OverdueNoticeFrom

This patch add 'patron home library' option to the OverdueNoticeFrom preference. When it's selected notification messages for overdues will be bundled and sent from the borrowing user's home library

To Test
1. Create 3 libraries B1, B2 and B3
    1.1. Go to Koha administration, click on Libraries
    1.2. Click New library
    1.3. Fill the Library Code (ex. B1), Name(ex. B1) and email(ex. b1@test.com) fields.
2. Create a user belonging to B1
    2.1. Go to patron module, click on New patron and patron
    2.2. Fill the Surname,Card number,Primary email,Card number field and select B1 as Library.
3. Create 2 notices : the first belongs to B2 and the second belong to B3
    3.1. Go to Cataloging module and click on new
    3.2. field the required field (000 subfield 0, 003 subfield 0,  005 subfield 0, 008 subfield 0, 040 subfield c,245 subfield a, and 942 subfield c )
    3.3. Click on save
    3.4. In the item form, Select Home library = B2 and Current library = B2 and type a Barcode.
    3.5. Repeat 3.1 3.2 3.3 3.4 to create a second notice belong to B3
4. Have (or create) a default notice for all branches in Notices and Slips Module
5. Make sure you connected to branch B2 or Switch to branch B2
6. checkout item I2 (belonging to B2) to the user created in step 2 (specifying as due date the day before (1 day overdue))
7. switch to branch B3
8. checkout item I3 (belonging to B3) to the user created in step 2 (specifying as due date the day before (1 day overdue))
9. make sure you have defined 'Overdue notice/status triggers' for that patron category, ie with Delay=1 so that 'Overdue Notice' is selected and 'Email' is checked.
Note: we have a user belong to B1, two item: I2 belong to B2, I3 belong to B3 and the user has borrowed I2 from B2 and I3 from B3.
10. Test
    10.1. Search for OverdueNoticeFrom in System preferences and select item home library
    10.2. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => Two new entries will be generated in message_queue DB table, coming from different branches that have the SAME list of overdue items.
        => The sender address is the item home library address for each entry.
11. Apply the patch
12. Search for OverdueNoticeFrom in System preferences
        => There is now 'patron home library' in the options list
13. Select patron home library
14. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => You will see that only one message had been created. Its content shows both B2 and B3 overdue items
        => The sender address matches B1 address (the patron home library).
15. Search for OverdueNoticeFrom in System preferences and select cron
16. from cli run './misc/cronjobs/overdue_notices.pl --frombranch patron-homebranch'
    => you will get the same result at step 14

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Hinemoea Viault 2023-05-08 19:35:20 UTC
Created attachment 150806 [details] [review]
Bug 32740: Add a new option patron home library to OverdueNoticeFrom

This patch add 'patron home library' option to the OverdueNoticeFrom preference. When it's selected notification messages for overdues will be bundled and sent from the borrowing user's home library

To Test
1. Create 3 libraries B1, B2 and B3
    1.1. Go to Koha administration, click on Libraries
    1.2. Click New library
    1.3. Fill the Library Code (ex. B1), Name(ex. B1) and email(ex. b1@test.com) fields.
2. Create a user belonging to B1
    2.1. Go to patron module, click on New patron and patron
    2.2. Fill the Surname,Card number,Primary email,Card number field and select B1 as Library.
3. Create 2 notices : the first belongs to B2 and the second belong to B3
    3.1. Go to Cataloging module and click on new
    3.2. field the required field (000 subfield 0, 003 subfield 0,  005 subfield 0, 008 subfield 0, 040 subfield c,245 subfield a, and 942 subfield c )
    3.3. Click on save
    3.4. In the item form, Select Home library = B2 and Current library = B2 and type a Barcode.
    3.5. Repeat 3.1 3.2 3.3 3.4 to create a second notice belong to B3
4. Have (or create) a default notice for all branches in Notices and Slips Module
5. Make sure you connected to branch B2 or Switch to branch B2
6. checkout item I2 (belonging to B2) to the user created in step 2 (specifying as due date the day before (1 day overdue))
7. switch to branch B3
8. checkout item I3 (belonging to B3) to the user created in step 2 (specifying as due date the day before (1 day overdue))
9. make sure you have defined 'Overdue notice/status triggers' for that patron category, ie with Delay=1 so that 'Overdue Notice' is selected and 'Email' is checked.
Note: we have a user belong to B1, two item: I2 belong to B2, I3 belong to B3 and the user has borrowed I2 from B2 and I3 from B3.
10. Test
    10.1. Search for OverdueNoticeFrom in System preferences and select item home library
    10.2. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => Two new entries will be generated in message_queue DB table, coming from different branches that have the SAME list of overdue items.
        => The sender address is the item home library address for each entry.
11. Apply the patch
12. Search for OverdueNoticeFrom in System preferences
        => There is now 'patron home library' in the options list
13. Select patron home library
14. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => You will see that only one message had been created. Its content shows both B2 and B3 overdue items
        => The sender address matches B1 address (the patron home library).
15. Search for OverdueNoticeFrom in System preferences and select cron
16. from cli run './misc/cronjobs/overdue_notices.pl --frombranch patron-homebranch'
    => you will get the same result at step 14

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com>
Comment 5 Chris Cormack 2023-09-12 08:19:32 UTC
Created attachment 155541 [details] [review]
Bug 32740: Add a new option patron home library to OverdueNoticeFrom

This patch add 'patron home library' option to the OverdueNoticeFrom preference. When it's selected notification messages for overdues will be bundled and sent from the borrowing user's home library

To Test
1. Create 3 libraries B1, B2 and B3
    1.1. Go to Koha administration, click on Libraries
    1.2. Click New library
    1.3. Fill the Library Code (ex. B1), Name(ex. B1) and email(ex. b1@test.com) fields.
2. Create a user belonging to B1
    2.1. Go to patron module, click on New patron and patron
    2.2. Fill the Surname,Card number,Primary email,Card number field and select B1 as Library.
3. Create 2 notices : the first belongs to B2 and the second belong to B3
    3.1. Go to Cataloging module and click on new
    3.2. field the required field (000 subfield 0, 003 subfield 0,  005 subfield 0, 008 subfield 0, 040 subfield c,245 subfield a, and 942 subfield c )
    3.3. Click on save
    3.4. In the item form, Select Home library = B2 and Current library = B2 and type a Barcode.
    3.5. Repeat 3.1 3.2 3.3 3.4 to create a second notice belong to B3
4. Have (or create) a default notice for all branches in Notices and Slips Module
5. Make sure you connected to branch B2 or Switch to branch B2
6. checkout item I2 (belonging to B2) to the user created in step 2 (specifying as due date the day before (1 day overdue))
7. switch to branch B3
8. checkout item I3 (belonging to B3) to the user created in step 2 (specifying as due date the day before (1 day overdue))
9. make sure you have defined 'Overdue notice/status triggers' for that patron category, ie with Delay=1 so that 'Overdue Notice' is selected and 'Email' is checked.
Note: we have a user belong to B1, two item: I2 belong to B2, I3 belong to B3 and the user has borrowed I2 from B2 and I3 from B3.
10. Test
    10.1. Search for OverdueNoticeFrom in System preferences and select item home library
    10.2. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => Two new entries will be generated in message_queue DB table, coming from different branches that have the SAME list of overdue items.
        => The sender address is the item home library address for each entry.
11. Apply the patch
12. Search for OverdueNoticeFrom in System preferences
        => There is now 'patron home library' in the options list
13. Select patron home library
14. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => You will see that only one message had been created. Its content shows both B2 and B3 overdue items
        => The sender address matches B1 address (the patron home library).
15. Search for OverdueNoticeFrom in System preferences and select cron
16. from cli run './misc/cronjobs/overdue_notices.pl --frombranch patron-homebranch'
    => you will get the same result at step 14

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com>

Was failing the qa script, so I perltidied the changed lines.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 6 Tomás Cohen Arazi 2023-10-11 15:14:09 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-10-13 00:09:41 UTC
Enhancement not pushed to 23.05.x
Comment 8 Ray Delahunty 2023-10-13 07:48:06 UTC
Is any of the code that has fixed this bug transferrable to resolve bug 34140?