Description
Aleisha Amohia
2023-02-01 01:57:09 UTC
Created attachment 145987 [details] [review] Bug 32776: Add ConvertSelectedReservesToRecalls system preference Created attachment 145988 [details] [review] Bug 32776: Select reserves to convert using new syspref This patchset enhances the convert_reserves_to_recalls.pl cronjob by allowing libraries to be more specific about which reserves should be converted to recalls. The new ConvertSelectedReservesToRecalls adds the flexibility to choose: - the oldest placed reserve to be converted to a recall - each reserve will be converted, one by one, until all recallable items are recalled When reserves are converted to recalls, they will be allocated a specific item and become an item-level recall. This is so recallable items can be allocated one by one. To test: 1. Apply Bug 31415 and configure recalls 2. Apply these patches and update database 3. Create a biblio with 3 items 4. Check out all 3 items to 3 different patrons 5. Place 4 biblio-level reserves for 4 different patrons 6. Set the ConvertSelectedReservesToRecalls system preference to 'oldest' 7. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 8. Confirm there is now 1 recall and 3 biblio-level reserves on the record 9. Confirm the recall has been allocated to one item (there should be a barcode next to the title in the recalls table) 10. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 11. Confirm there are now 2 recalls and 2 biblio-level reserves on the record 12. Confirm the second recall was allocated to the second item. NOT the same item as the first recall. 13. In your shell, run the script twice misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 14. Confirm there is still one reserve remaining that can't be converted because all recallable items are already recalled. 15. Set the ConvertSelectedReservesToRecalls system preference to 'recallable' 16. Select all of the recalls on the record and delete them 17. Place 4 biblio-level reserves for 4 different patrons 18. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 19. Confirm all reserves have been converted to recalls and allocated an item. The fourth reserve will have been allocated as a second recall to the first item. 20. Select all of the recalls on the record and delete them. 21. Place 2 biblio-level recalls and 2 item-level recalls for 4 different patrons, in any order 22. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 23. Confirm all reserves have been converted to recalls and allocated an item. The item-level reserves should have been allocated to their intended item. The biblio-level reserves should have been allocated to the other items. Sponsored-by: Auckland University of Technology Created attachment 157004 [details] [review] Bug 32776: Add ConvertSelectedReservesToRecalls system preference Created attachment 157005 [details] [review] Bug 32776: Select reserves to convert using new syspref This patchset enhances the convert_reserves_to_recalls.pl cronjob by allowing libraries to be more specific about which reserves should be converted to recalls. The new ConvertSelectedReservesToRecalls adds the flexibility to choose: - the oldest placed reserve to be converted to a recall - each reserve will be converted, one by one, until all recallable items are recalled When reserves are converted to recalls, they will be allocated a specific item and become an item-level recall. This is so recallable items can be allocated one by one. To test: 1. Apply Bug 31415 and configure recalls 2. Apply these patches and update database 3. Create a biblio with 3 items 4. Check out all 3 items to 3 different patrons 5. Place 4 biblio-level reserves for 4 different patrons 6. Set the ConvertSelectedReservesToRecalls system preference to 'oldest' 7. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 8. Confirm there is now 1 recall and 3 biblio-level reserves on the record 9. Confirm the recall has been allocated to one item (there should be a barcode next to the title in the recalls table) 10. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 11. Confirm there are now 2 recalls and 2 biblio-level reserves on the record 12. Confirm the second recall was allocated to the second item. NOT the same item as the first recall. 13. In your shell, run the script twice misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 14. Confirm there is still one reserve remaining that can't be converted because all recallable items are already recalled. 15. Set the ConvertSelectedReservesToRecalls system preference to 'recallable' 16. Select all of the recalls on the record and delete them 17. Place 4 biblio-level reserves for 4 different patrons 18. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 19. Confirm all reserves have been converted to recalls and allocated an item. The fourth reserve will have been allocated as a second recall to the first item. 20. Select all of the recalls on the record and delete them. 21. Place 2 biblio-level recalls and 2 item-level recalls for 4 different patrons, in any order 22. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 23. Confirm all reserves have been converted to recalls and allocated an item. The item-level reserves should have been allocated to their intended item. The biblio-level reserves should have been allocated to the other items. Sponsored-by: Auckland University of Technology Created attachment 157006 [details] [review] Bug 32776: Terminology: Reserves to Holds The syspref is now called ConvertSelectedHoldsToRecalls The script is now called misc/cronjobs/recalls/convert_holds_to_recalls.pl Created attachment 157007 [details] [review] Bug 32776: Terminology: Reserves to Holds The syspref is now called ConvertSelectedHoldsToRecalls The script is now called misc/cronjobs/recalls/convert_holds_to_recalls.pl Created attachment 157178 [details] [review] Bug 32776: Terminology: Reserves to Holds The syspref is now called ConvertSelectedHoldsToRecalls The script is now called misc/cronjobs/recalls/convert_holds_to_recalls.pl Created attachment 157966 [details] [review] Bug 32776: Terminology: Reserves to Holds The syspref is now called ConvertSelectedHoldsToRecalls The script is now called misc/cronjobs/recalls/convert_holds_to_recalls.pl Created attachment 158015 [details]
Screenshots - Before and after for step 23
I have tested (using koha-testing-docker).
For me, it looks like steps 19 and 23 in the test plan aren't working as expected.
For both steps, I had to run the script twice. The first time three holds were converted to recalls, and when run again the fourth hold was converted.
I'm also not sure how it works with having multiple recalls requested for the same item by different patrons. Who gets the recall when it is returned and checked in? What happens to the other recall?
Setup
~~~~~
Recall rules:
- Recalls allowed (total): 5
- Recalls per record (count): 5
- On shelf recalls allowed: If any unavailable
- Recall due date interval (day): 5
- Recall overdue fine amount: 5.00
- Recall pickup period (day): 5
Record used, people used for checking out and recall requests:
- For Programming Perl (biblionumber=262) I added two more items, so that there are three in total
- I checked out the items to Lisa Charles, Henry Acevedo, and Mary Burton
- I placed record level holds for Edna Acosta, Bobbie Middleton, Jordan Alford, and Pamela Bennett
System preferences:
- ConvertedSelectedHoldsToRecalls = one hold for each item available to be recalled
- RecallsInterface = both the OPAC and the staff interface
- RecallsMaxPickUpDelay = 7
- UseRecalls = Use
- RecallsLog = Log
Step 19
~~~~~~~
I got the same results as for step 14 - three recalls requested, one hold remaining
Output from running the script ONCE:
misc/cronjobs/recalls/convert_holds_to_recalls.pl -v --min 1
No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 588.
1. Hold converted to recall (reserve_id: 8, biblionumber: 262).
No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 588.
2. Hold converted to recall (reserve_id: 9, biblionumber: 262).
No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 588.
3. Hold converted to recall (reserve_id: 10, biblionumber: 262).
Output from running the script again:
kohadev-koha@kohadevbox:koha(bz32776)$ misc/cronjobs/recalls/convert_holds_to_recalls.pl -v --min 1
No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 588.
1. Hold converted to recall (reserve_id: 11, biblionumber: 262).
Step 23
~~~~~~~
I've attached some screenshots with the before and after results.
Setup similar to step 19 - additional details:
- Items checked out:
. 987654321 - Checked out to Lisa Charles, item level hold by Jordan Alfred
. 123456789 - Checked out to Henry Acevedo, item level hold by Pamela Bennett
. 39999000011418 - Checked out to Mary Burton
- Holds, in priority order:
1. Next available - Edna Acosta
2. Next available - Bobbie Middleton
3. Item 987654321 - Jordan Alfred
4. Item 123456789 - Pamela Bennet
Results from running the script ONCE - I don't think that is the expected result, but I'm not sure:
1. Holdings table - three holds converted to recalls:
. 987654321 - Checked out to Lisa Charles, recalled by Bobbie Middleton (recall on patron record)
. 123456789 - Checked out to Henry Acevedo, item level hold (no recall on patron record for Henry)
. 39999000011418 - Checked out to Mary Burton, recalled by Edna Acosta (recall on patron record)
2. Holds tab - forth hold still showing as a hold (item-level hold by Pamela Bennett for 123456789)
3. Recalls tab:
. Edna Acosta - recall requested for 39999000011418
. Bobbie Middleton - recall requested for 987654321 (patron record shows recall due to be returned - same date as Jordan Alford)
. Jordan Alford - recall requested for 987654321 (patron record shows recall due to be returned - same date as for Bobbie Middleton)
Results from running the script again:
1. Holdings table - three holds converted to recalls:
. 987654321 - Checked out to Lisa Charles, recalled by Bobbie Middleton (recall on patron record) (NO CHANGE)
. 123456789 - Checked out to Henry Acevedo, recalled by Pamella Bennett (recall on patron record for Henry) (CHANGED FROM ITEM LEVEL HOLD TO A RECALL)
. 39999000011418 - Checked out to Mary Burton, recalled by Edna Acosta (recall on patron record) (NO CHANGE)
2. Holds tab - no holds
3. Recalls tab:
. Edna Acosta - recall requested for 39999000011418 (NO CHANGE)
. Bobbie Middleton - recall requested for 987654321 (patron record shows recall due to be returned) (NO CHANGE)
. Jordan Alford - recall requested for 987654321 (patron record shows recall due to be returned) (NO CHANGE)
. Pamela Bennett - recall requested for 123456789 (patron record shows recall due to be returned) (ADDITIONAL RECALL)
Created attachment 159125 [details] [review] Bug 32776: Select reserves to convert using new syspref This patchset enhances the convert_reserves_to_recalls.pl cronjob by allowing libraries to be more specific about which reserves should be converted to recalls. The new ConvertSelectedReservesToRecalls adds the flexibility to choose: - the oldest placed reserve to be converted to a recall - each reserve will be converted, one by one, until all recallable items are recalled When reserves are converted to recalls, they will be allocated a specific item and become an item-level recall. This is so recallable items can be allocated one by one. To test: 1. Apply Bug 31415 and configure recalls 2. Apply these patches and update database 3. Create a biblio with 3 items 4. Check out all 3 items to 3 different patrons 5. Place 4 biblio-level reserves for 4 different patrons 6. Set the ConvertSelectedReservesToRecalls system preference to 'oldest' 7. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 8. Confirm there is now 1 recall and 3 biblio-level reserves on the record 9. Confirm the recall has been allocated to one item (there should be a barcode next to the title in the recalls table) 10. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 11. Confirm there are now 2 recalls and 2 biblio-level reserves on the record 12. Confirm the second recall was allocated to the second item. NOT the same item as the first recall. 13. In your shell, run the script twice misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 14. Confirm there is still one reserve remaining that can't be converted because all recallable items are already recalled. 15. Set the ConvertSelectedReservesToRecalls system preference to 'recallable' 16. Select all of the recalls on the record and delete them 17. Place 4 biblio-level reserves for 4 different patrons 18. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 19. Confirm all reserves have been converted to recalls and allocated an item. The fourth reserve will have been allocated as a second recall to the first item. 20. Select all of the recalls on the record and delete them. 21. Place 2 biblio-level recalls and 2 item-level recalls for 4 different patrons, in any order 22. In your shell, run the script misc/cronjobs/recalls/convert_reserves_to_recalls.pl -v --min 1 23. Confirm all reserves have been converted to recalls and allocated an item. The item-level reserves should have been allocated to their intended item. The biblio-level reserves should have been allocated to the other items. Sponsored-by: Auckland University of Technology Created attachment 159126 [details] [review] Bug 32776: Terminology: Reserves to Holds The syspref is now called ConvertSelectedHoldsToRecalls The script is now called misc/cronjobs/recalls/convert_holds_to_recalls.pl Created attachment 159127 [details] [review] Bug 32776: Stop recalled items from being recalled by other holds being converted on same record Hi Aleisha. Things aren't working as expected: 1. In the staff interface, the system preference is now called ConvertedSelectedHoldsToRecalls, even though in the database it is ConvertSelectedHoldsToRecalls (Convert.. instead of Converted...) 2. In the third patch (Terminology: Reserves to Holds) it refers to'ConvertedSelectedHoldsToRecalls'. I was only up to step 7 in the test plan, and I got this (the first hold wasn't converted): misc/cronjobs/recalls/convert_holds_to_recalls.pl -v --min 1 Use of uninitialized value in string eq at misc/cronjobs/recalls/convert_holds_to_recalls.pl line 102. Use of uninitialized value in string eq at misc/cronjobs/recalls/convert_holds_to_recalls.pl line 112. David Setting to Failed QA so I know to come back to this later |