Bug 23010 - If an item is checked out or in transit it should not be able to be marked withdrawn
Summary: If an item is checked out or in transit it should not be able to be marked wi...
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-29 14:25 UTC by Jessie Zairo
Modified: 2025-02-11 17:39 UTC (History)
11 users (show)

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


Attachments
Bug 23010: Add system preference PreventWithdrawingItemsStatus (4.51 KB, patch)
2025-01-08 15:12 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 23010: Add ability to block withdrawning of items with certain statuses (4.14 KB, patch)
2025-01-28 23:05 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 23010: Handle error in updateitem.pl and template (3.71 KB, patch)
2025-01-31 19:02 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 23010: Add unit tests (2.65 KB, patch)
2025-01-31 21:20 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 23010: Add system preference PreventWithdrawingItemsStatus (6.15 KB, patch)
2025-01-31 22:24 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 23010: Add ability to block withdrawning of items with certain statuses (4.14 KB, patch)
2025-01-31 22:24 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 23010: Handle error in updateitem.pl and template (3.71 KB, patch)
2025-01-31 22:24 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 23010: Add unit tests (2.65 KB, patch)
2025-01-31 22:24 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 23010: Add system preference PreventWithdrawingItemsStatus (6.19 KB, patch)
2025-02-02 17:29 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 23010: Add ability to block withdrawning of items with certain statuses (4.19 KB, patch)
2025-02-02 17:29 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 23010: Handle error in updateitem.pl and template (3.76 KB, patch)
2025-02-02 17:29 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 23010: Add unit tests (2.70 KB, patch)
2025-02-02 17:29 UTC, Roman Dolny
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jessie Zairo 2019-05-29 14:25:57 UTC
Currently an item can be marked withdrawn if it is checked out to a patron or in transit from one branch to another. This causes confusion for staff checking an item back in or receiving the transfer. If an item is checked out or in transit it should not be able to be marked withdrawn.
Comment 1 Felicity Brown 2022-09-13 17:54:25 UTC
Conversely, it would be nice to have the option to have items check-in automatically (be removed from a customer's account) when a staff member marks them as withdrawn, so that they don't linger forever in both statuses.
Comment 2 Rebecca Coert 2022-09-27 16:25:24 UTC
+! agreed - If an item is checked out or in transit, it should not be able to be marked withdrawn.
Comment 3 Katie Bliss 2023-01-30 16:32:00 UTC
Also agree! This is a major cause for confusion with our staff as well. Preventing items that aren't checked in from being withdrawn would be a huge help.
Comment 4 Katrin Fischer 2023-10-28 15:08:13 UTC
Automatic return might not be very forgiving if you ended up picking a wrong item. Maybe easier to warn/deactivate and have the staff person return it if it's required.
Comment 5 lthorrat@cuyahogalibrary.org 2023-12-29 16:39:07 UTC
I would like a message to pop up when you try to check in a withdrawn item that notifies staff that the item is withdrawn.  Presently, it returns the message that the item was not checked out even on items that are both checked out and withdrawn
Comment 6 Lucas Gass (lukeg) 2025-01-08 15:12:58 UTC
Created attachment 176241 [details] [review]
Bug 23010: Add system preference PreventWithdrawingItemsStatus
Comment 7 Andrew Fuerste-Henry 2025-01-15 15:31:12 UTC
(In reply to Felicity Brown from comment #1)
> Conversely, it would be nice to have the option to have items check-in
> automatically (be removed from a customer's account) when a staff member
> marks them as withdrawn, so that they don't linger forever in both statuses.

This is a cool idea and I encourage you to file it as a separate bug!
Comment 8 Lucas Gass (lukeg) 2025-01-28 23:05:10 UTC
Created attachment 177299 [details] [review]
Bug 23010: Add ability to block withdrawning of items with certain statuses
Comment 9 Lucas Gass (lukeg) 2025-01-31 19:02:59 UTC
Created attachment 177402 [details] [review]
Bug 23010: Handle error in updateitem.pl and template
Comment 10 Lucas Gass (lukeg) 2025-01-31 21:20:14 UTC
Created attachment 177413 [details] [review]
Bug 23010: Add unit tests
Comment 11 Lucas Gass (lukeg) 2025-01-31 22:24:51 UTC
Created attachment 177434 [details] [review]
Bug 23010: Add system preference PreventWithdrawingItemsStatus

To test:

1. APPLY PATCH, updatedatabase, and restart_all
2. Search for the system preference, PreventWithDrawingItemsStatus
3. Select both in transit and checked out, then save
4. Find an item and put it in transit.
5. Now from the item detail page, go to manage items > edit item
6. Using the item that was put in transit, attempt to change the status to withdrawn.
7. You should see an error at the top of the page 'In transit item cannot be withdrawn.' Make sure the item did not get marked as withdrawn.
8. Using a different item, do a checkout
9. Now from the item detail page, go to manage items > edit item
10. Using the checked out item, attempt to change the status to withdrawn.
11. vYou should see an error at the top of the page 'Onloan item cannot be withdrawn.' Make sure the item did not get marked as withdrawn.

12. Now, using the in transit item, go to the items tab. ( catalogue/moredetail.pl?biblionumber=x )
13. Under Statuses, attempt to withdraw the item.
14. You should see an error near the top of the page "Cannot withdraw item in transit".
15. Now, using the checked out item, go to the items tab. ( catalogue/moredetail.pl?biblionumber=144 )
16. Under Statuses, attempt to withdraw the item.
17. You should see an error near the top of the page "Cannot withdraw checked out item.".

18. Using both the in-transit and checked out item, attempt to modify the status through batchMod.
19. Ensure that the items are not being updated to withdrawn.

20. Turn off PreventWithDrawingItemsStatus system preferece.
21. Going through each of the steps again, except this time your items should successfully withdraw.

prove t/db_dependent/Koha/Item.t
Comment 12 Lucas Gass (lukeg) 2025-01-31 22:24:54 UTC
Created attachment 177435 [details] [review]
Bug 23010: Add ability to block withdrawning of items with certain statuses
Comment 13 Lucas Gass (lukeg) 2025-01-31 22:24:57 UTC
Created attachment 177436 [details] [review]
Bug 23010: Handle error in updateitem.pl and template
Comment 14 Lucas Gass (lukeg) 2025-01-31 22:24:59 UTC
Created attachment 177437 [details] [review]
Bug 23010: Add unit tests
Comment 15 Roman Dolny 2025-02-02 17:29:02 UTC
Created attachment 177451 [details] [review]
Bug 23010: Add system preference PreventWithdrawingItemsStatus

To test:

1. APPLY PATCH, updatedatabase, and restart_all
2. Search for the system preference, PreventWithDrawingItemsStatus
3. Select both in transit and checked out, then save
4. Find an item and put it in transit.
5. Now from the item detail page, go to manage items > edit item
6. Using the item that was put in transit, attempt to change the status to withdrawn.
7. You should see an error at the top of the page 'In transit item cannot be withdrawn.' Make sure the item did not get marked as withdrawn.
8. Using a different item, do a checkout
9. Now from the item detail page, go to manage items > edit item
10. Using the checked out item, attempt to change the status to withdrawn.
11. vYou should see an error at the top of the page 'Onloan item cannot be withdrawn.' Make sure the item did not get marked as withdrawn.

12. Now, using the in transit item, go to the items tab. ( catalogue/moredetail.pl?biblionumber=x )
13. Under Statuses, attempt to withdraw the item.
14. You should see an error near the top of the page "Cannot withdraw item in transit".
15. Now, using the checked out item, go to the items tab. ( catalogue/moredetail.pl?biblionumber=144 )
16. Under Statuses, attempt to withdraw the item.
17. You should see an error near the top of the page "Cannot withdraw checked out item.".

18. Using both the in-transit and checked out item, attempt to modify the status through batchMod.
19. Ensure that the items are not being updated to withdrawn.

20. Turn off PreventWithDrawingItemsStatus system preferece.
21. Going through each of the steps again, except this time your items should successfully withdraw.

prove t/db_dependent/Koha/Item.t

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 16 Roman Dolny 2025-02-02 17:29:05 UTC
Created attachment 177452 [details] [review]
Bug 23010: Add ability to block withdrawning of items with certain statuses

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 17 Roman Dolny 2025-02-02 17:29:08 UTC
Created attachment 177453 [details] [review]
Bug 23010: Handle error in updateitem.pl and template

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 18 Roman Dolny 2025-02-02 17:29:11 UTC
Created attachment 177454 [details] [review]
Bug 23010: Add unit tests

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 19 Roman Dolny 2025-02-02 17:40:44 UTC
SO, it works as described, no possibility to set withdraw when PreventWithDrawingItemsStatus is active (Items tab, edit item, batchMod).

What about clearing withdraw status when PreventWithDrawingItemsStatus is active -- still possible (Items tab, edit item), not possible (batchMod)?