[Koha-bugs] [Bug 20844] Reset a hold when it is missing after allocation

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Oct 24 03:57:13 CEST 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20844

--- Comment #13 from Alex Buckley <alexbuckley at catalyst.net.nz> ---
Created attachment 81045
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81045&action=edit
Bug 20844: Revert hold when setting an item to lost

If an item is marked as 'Lost' then this patch introduces the following
new functionality:

1. Check if there is a bib-level or item-level hold on the item with the
status of 'W' (waiting). This is an allocated hold which is not yet
checked out to the requesting patron.

1.a. If the hold was originally a bib-level reserve
(reserves.originalholdtype='B') then
do the following:

* Revert the waiting status of the reserve
* Set the reserves.itemnumber=NULL so the hold is reset to a bib-level
hold

1.b. If the hold was originally (and still is) a item-level hold
(reserves.originalholdtype='I') then
display a alert dialog box on the additem.pl interface asking the
librarian to select one of two options:

* Cancel the hold - This deletes the hold altogether
* Retain the hold - This does not change the hold. Therefore the
requester will still have a hold on a lost item

NOTE: Previously an allocated bib-level hold was identical to a item-level hold
in the database.
As the first available item on the bib record had been allocated to the
requester and so an itemnumber had been set in the record in the reserves
table.

However this patch introduces a atomicupdate which adds the new column
'originalholdtype' to the reserves table. This allows us to track if the
reserve was originally a bib level hold and treat it differently when
the allocated item is being marked as 'Lost'

Test plan:
1. Place a bib-level hold on a biblio
2. Check out an item from the biblio to a different patron
3. Query the reserves db table for biblio you placed the bib-level
hold and notice it has no 'itemnumber' or 'status' value
4. Return the item and confirm the hold in the modal box that is loaded
5. Query the reserves db table and notice the itemnumber field is now
filled with the returned item's itemnumber and the status is 'W'
6. Set the item to 'Lost' either by clicking on Edit->Edit items from
the detail.pl page
OR
clicking on the Items tab on the left side of the detail.pl page
7. Notice the waiting item-level hold still exists after the item is
marked as 'lost'

8. Repeat steps 1-7 but this time place an item-level hold on an item in
step 1 and then check that same item out in step 2. Notice in the
repeated step 7 that the hold remains after marking the item as 'Lost'
9. Apply patch and run ./updatedatabase.pl from the koha-shell in the
installer/data/mysql/ directory

9. Repeat steps 1-6 placing an bib-level hold and then query the
database and notice the bib-level hold which was changed to an allocated
waiting item-level hold when the item was returned and the hold
confirmed is now reverted to a bib-level hold again. This is controlled
by the LostBibLevelHoldsRevert syspref.

If this syspref is not enabled then the allocated item-level (originally
bib-level hold) will remain after the item is marked as lost.

10. Repeat 1-6 but this time place an item-level hold on the item.
Notice when you mark the item as 'Lost' a yellow warning box is
displayed asking if you want to 'Retain hold' or 'Cancel hold'. Select
'Retain hold' and notice the item-level hold remains now the item is marked as
lost.

11. Repeat step 10 but choose 'Cancel hold' option and notice the hold
is deleted now.

12. Now enable the new 'LostItemCancelOutstandingTransfers' syspref.
This will now cancel any outstanding transfers on the item when it is
marked as lost.

13. Find a item which is in transfer, i.e. find an item with the text in
the 'Status' field of the table in detail.pl that indicates it is in
transfer

14. Now mark that item as 'Lost' and now notice the transfer is
cancelled

15. Go into koha-shell from the Koha home dir:
sudo koha-shell <instancename>

16. Run the RevertWaitingStatus.t test file:
prove t/db_dependent/Holds/RevertWaitingStatus.t

Sponsored-By: Brimbank Library, Australia

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list