Bug 40393 - Stock Rotation: Items returned to unexpected branch after ownership change do not trigger correct transfer
Summary: Stock Rotation: Items returned to unexpected branch after ownership change do...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-15 14:24 UTC by Michael Adamyk
Modified: 2025-07-15 14:24 UTC (History)
2 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

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Adamyk 2025-07-15 14:24:12 UTC
When the stock rotation cronjob updates an item's owning library and creates a pending transfer, Koha doesn't properly handle cases where the item is checked out or waiting on a holdshelf when the cron runs to change the branch, and then the item is checked in at a different branch than the one listed in branchtransfers.frombranch. 

When checked in at an unexpected branch, Koha doesn't prompt a transfer at all, which leaves an open transfer request that staff are unaware of. If the item is checked in a second time, Koha will properly prompt the transfer. 

Steps to reproduce:
1. Set up stock rotation and add a test item to the rotation schedule.
2. Check the item out before the cronjob runs to change the item's branch.
3. Run the stock rotation cronjob to move all items to the next branch. 
4. Check in the item at a different branch (neither the old or new owning branch).
5. Note that Koha does not prompt a transfer on the item.
6. The item should have a pending transfer that was not triggered.
7. Check the item in again to trigger the transfer. 

Note: Is it possible this issue relates or overlaps with the following bugs? 
* Bug 40331
* Bug 36658