Bug 41298 - Filtering holdings table with status In transit considers every item ever transferred to be "In transit"
Summary: Filtering holdings table with status In transit considers every item ever tra...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 37334
Blocks:
  Show dependency treegraph
 
Reported: 2025-11-25 10:57 UTC by Anneli Österman
Modified: 2025-11-25 21:00 UTC (History)
4 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41298: Fix filtering items by in transit (6.06 KB, patch)
2025-11-25 13:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41298: Fix filtering items by in transit (6.20 KB, patch)
2025-11-25 13:25 UTC, OpenFifth Sandboxes
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Anneli Österman 2025-11-25 10:57:42 UTC
Bug 37334 reinstated to ability to filter holdings table with status. We noticed that filtering holdings table with status "In transit" shows every item that has been transferred even once. Meaning if there is even one row mentioning it's itemnumber in branchtransfers it is considered as "In transit". The transfers does not have to be currently active when it is considered "In transit". This also causes the "Available" status not to work properly because they are often considered as "In transit" (at least in our large consortium items transfer alot between branches and it is quite rare that item has never been transferred in it's lifetime)

How to test:
1. Transfer item 1 from branch A to branch B
2. Receive/Fullfill the transfer in branch B - Item is now "Available"
3. Go to items record and filter holdings table with status In transit
4. Notice that item 1 is shown even when it is actually "Available"
5. Filter holdings table with status "Available" and notice that item 1 is not shown.

I have tested this in version 25.05.03 and in Open Fifth's sandbox and it happens in both of them.
Comment 1 Jonathan Druart 2025-11-25 13:12:26 UTC
Created attachment 189924 [details] [review]
Bug 41298: Fix filtering items by in transit

The filtering condition was not correct, the presence of a line in
the transfer table is not enough to now if the item is in transit.
Here we filter reusing the same conditions as
Koha::Item::Transfer->in_transit

Test plan:
Have at least 2 items for a given bibliographic record
Transfer item 1
Transfer item 2
Receive/Fullfill the transfer for item 1

Item 1 is now available and item 2 is in transit

Go to items record and filter holdings table with status "In transit"
=> Only item 2 is displayed

Filter holdings table with status "Available"
=> Only item 1 is displayed
Comment 2 OpenFifth Sandboxes 2025-11-25 13:25:30 UTC
Created attachment 189925 [details] [review]
Bug 41298: Fix filtering items by in transit

The filtering condition was not correct, the presence of a line in
the transfer table is not enough to now if the item is in transit.
Here we filter reusing the same conditions as
Koha::Item::Transfer->in_transit

Test plan:
Have at least 2 items for a given bibliographic record
Transfer item 1
Transfer item 2
Receive/Fullfill the transfer for item 1

Item 1 is now available and item 2 is in transit

Go to items record and filter holdings table with status "In transit"
=> Only item 2 is displayed

Filter holdings table with status "Available"
=> Only item 1 is displayed

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>