Bug 30944: Fix cancel recalls actions

This patch fixes the 'cancel selected recalls' button on the biblio
details Recalls page, and ensures a correct cancellation reason is
logged when cancelling a recall in transit.

To test:
1) Ensure UseRecalls is enabled and relevant recalls circulation rules
are set
2) Check out Item A to Patron B
3) Log into OPAC as Patron A
4) Search for Item A and place a recall
5) Go back to the staff interface and search for Item A. When viewing
the biblio record, go to the recalls tab.
6) Check the checkbox for your recall, and click the button to cancel
selected recalls.
7) Confirm your recall is successfully removed and you're redirected to
the correct recalls page for this biblio.
8) Go back to the OPAC and place a recall again. This time set the
pickup location to a different library, one that you're not logged in at
9) Back in the staff interface, check in Item A and confirm the recall
and transfer
10) Go to Circulation -> Recalls to pull. Your recall should show here.
Click the button to cancel the recall and revert the transfer
11) Confirm the recall has been cancelled
12) Go to Reports and create a new SQL report with the following SQL:
select * from branchtransfers b join items i on
b.itemnumber=i.itemnumber where i.barcode = <<barcode>>
13) Run the report and paste the barcode of Item A in the field
14) Confirm there are two rows returned - the transfer triggered when
the recall was confirmed, with a reason of 'Recall' and a cancellation
reason of 'RecallCancellation, and the transfer sending the item back
home when the recall was cancelled, with a reason of
'RecallCancellation'.

Sponsored-by: Catalyst IT

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Aleisha Amohia 2022-08-11 17:29:04 +12:00 committed by Tomas Cohen Arazi
parent 7dfa7bcc21
commit ccb4180339
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
5 changed files with 18 additions and 3 deletions

View file

@ -0,0 +1,14 @@
use Modern::Perl;
return {
bug_number => "30944",
description => "Replace branchtransfers.cancellation_reason CancelRecall with RecallCancellation",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
ALTER TABLE branchtransfers MODIFY COLUMN cancellation_reason ENUM('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer','RecallCancellation') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation'
});
},
};

View file

@ -1573,7 +1573,7 @@ CREATE TABLE `branchtransfers` (
`tobranch` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'the branch the transfer was going to',
`comments` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'any comments related to the transfer',
`reason` ENUM('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','Recall','RecallCancellation') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer',
`cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer','CancelRecall') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation',
`cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer','RecallCancellation') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation',
PRIMARY KEY (`branchtransfer_id`),
KEY `frombranch` (`frombranch`),
KEY `tobranch` (`tobranch`),

View file

@ -29,6 +29,7 @@
[% IF recalls.count %]
<form method="post" action="/cgi-bin/koha/recalls/request.pl">
<input type="hidden" name="op" value="cancel_multiple_recalls">
<input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]">
<input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
[% INCLUDE 'recalls.inc' %]
<fieldset class="action">

View file

@ -857,7 +857,7 @@
<li><a href="ilsdi.pl?service=Describe&amp;verb=HoldItem">HoldItem</a></li>
<li><a href="ilsdi.pl?service=Describe&amp;verb=CancelHold">CancelHold</a></li>
<li>RecallItem <em>(Not supported by Koha)</em></li>
<li>CancelRecall <em>(Not supported by Koha)</em></li>
<li>RecallCancellation <em>(Not supported by Koha)</em></li>
</ul>
<h2>Level 4: Robust/domain specific discovery platforms</h2>

View file

@ -74,7 +74,7 @@ my @services = (
'CancelHold',
# 'RecallItem', # Not supported by Koha
# 'CancelRecall', # Not supported by Koha
# 'RecallCancellation', # Not supported by Koha
# Level 4: Robust/domain specific discovery platforms
# 'SearchCourseReserves', # TODO
# 'Explain' # TODO