Koha-clms/t/db_dependent
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 Bug 38343: (QA follow-up) Improve tests and tidy 2024-11-22 10:22:40 +01:00
Auth Bug 36056: Clarify subpermissions AND behavior 2024-03-07 17:35:40 +01:00
AuthoritiesMarc
…
Authority Bug 40119: Unit tests 2025-07-25 14:27:25 +02:00
Biblio Bug 33268: Add tests for context module priority 2025-04-17 14:30:33 +02:00
Budgets
…
Circulation Bug 40331: (follow-up) Adjust t/db_dependent/Circulation/transfers.t 2025-10-10 16:34:06 +02:00
CourseReserves
…
Creators Bug 37720: (follow-up) Adjust tests 2024-10-18 12:07:52 +02:00
Exporter
…
Holds Bug 36923: Remove warnings from Holds/LocalHoldsPriority.t 2024-05-24 15:36:46 +02:00
HoldsQueue Bug 40377: Remove warnings from HoldsQueue/TransportCostOptimizations.t 2025-08-01 15:25:55 +02:00
Items Bug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029 2024-03-07 16:36:46 +01:00
Koha Bug 39985: Set items.onloan when recall adjusts checkout due date 2025-12-04 15:15:09 +01:00
LDAP
…
Labels Bug 37898: Wrap labels tests inside transactions 2024-09-19 12:50:19 +01:00
Letters Bug 17976: Update test to include fines 2024-11-08 12:42:11 +01:00
Members
…
OAI Bug 40265: (try to) prevent OAI/Server.t to fail on slow server 2025-10-31 14:40:38 +00:00
Patron Bug 37392: (follow-up) Limit a borrower not in a group and fix tests 2024-11-01 09:34:39 -03:00
Record Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-14 10:46:31 +01:00
Reports Bug 37784: Do not show forbidden columns in reports dictionary 2025-03-24 17:59:09 +01:00
Reserves Bug 40385: Remove warning from Reserves/CancelExpiredReserves.t 2025-08-01 11:58:20 +02:00
SIP Bug 40915: (RMaint follow-up) Backport adaptation to satisfy xt/find-license-problems.t 2025-11-10 14:52:06 +01:00
Search
…
Serials Bug 38829: Add a test 2025-02-18 19:17:12 +01:00
Template/Plugin Bug 37684: Direct link to expired news are broken 2024-11-07 17:32:38 +01:00
Utils Bug 34913: Adjust C4::Utils::DataTables::VirtualShelves 2024-01-26 15:13:42 +01:00
api/v1 Bug 39408: (QA follow-up) Add unit tests 2025-11-10 15:23:54 +01:00
cronjobs
…
data Bug 39345: 24.11 SQUASH 2025-10-16 07:47:17 +02:00
misc/translator
…
mojo Bug 37286: Add tests for REST authentication through Mojo apps 2025-04-22 23:02:29 +02:00
selenium Bug 40406: Remove warnings from selenium/basic_workflow.t 2025-08-01 15:16:45 +02:00
www Bug 32693: Fix history.t 2024-05-08 18:23:57 +02:00
00-strict.t Bug 36999: Fix 00-strict.t fails to find koha_perl_deps.pl 2024-06-13 13:43:47 +01:00
Accounts.t
…
Acquisition.t Bug 32132: (RM follow-up) Use testbuilder in Acquisitions.t 2024-04-24 10:08:28 +01:00
Amazon.t
…
ArticleRequests.t Bug 36081: (QA follow-up) Resolve IsNotDebit exception in ArticleRequests.t 2025-02-24 20:43:23 +01:00
AudioAlerts.t
…
Auth.t Bug 39746: Fix wrong system preference 'AutoLocation' in test suite 2025-09-29 11:21:34 +02:00
AuthUtils.t
…
Auth_with_cas.t
…
Auth_with_ldap.t Bug 38526: (bug 36822 follow-up): Improve datetime comparison in tests 2024-11-25 13:16:40 +01:00
Auth_with_shibboleth.t Bug 40317: Remove warnings from Auth_with_shibboleth.t output 2025-07-31 14:13:46 +02:00
AuthorisedValues.t Bug 40376: Remove warning from AuthorisedValues.t 2025-08-01 15:28:51 +02:00
AuthoritiesMarc.t Bug 35989: (QA follow-up): Fix QA tests 2024-06-06 15:18:43 +01:00
AuthoritiesMarc_GetTagsLabels.t
…
Barcodes.t Bug 37070: (QA follow-up) Fix qa script issues 2024-10-18 14:26:05 +02:00
Barcodes_ValueBuilder.t
…
Biblio.t Bug 40390: Remove warnings from t/db_dependent/Biblio.t 2025-08-01 14:41:37 +02:00
Biblio_holdsqueue.t
…
Breeding.t
…
Breeding_Auth.t
…
Budgets.t
…
Cache.t
…
Calendar.t
…
Charset.t
…
Circulation.t Bug 40969: Mock the RenewalPeriodBase preference correctly 2025-11-10 16:21:25 +01:00
Circulation_holdsqueue.t Bug 40403: Remove warning from Circulation_holdsqueue.t 2025-08-01 11:45:38 +02:00
ClassSources.t Bug 37870: Run tests from ClassSources.t within transactions 2024-09-12 13:52:35 +02:00
Clubs.t
…
Context.t
…
Contract.t
…
CourseReserves.t Bug 36687: (RM follow-up) Fix unit tests 2024-05-09 09:22:00 +01:00
DecreaseLoanHighHolds.t
…
Filter_MARC_ViewPolicy.t
…
Fines.t
…
FrameworkPlugin.t Bug 37146: Add tests 2024-08-01 17:26:37 +02:00
Heading.t
…
Heading_MARC21.t
…
Hold.t Bug 34032: (QA follow-up) Tidy code 2024-04-29 09:35:38 +02:00
Holds.t Bug 40350: Remove warnings from t/db_dependent/Holds.t 2025-08-01 11:29:50 +02:00
HoldsQueue.t Bug 32565: (follow-up) Tidy 2024-04-30 14:32:07 +02:00
Holidays.t
…
ILSDI_Services.t Bug 41012: (bug 40622 follow-up) Clear the MSS cache 2025-11-10 15:05:40 +01:00
ImportBatch.t
…
ImportExportFramework.t
…
Installer.t
…
Items.t Bug 14907: Unit tests 2025-04-22 23:01:31 +02:00
Koha.t Bug 40277: Add a test 2025-07-28 11:03:56 +02:00
Koha_Database.t Bug 36367: Remove schema_stack 2024-06-14 11:17:18 +01:00
Koha_Elasticsearch.t Bug 35138: Fix Koha_Elasticsearch.t 2024-04-30 12:00:59 +02:00
Koha_ExternalContent_OverDrive.t
…
Koha_MetadataRecord_Authority.t
…
Koha_Misc_Files.t
…
Languages.t Bug 38903: Fix theme in some getTranslatedLanguages calls 2025-09-29 09:37:15 +02:00
Letters.t Bug 40410: Remove warning from Letters. 2025-08-01 15:12:32 +02:00
LibraryGroups.t
…
Linker_Default.t Bug 35125: Respect LinkerConsiderThesaurus in update_cache 2024-07-01 18:55:42 +02:00
Linker_FirstMatch.t
…
Log.t Bug 37522: Unit tests 2024-10-29 16:14:44 +01:00
MarcModificationTemplates.t Bug 32950: Remove unecessary DELETE 2025-10-31 15:50:32 +00:00
Matcher.t
…
Members.t Bug 37845: Remove C4::Members::DeleteExpiredOpacRegistrations 2024-10-21 15:10:31 +02:00
Message.t Bug 37757: (follow-up) Adjust existing tests 2024-09-13 16:16:01 -03:00
MungeMarcPrice.t
…
Overdues.t Bug 40409: Remove warnings from t/db_dependent/Overdues.t 2025-08-01 15:15:04 +02:00
Passwordrecovery.t
…
PatronLists.t Bug 32730: Add Patron Lists tab to patron details and circulation pages 2023-11-01 17:23:09 -03:00
Patroncards.t Bug 37898: Wrap Patroncards.t inside a transaction 2024-09-19 12:50:20 +01:00
Patrons.t Bug 36508: Unit tests 2024-04-30 14:32:04 +02:00
Prices.t
…
Record.t Bug 14670: Fix tests and import 2024-11-14 10:46:37 +01:00
RecordProcessor_EmbedSeeFromHeadings.t
…
Reports.t
…
Reserves.t Bug 39747: Fix wrong system preference 'DefaultHoldExpirationUnitOfTime' in test suite 2025-09-29 11:23:57 +02:00
RotatingCollections.t
…
Search.t Bug 36924: Remove warning "Value not allowed for auto_incr itemnumber in Item" 2024-05-23 17:51:15 +02:00
Serials.t Bug 37476: Unit tests 2024-07-26 14:50:45 +01:00
Serials_2.t
…
Service.t
…
ShelfBrowser.t
…
Sitemapper.t Bug 36977: (QA follow-up) Adapt tests 2024-10-30 14:34:52 +01:00
SocialData.t
…
StockRotationItems.t
…
StockRotationRotas.t
…
StockRotationStages.t Bug 39717: Use numeric comparison for stock rotation stages 2025-09-29 10:06:37 +02:00
SuggestionEngine_ExplodedTerms.t
…
Suggestions.t Bug 38235: Unit tests 2024-11-12 17:50:18 +01:00
TablesSettings.t Bug 33484: Fix TablesSettings.t 2024-10-28 17:10:24 +01:00
Tags.t
…
Templates.t Bug 38467: (follow-up) Fix test 2025-02-18 19:17:19 +01:00
TestBuilder.t
…
Upload.t
…
UsageStats.t Bug 38104: Always update when hea cronjob is run 2025-04-22 23:02:27 +02:00
Virtualshelves.t Bug 39427: (follow-up) Adjust number of tests 2025-09-19 14:57:12 +02:00
XISBN.t
…
XSLT.t Bug 38100: Unit tests 2024-11-08 11:23:50 +01:00
check_kohastructure.t
…
check_sysprefs.t Bug 29948: Adjust sysprefs.sql 2024-05-13 16:24:17 +02:00
db_structure.t
…
rollingloans.t
…
sysprefs.t Bug 36793: Unit test 2024-05-17 10:36:34 +02:00
yaml.t
…
zebra_config.pl
…