From b7ef935853a6d578e39f54ce6af59d0b432106ce Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 27 Apr 2022 02:41:12 +0000 Subject: [PATCH] Bug 30600: Fix recall reasons for branch transfers When a recall triggers a branch transfer, the reason for the transfer is 'Recall'. When a transfer is cancelled that was triggered by a recall, it still uses the default 'Manual' reason, so we don't need the 'CancelRecall' cancellation reason that was added by Bug 19532. This patch removes 'Recall' and 'CancelRecall' from branchtransfers.cancellation_reason, and removes 'CancelRecall' from branchtransfers.reason. Sponsored-by: Catalyst IT --- .../bug_30600_-_fix_branchtransfers_recalls_enum.pl | 13 +++++++++++++ installer/data/mysql/kohastructure.sql | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_30600_-_fix_branchtransfers_recalls_enum.pl diff --git a/installer/data/mysql/atomicupdate/bug_30600_-_fix_branchtransfers_recalls_enum.pl b/installer/data/mysql/atomicupdate/bug_30600_-_fix_branchtransfers_recalls_enum.pl new file mode 100644 index 0000000000..d40ee8a1a0 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30600_-_fix_branchtransfers_recalls_enum.pl @@ -0,0 +1,13 @@ +use Modern::Perl; + +return { + bug_number => "30600", + description => "Recall enum option should only exist for branchtransfers.reason, no CancelRecall", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{ALTER TABLE branchtransfers MODIFY COLUMN reason ENUM ('Manual', 'StockrotationAdvance', 'StockrotationRepatriation', 'ReturnToHome', 'ReturnToHolding', 'RotatingCollection', 'Reserve', 'LostReserve', 'CancelReserve', 'Recall') }); + $dbh->do(q{ALTER TABLE branchtransfers MODIFY COLUMN cancellation_reason ENUM ('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer') }); + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 8f5f7b438f..7bc48720ef 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1557,8 +1557,8 @@ CREATE TABLE `branchtransfers` ( `datecancelled` datetime DEFAULT NULL COMMENT 'the date the transfer was cancelled', `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','CancelRecall') 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','Recall','CancelRecall') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation', + `reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','Recall') 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') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation', PRIMARY KEY (`branchtransfer_id`), KEY `frombranch` (`frombranch`), KEY `tobranch` (`tobranch`), -- 2.11.0