From 86eb5d4614f159336d2e76722bc7d76533db9973 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 11 Aug 2022 17:29:04 +1200 Subject: [PATCH] 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 = <> 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 --- ...callCancellation_branchtransfers.cancellation_reason.pl | 14 ++++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt | 1 + koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt | 2 +- opac/ilsdi.pl | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_30944_-_fix_RecallCancellation_branchtransfers.cancellation_reason.pl diff --git a/installer/data/mysql/atomicupdate/bug_30944_-_fix_RecallCancellation_branchtransfers.cancellation_reason.pl b/installer/data/mysql/atomicupdate/bug_30944_-_fix_RecallCancellation_branchtransfers.cancellation_reason.pl new file mode 100644 index 0000000000..f42487360c --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30944_-_fix_RecallCancellation_branchtransfers.cancellation_reason.pl @@ -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' + }); + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3f524aec6a..f1003f7fa5 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1571,7 +1571,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`), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt index 2f4a573cf8..3fcc9d8ea9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt @@ -29,6 +29,7 @@ [% IF recalls.count %]
+ Select all [% INCLUDE 'recalls.inc' %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt index 5af7fdf14f..86d205ccf9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt @@ -857,7 +857,7 @@
  • HoldItem
  • CancelHold
  • RecallItem (Not supported by Koha)
  • -
  • CancelRecall (Not supported by Koha)
  • +
  • RecallCancellation (Not supported by Koha)
  • Level 4: Robust/domain specific discovery platforms

    diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl index 5b105246fa..ba38727b84 100755 --- a/opac/ilsdi.pl +++ b/opac/ilsdi.pl @@ -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 -- 2.11.0