Koha/C4
Emily Lamancusa dc00e55a32
Bug 34972: Remove GetOtherReserves
GetOtherReserves attempts to set the waiting/transit status for the next
hold on the list when applicable, but in practice it either leaves the
hold state unchanged, or sets the itemnumber without setting the found
status (erroneously converting bib-level holds to item-level holds).

The latter situation only occurs when the user has been prompted to
confirm, cancel, or revert the hold, and is able to ignore the prompt.
In those situations, the hold's state should not change.

GetOtherReserves does not need to change the hold state, and it does not
do so correctly. Besides that, it does not do much other than call
CheckReserves, and is only used in 3 places.

This patch removes GetOtherReserves, and refactors returns.pl and
C4::Reserves::ModReserveCancelAll to call CheckReserves directly instead.

To test:
1. Place 2 bib-level holds for 2 different patrons (Patron A and Patron
    B) on the same record, both for pickup at the logged-in library
2. Check in an item from that record to fill Patron A's hold
3. Set the hold's expiration date to yesterday by accessing the database
    in the command line:
    - In a ktd shell prompt, open the db client with koha-mysql kohadev
    - UPDATE reserves
        SET expirationdate = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
        WHERE borrowernumber = <Patron A's borrowernumber>
4. Go to Circulation > Holds Awaiting Pickup, and find the hold in the
    "holds waiting past their expiration date" tab
5. Click the "Cancel hold" button in the Actions column next to the hold
   (do not check in the book)
6. Return to the bib record and look at Patron B's hold
--> Note that Patron B's hold is now an item-level hold and does not
    have a waiting status

7. Cancel Patron B's hold
8. Place 2 new holds on the record: one for Patron A at the logged-in
    library, and one for Patron B at a different library
9. Check in an item to fill Patron A's hold
10. Repeat steps 3-5 to expire and cancel Patron A's hold
11. Return to the Holds tab of the bib record and look at Patron B's hold
--> Note that Patron B's hold is now an item-level hold, and there is no
    "Revert transit status" button

12. Place 2 bib-level holds for 2 different patrons (Patron A and Patron
    B) on the same record, both for pickup at the logged-in library
13. Check in an item from that record to fill Patron A's hold
14. Check in the same item again. A modal will pop up, saying that the
    hold is already waiting
15. In the modal, choose a cancellation reason and click "Cancel hold"
--> A new modal will pop up to fill Patron B's hold
16. Click "Ignore" on the modal for Patron B's hold
17. Return to the bib record and look at Patron B's hold
--> Note that Patron B's hold is now an item-level hold and does not
    have a waiting status

18. Apply patch
19. Repeat steps 1-6
--> Note that Patron B's hold is still a bib-level/"next available" hold
20. Repeat steps 7-11
--> Note that Patron B's hold is still a bib-level/"next available" hold
21. Repeat steps 12-17
--> Note that Patron B's hold is still a bib-level/"next available" hold

Make sure correct behavior is unchanged:

22. Cancel Patron B's hold
23. Place 2 new holds on the record: one for Patron A at the logged-in
    library, and one for Patron B at a different library
24. Check in an item from that record to fill Patron A's hold
25. Check in the same item again. A modal will pop up, saying that the
    hold is already waiting
26. In the modal, choose a cancellation reason and click "Cancel hold"
--> A new modal will pop up to fill Patron B's hold
27. Click "Print slip, transfer, and confirm" on the modal for Patron B's hold
--> Confirm that the information on the slip is correct
--> Confirm that the hold is correctly put in transit

22. Set HoldsAutoFill and HoldsAutoFillPrintSlip to "Do"

23. Place a bib-level hold for the logged-in library
24. Check in an item from that bib
--> Confirm the information on the slip is correct
--> Confirm the hold is correctly assigned and set to waiting
25. Place a bib-level hold for a different library
26. Check in an item from that bib
--> Confirm the information on the slip is correct
--> Confirm the hold is correctly put in transit
27. Change the logged-in branch to match the hold pickup location
28. Check the item in
--> Confirm the information on the slip is correct
--> Confirm the hold is correctly assigned and set to waiting

29. Repeat steps 22-26
--> Confirm a correct hold slip pops up for Patron B's hold
--> Confirm that Patron B's hold is correctly put in transit
30. Cancel Patron B's hold
31. Place 2 bib-level holds for 2 different patrons (Patron A and Patron
    B) on the same record, both for pickup at the logged-in library
33. Repeat steps 24-26
--> Confirm a correct hold slip pops up for Patron B's hold
--> Confirm Patron B's hold is correctly set to Waiting

34. Prove t/db_dependent/Circulation.t
35. Prove t/db_dependent/Koha/Holds.t
--> Tests pass

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-05-07 15:53:42 +02:00
..
AuthoritiesMarc
Barcodes
ClassSortRoutine
ClassSplitRoutine
Creators Bug 10762: (QA follow-up) Perltidy 2023-10-25 10:35:31 -03:00
External
Form Bug 30318: Don't reset messaging preferences when form is empty 2024-04-26 08:52:51 +02:00
Heading Bug 21828: build $bib_heading_fields only once per invocation 2023-09-22 12:57:46 -03:00
ILSDI Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-02-02 17:31:46 +01:00
Installer
Labels Bug 10762: (QA follow-up) Perltidy 2023-10-25 10:35:31 -03:00
Linker
Members Bug 33239: Add the ability to run borrowers-force-messaging-defaults.pl only on a specified message name 2023-10-11 10:31:46 -03:00
OAI
Output
Patroncards Bug 34532: Silence warns in Patroncard.pm 2023-09-15 11:57:08 -03:00
Reports Bug 35746: add multiselect to report dropdowns 2024-04-26 18:06:19 +02:00
Search
Serials
SIP Bug 36605: Add update_lastseen to handle_patron_status for SIP 2024-04-29 09:35:41 +02:00
Utils/DataTables Bug 34913: Fix perlcritic for VirtualShelves.pm 2024-01-29 12:24:54 +01:00
Accounts.pm
Acquisition.pm Bug 36002: Remove unused subroutine GetParcels 2024-04-30 17:09:43 +02:00
Auth.pm Bug 23102: 404 errors on page causes SCI user to be logged out 2024-04-12 12:12:30 +02:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm Bug 34893: (QA follow-up) Tidy code for qa script 2024-02-02 17:31:47 +01:00
Auth_with_ldap.pm Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-02-02 17:31:46 +01:00
Auth_with_shibboleth.pm Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-02-02 17:31:46 +01:00
AuthoritiesMarc.pm Bug 29522: [alternate] Skip relinking bibliographic records when merging authorities 2024-03-15 15:39:15 +01:00
Barcodes.pm
Biblio.pm Bug 36137: Make update_totalissues cron always skip the holds queue 2024-05-03 18:02:15 +02:00
Breeding.pm Bug 28166: (QA follow-up) Fix and tidy tests and code 2023-10-23 11:33:50 -03:00
Budgets.pm Bug 31631: Optionally use tax-exclusive values for calculating fund values 2023-10-18 15:41:35 -03:00
Calendar.pm Bug 32048: Added clear cache routine to delete_holiday_range_repeatable 2023-09-18 15:31:50 -03:00
Charset.pm
Circulation.pm Bug 27753: (QA follow-up) Use librarian as resolver 2024-05-06 09:12:14 +02:00
ClassSortRoutine.pm
ClassSource.pm
ClassSplitRoutine.pm
Context.pm Bug 33431: Make C4::Circulation use C4::Context->yaml_preference 2024-03-18 11:03:37 +01:00
Contract.pm
CourseReserves.pm
Creators.pm
Heading.pm Bug 33557: Add LinkerConsiderThesaurus system preference 2023-05-10 15:26:26 -03:00
HoldsQueue.pm Bug 32565: (follow-up) Tidy 2024-04-30 14:32:07 +02:00
HTML5Media.pm
ImportBatch.pm Bug 35438: Remove skip_intermediate_commit parameter 2024-01-16 12:06:08 +01:00
ImportExportFramework.pm
InstallAuth.pm Bug 36102: Fix expired session on the login page of the installer (?) 2024-03-01 11:00:35 +01:00
Installer.pm Bug 34174: (bug 33341 follow-up) Fix Ris export 2023-07-06 12:24:12 -03:00
ItemCirculationAlertPreference.pm
Items.pm Bug 19097: Adjust some GetMarcFromKohaField calls 2024-04-29 09:35:47 +02:00
Koha.pm Bug 35833: Fix warnings from C4/Koha 2024-01-29 12:24:58 +01:00
Labels.pm
Languages.pm Bug 35582: Supress possible warning 2024-04-29 18:53:13 +02:00
Letters.pm Bug 33237: Move and simplify language selection logic 2024-04-30 14:32:15 +02:00
Linker.pm
Log.pm Bug 25159: (QA follow-up) Tidy changes 2024-05-02 16:47:44 +02:00
MarcModificationTemplates.pm
Matcher.pm Bug 26611: Make authority record matching use required match checks 2023-05-24 11:21:31 -03:00
Members.pm Bug 26170: Add protected status for patrons 2023-11-01 17:23:06 -03:00
Message.pm Bug 18398: (follow-up) Update POD & Unit tests 2023-03-31 13:13:35 +02:00
Output.pm Bug 34478: Remove check_csrf from pl files 2024-03-01 10:56:01 +01:00
Overdues.pm Bug 34279: Don't enforce overduefinescap unless it is greater than 0 2023-07-19 13:00:41 -03:00
Patroncards.pm
Record.pm Bug 33431: Make C4::Record use C4::Context->yaml_preference 2024-03-18 11:03:38 +01:00
Reports.pm
Reserves.pm Bug 34972: Remove GetOtherReserves 2024-05-07 15:53:42 +02:00
Ris.pm Bug 33431: Fix remaining cases 2024-03-18 11:03:39 +01:00
RotatingCollections.pm Bug 31735: Avoid re-fetcing objects from database by passing them directly instead of ids to various subroutines 2023-05-12 12:40:21 -03:00
Scheduler.pm
Scrubber.pm Bug 36328: (QA follow-up) Expand tests and reorder elements to clarify differences 2024-04-22 12:39:20 +02:00
Search.pm Bug 35138: Add the ability to manage ES facets 2024-04-30 12:00:56 +02:00
Serials.pm Bug 32392: Fix QA issues 2024-04-29 15:19:31 +02:00
Service.pm
ShelfBrowser.pm
SMS.pm Bug 36051: (QA follow-up): Use yaml_preference 2024-04-12 11:26:12 +02:00
SocialData.pm Bug 33833: Add two FIXMEs to SocialData::get_report 2023-09-05 14:35:35 -03:00
Stats.pm Bug 33608: (QA follow-up) Remove ->insert method 2023-10-25 11:07:59 -03:00
Suggestions.pm Bug 33236: (follow-up) Remove export of NewSuggestion 2023-06-06 10:08:36 -03:00
Tags.pm
Templates.pm Bug 35070: Tidy 2024-01-04 16:51:45 +01:00
TmplToken.pm
TmplTokenType.pm
TTParser.pm
UsageStats.pm Bug 33961: Remove built-in offline circ tool 2023-06-12 16:53:25 -03:00
XISBN.pm
XSLT.pm Bug 33217: Tidy 2023-11-08 17:52:42 -03:00