Bug 36957 - Item in transfer should start floating in its floating library without user clicking the "Cancel transfer"-button
Summary: Item in transfer should start floating in its floating library without user c...
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 23.11
Hardware: All All
: P5 - low enhancement
Assignee: Emmi Takkinen
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-24 12:46 UTC by Piia Semenoff
Modified: 2025-04-16 19:33 UTC (History)
5 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 36957: Add new syspref CancelTransitWhenItemFloats and branchtransfers.cancelation_reason ItemArrivedToFloatBranch (7.63 KB, patch)
2025-04-10 08:39 UTC, Emmi Takkinen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Piia Semenoff 2024-05-24 12:46:36 UTC
When item is in transfer and it is checked in in a library where it could float, a notification/pop-up about transport will appear on the screen. User must end the transfer by clicking “Cancel transfer”-button. Only then will the item end the transport and start floating in the holding library.

Even if the item is in transfer somewhere else (and there are no holds waiting) and it is checked in in a floating library, it should not give the pop-up: “Wrong transfer detected, please return item to…” . Instead it should just start floating without having to click the canceling-button.

Koha asks for transfer cancelation even if we have saved in the AutomaticItemReturn-preference “Don’t automatically transfer items to their home library when they are checked in.”
Comment 1 Emmi Takkinen 2025-04-10 08:39:10 UTC
Created attachment 180757 [details] [review]
Bug 36957: Add new syspref CancelTransitWhenItemFloats and branchtransfers.cancelation_reason ItemArrivedToFloatBranch

When item is in transfer and it is checked in in a library
where it could float, a notification/pop-up about transport
will appear on the screen. User must end the transfer by
clicking “Cancel transfer”-button. Only then will the item
end the transport and start floating in the holding library.

This patch adds new system preference "CancelTransitWhenItemFloats".
If it's enabled and item is checked in in a library where it
can float Koha no longer asks user to cancel transfer. Instead
transfer is automatically cancelled and column
branchtransfers.cancelation_reason is filled with a new value
"ItemArrivedToFloatBranch".

To test:
1. Create a new floating group and add libraries A and B to it.
2. Find an item which is in transit to branch A.
3. Change your library as library B.
4. Attempt to check in item you found.
=> Wrong transfer notification is displayed.
5. Apply this patch, run perl installer/data/mysql/updatedatabase.pl
and restart services.
6. Enable new systempreference "CancelTransitWhenItemFloats".
7. Check in same item you found (or find new one to check in).
=> Notification isn't displayed.
=> Check your database and confirm that trasfer was cancelled with
cancelation_reason as "ItemArrivedToFloatBranch" by running following
query in your database:
select * from branchtransfers where itemnumber = (select itemnumber
from items where barcode = "[barcode of checked in item]");
8. Change your library as library C (that isn't in the same float
group as A and B).
9. Attempt to check in an item in transit to branch A.
=> Wrong transfer notification is displayed.
10 Disable systempreference "CancelTransitWhenItemFloats".
11. Change your libary as library B and attempt to check in an item
in transit to library A.
=> Wrong transfer notification is displayed.

Also prove t/db_dependent/Circulation.t

Sponsored-by: Koha-Suomi Oy
Comment 2 Andrew Fuerste-Henry 2025-04-16 19:33:17 UTC
Emmi, I ran into issues following your test plan, but realized I was making some assumptions about circ rules and system preferences. How do you have Return Policy and CircControlReturnsBranch set as you're testing?