Koha-clms/t/db_dependent/Koha
Aleisha Amohia 3f9187478e
Bug 39985: Set items.onloan when recall adjusts checkout due date
This enhancement ensures the due date stored in items.onloan is changed when a recall causes a checkout due date to change.

To test:

1. Enable UseRecalls syspref and set corresponding circulation rules:
    - Recalls allowed
    - Recalls per record
    - On shelf recalls allowed - set to "If any unavailable"
    - Recall due date interval - set to 1
    - Recall pickup period
2. Check out an item to a patron (Patron A)
  2a. Make sure this patron has a primary email address set
  2b. Check the patron's messaging preferences - make sure this patron has the 'Email' checkbox checked for the 'Return recalled item' notice
3. Go to Tools -> Notices & slips and find the RETURN_RECALLED_ITEM notice. In the Email notice, change "[% checkout.date_due | $KohaDates %]" to "[% item.onloan | $KohaDates %]" and Save.
4. Log into the OPAC as another patron
5. Search for the item checked out in step 2, and place a recall on that item
6. Search for that item in the staff interface
=> Note that the item status says, "Checked out to <patron>: due <tomorrow>"
7. Create the following SQL report in the reports module, using the barcode of the item that was recalled:
SELECT onloan FROM items WHERE barcode='xxxxxxxxx'
8. Run the report
=> The onloan value is still set to the item's original due date, not the updated due date of tomorrow
9. Go to Patron A's account again and view their Notices tab. Click on the 'Notification to return a recalled item'
=> The original due date is used in the notice.
10. Apply the patch and restart services
11. Reset to run the tests again:
    - Check in the item, but do not confirm the recall in the pop-up
    - Go to the biblio detail page and cancel the recall
12. Repeat steps 2 to 5.
13. Run your report again (step 8)
=> The onloan value should now show the updated due date of tomorrow
14. View Patron A's latest 'Notification to return a recalled item' notice (step 9)
=> The updated due date should be used in the notice.
15. Confirm tests pass
    - t/db_dependent/Koha/Recalls.t

Sponsored-by: Auckland University of Technology
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 95f2639d64)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7c8dbf75ec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 15:15:09 +01:00
..
Account Bug 33641: (follow-up) Fix unit tests 2024-11-15 14:02:20 +01:00
Acquisition Bug 39826: UTF8-decode vendor interface's password on display 2025-09-29 11:51:09 +02:00
Auth Bug 40019: Remove warnings from Koha/Auth/Client.t 2025-07-25 13:49:55 +02:00
BackgroundJob Bug 37526: (QA follow-up) Tidy 2024-09-27 18:00:43 +02:00
BackgroundJobs Bug 39345: 24.11 SQUASH 2025-10-16 07:47:17 +02:00
Biblio Bug 28478: Add get_opac_suppression extractor 2025-02-18 19:17:20 +01:00
Cash
…
Charges
…
Checkouts
…
CirculationRules
…
Club
…
Config
…
Database
…
ERM Bug 39345: 24.11 SQUASH 2025-10-16 07:47:17 +02:00
Edifact Bug 30070: Add unit tests 2024-01-17 11:38:54 +01:00
Filter
…
ILL Bug 40171: Add tests 2025-10-31 15:06:00 +00:00
Import
…
Item
…
Items
…
Library
…
Notice Bug 36815: Unit tests 2024-06-27 14:04:51 +02:00
OAI/Server Bug 39857: Regression tests 2025-05-17 21:05:56 +02:00
Object/Mixin Bug 38528: (QA follow-up) Add tests for set_additional_fields with marcfield_mode = 'get' 2025-08-06 09:57:01 +00:00
Objects Bug 37389: (QA follow-up) Tidy 2024-08-02 18:59:55 +02:00
Old Bug 33284: (follow-up) Fix unit tests 2025-08-04 10:13:04 +02:00
Patron Bug 40429: Remove warnings from Koha/Patron/Modifications.t 2025-08-01 15:08:51 +02:00
Patrons Bug 40380: Remove warnings from Patrons/Import.t - Argument "" isn't numeric in numeric eq (==) 2025-08-01 11:48:26 +02:00
Plugins Bug 36433: (follow-up) Include required library 2025-08-04 12:27:01 +02:00
Policy
…
Preservation
…
REST Bug 28907: Add Koha::REST::Plugin::Auth::PublicRoutes 2025-02-18 19:17:17 +01:00
SMTP
…
SearchEngine Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat 2025-10-03 14:35:53 +02:00
Subscription
…
Tags
…
Template/Plugin Bug 40018: Remove warnings from Koha/Template/Plugin/Koha.t 2025-07-25 13:54:04 +02:00
Ticket Bug 35657: Unit tests for relation accessor additions 2024-05-02 15:03:36 +02:00
UI/Form/Builder Bug 40003: Add a test 2025-07-25 14:00:41 +02:00
XSLT
…
Z3950Responder
…
Account.t
…
ActionLogs.t
…
AdditionalContents.t Bug 40020: Remove warnings from Koha/AdditionalContents.t 2025-07-25 13:49:01 +02:00
AdditionalField.t
…
ApiKey.t
…
ArticleRequest.t Bug 36081: Fix some failing tests 2025-02-24 20:43:23 +01:00
ArticleRequests.t
…
Authorities.t Bug 30047: (follow-up) Fix failing tests 2024-05-13 16:24:18 +02:00
BackgroundJob.t Bug 34070: Add tests 2025-08-04 10:29:32 +02:00
BackgroundJobs.t Revert "Bug 36217: Fix background jobs page's include_last_hour filter" 2024-10-18 14:26:01 +02:00
Biblio.t Bug 31460: Merge item groups when merging records 2025-10-16 10:31:20 +02:00
BiblioFrameworks.t
…
Biblios.t
…
Booking.t Bug 40374: Remove warnings from Koha/Booking.t 2025-08-01 15:29:59 +02:00
Bookings.t Bug 38175: (QA follow-up) Unit test for filter_by_active change 2024-10-24 18:27:25 +02:00
Checkout.t Bug 33284: (follow-up) Fix unit tests 2025-08-04 10:13:04 +02:00
Checkouts.t Bug 33641: (follow-up) Fix unit tests 2024-11-15 14:02:20 +01:00
CirculationRules.t
…
Cities.t
…
ClassSortRules.t
…
ClassSources.t
…
ClassSplitRules.t
…
Course.t Bug 28762: Add test for new 'instructors' accessor 2024-07-23 16:04:06 +01:00
Courses.t Bug 36535: (bug 33568 follow-up) Add missing tests 2024-04-26 14:14:48 +02:00
CoverImages.t
…
CsvProfiles.t
…
CurbsidePickups.t
…
Database.t Bug 36026: Use only configured TLS options for database connection 2024-11-11 15:35:36 +01:00
Desks.t
…
EDI.t Bug 40765: Fix EDI.t 2025-10-16 07:55:14 +02:00
Encryption.t
…
Hold.t Bug 40542: Add cancellation_reason to Koha::Hold->strings_map 2025-09-19 15:01:53 +02:00
Holds.t Bug 29087: (QA follow-up): Fix QA tests 2024-07-22 07:36:38 +01:00
Installer.t Bug 40437: Remove warning from Koha/Installer.t 2025-08-01 15:04:53 +02:00
Item.t Bug 41044: Add a failing test 2025-12-02 11:27:49 +01:00
ItemTypes.t
…
Items.t Bug 41298: Fix filtering items by in transit 2025-12-04 15:08:47 +01:00
KeyboardShortcuts.t
…
Libraries.t
…
Library.t Bug 36480: Add Koha::Library->desks 2024-04-26 18:06:09 +02:00
MarcOrder.t Bug 39752: (QA follow-up) Unit test 2025-09-29 11:35:15 +02:00
MarcSubfieldStructures.t
…
Notice_Util.t
…
Notices.t Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail 2024-10-24 10:45:38 +02:00
OAIHarvester.t Bug 35659: (QA follow-up) Fix t/db_dependent/Koha/OAIHarvester.t 2024-10-29 16:14:45 +01:00
OAIServers.t Bug 35659: (more QA follow-ups) 2024-10-28 14:01:29 +01:00
Object.t Bug 38273: Make sure same object is returned 2024-10-29 16:14:34 +01:00
Objects.t Bug 37510: Fix Objects.t and remove FIXME 2024-08-19 14:33:37 +02:00
Old.t
…
Patron.t Bug 40608: (QA follow-up) Delete notice in test, adjust about.tt 2025-09-26 16:25:50 +02:00
Patron_generate_userid.t
…
Patrons.t Bug 41094: Improve test of search_anonymize_candidates/account_locked 2025-12-04 11:37:46 +01:00
Pseudonymization.t Bug 39652: Rename new_from_statistic 2025-09-29 10:00:07 +02:00
PseudonymizedTransaction.t Bug 39652: Rename new_from_statistic 2025-09-29 10:00:07 +02:00
Quotes.t
…
Ratings.t
…
Recall.t Bug 23781: Tests for Recalls messaging preferences 2024-07-23 16:38:04 +01:00
Recalls.t Bug 39985: Set items.onloan when recall adjusts checkout due date 2025-12-04 15:15:09 +01:00
RecordSource.t Bug 37513: Add Koha::RecordSource->usage_count 2024-08-27 12:14:24 +02:00
Reports.t Bug 32413: Fix repeated param names for JSON report 2024-10-30 07:47:48 +01:00
Reviews.t Bug 37392: (follow-up) Limit a borrower not in a group and fix tests 2024-11-01 09:34:39 -03:00
SMS_Providers.t
…
SearchField.t Bug 20388: (QA follow-up) Tidy 2024-04-16 17:59:47 +02:00
SearchFilters.t Bug 39020: Add tests 2025-10-03 15:52:32 +02:00
Session.t Bug 39214: Mock preferences in t/db_dependent/Koha/Session.t for subtest 'test session driver' 2025-08-06 15:07:37 +00:00
SharedContent.t
…
Statistic.t Bug 37182: Regression tests 2024-06-27 11:50:02 +02:00
Statistics.t
…
Subscription.t Bug 38011: (QA follow-up) Additional unit tests 2024-11-11 17:43:07 +01:00
Suggestion.t
…
Suggestions.t Bug 36122: Update unit test 2024-05-02 15:03:33 +02:00
Tags.t
…
Ticket.t Bug 36758: (QA follow-up) Tidy Ticket.t 2024-08-09 18:44:53 +02:00
Virtualshelf.t Bug 30955: (QA follow-up) Reduce database hits and clarify notice 2024-10-24 16:55:58 +02:00
Virtualshelves.t
…
Z3950Servers.t
…