Koha-clms/t
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
..
Acquisition
…
Biblio
…
Budgets
…
Circulation Bug 37155: Refactor GetAgeRestrictions 2024-07-01 18:55:50 +02:00
External
…
Koha Bug 35830: Add merge_borrowers subpermission 2025-12-04 10:34:54 +01:00
Number Bug 37511: Unit tests 2024-10-30 11:57:27 +01:00
SIP Bug 40675: Add unit tests for SIP line ending normalization 2025-10-16 11:52:21 +02:00
Search Bug 34969: Remove unneeded module from buildQuery.t 2023-10-04 09:15:42 -04:00
Serials Bug 32392: Tests for changes in C4::Serials::GetNextSeq 2024-04-29 15:19:30 +02:00
Template Bug 33030: Add unit tests 2023-07-14 16:52:06 -03:00
Test Bug 40404: Remove diag from t/Test/Mock/Logger.t 2025-08-01 15:22:48 +02:00
cypress Bug 41039: Add cypress tests 2025-12-04 11:07:09 +01:00
data Bug 41032: Fix Open Fifth missing in plugin repos config 2025-12-04 14:35:24 +01:00
db_dependent Bug 39985: Set items.onloan when recall adjusts checkout due date 2025-12-04 15:15:09 +01:00
edi_testfiles Bug 38423: Add unit tests 2025-04-17 14:30:35 +02:00
etc
…
lib Bug 40765: Prevent acquisition tests to fail if order.quantity = 0 2025-10-16 07:55:14 +02:00
mock_templates/intranet-tmpl/prog Bug 36640: Remove jEditable 2024-11-14 14:19:37 +01:00
00-check-atomic-updates.t Bug 31479: Option to skip t/00-check-atomic-updates.t when building custom packages 2023-05-10 15:26:20 -03:00
00-load.t
…
00-merge-conflict-markers.t
…
00-testcritic.t Bug 34911: Test files from HEAD instead of 'master' 2023-10-04 09:15:35 -04:00
00-valid-xml.t
…
Auth.t
…
AuthoritiesMarc_MARC21.t Bug 31023: Unit tests 2022-09-07 13:52:35 -07:00
AuthoritiesMarc_UNIMARC.t
…
Barcodes_EAN13.t
…
Barcodes_annual.t
…
Barcodes_hbyymmincr.t
…
Barcodes_incremental.t
…
Biblio.t Bug 37380: Replace uses of GetMarcControlnumber for get_control_number() 2024-09-16 10:41:05 +02:00
Biblio2.t
…
Budgets.t
…
Charset.t
…
Circulation_barcodedecode.t Bug 30409: (QA follow-up) Avoid uninitialized variable warnings 2022-06-14 08:26:58 -03:00
ClassSortRoutine.t
…
ClassSortRoutine_Dewey.t
…
ClassSortRoutine_Generic.t
…
ClassSortRoutine_LCC.t
…
ClassSource.t
…
Context.t Bug 36081: Use multivalue_preference 2025-02-24 20:43:20 +01:00
Contract.t
…
CookieManager.t Bug 31250: (QA follow-up) The future will be easier 2022-09-12 15:34:11 -03:00
Creators.t
…
DateUtils.t Bug 36432: Remove circular dependency from Koha::Object 2024-04-04 15:24:32 +02:00
EdiInvoice.t
…
Edifact.t Bug 35398: Add unit test for extraction of library_rotation_plan 2024-03-07 15:02:46 +01:00
Ediorder.t Bug 31134: Mock EdifactLSQ for t/Edifact.t 2022-07-18 10:20:44 -03:00
Ediordrsp.t
…
Form_MessagingPreferences.t Bug 34776: Add unit tests for sub restore_form_values 2025-07-28 10:22:07 +02:00
HtmlTags.t
…
ImportBatch.t Bug 18772: Remove warnings from t/ImportBatch.t 2025-08-01 15:50:08 +02:00
Installer_PerlModules.t Bug 30731: Unit tests 2022-06-01 16:15:25 -03:00
ItemCirculationAlertPreference.t
…
Koha_MetadataRecord.t Bug 33749: Use TrimFields instead of stripWhitespaceChars 2023-11-03 12:08:06 -03:00
Koha_SearchEngine_Elasticsearch_Browse.t
…
Koha_Template_Plugin_HtmlId.t
…
Koha_Template_Plugin_Koha.t Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed 2022-09-07 13:55:37 -07:00
Koha_Util_FrameworkPlugin.t
…
Koha_Util_MARC.t
…
Koha_XSLT_HTTPS.t Bug 12758: Introduce Koha::XSLT::HTTPS 2022-11-09 09:52:17 -03:00
Labels.t Bug 40388: Remove warning from t/Labels.t 2025-08-01 14:29:57 +02:00
Labels_split_Regex.t
…
Labels_split_ccn.t
…
Labels_split_ddcn.t
…
Labels_split_lccn.t
…
Languages.t Bug 38630: (QA follow-up) Two typos 2025-09-29 09:34:51 +02:00
Logger.t Bug 35907: Add ability to log all custom report runs with or without query 2024-05-10 16:45:45 +02:00
Makefile.t Bug 39304: Make sure git commands return something 2025-06-19 12:27:18 +02:00
Members_Messaging.t
…
OpenLibrarySearch.t
…
Output.t Bug 30524: Unit tests 2023-08-07 20:59:59 -03:00
Output_JSONStream.t
…
Patroncards.t
…
Patroncards_Batch.t
…
Patroncards_Lib.t
…
Patroncards_Patroncard.t
…
Patroncards_Profile.t
…
Patroncards_Template.t
…
RecordProcessor.t Bug 40128: Unit tests 2025-07-31 16:18:10 +02:00
Ris.t
…
SMS.t Bug 36307: SMS::Send driver errors are not captured and stored 2024-04-05 17:39:46 +02:00
Scheduler.t
…
Scrubber.t Bug 40079: (follow-up) Improve test coverage and fix undef handling 2025-07-25 16:49:49 +02:00
Search.t Bug 34968: Remove unneeded module from Search.t 2023-10-04 09:32:46 -04:00
Search_PazPar2.t
…
SimpleMARC.t Bug 36515: (QA follow-up) Tidy code 2024-08-02 19:00:05 +02:00
SuggestionEngine.t
…
SuggestionEngine_AuthorityFile.t Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t 2023-10-04 09:15:41 -04:00
TmplToken.t
…
Token.t Bug 36367: Fix test t/Token.t 2024-06-14 11:17:19 +01:00
template_filters.t Bug 38872: Add a test 2025-04-22 23:02:08 +02:00
timezones.t
…