Bug 30924: Add missing branchtransfers.reason value for recall cancellation
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 54372681be
)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
95ba78d7c0
commit
1910ad6b1b
4 changed files with 25 additions and 3 deletions
16
installer/data/mysql/atomicupdate/bug_30924.pl
Executable file
16
installer/data/mysql/atomicupdate/bug_30924.pl
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
use Modern::Perl;
|
||||||
|
|
||||||
|
return {
|
||||||
|
bug_number => 30924,
|
||||||
|
description => "Add missing RecallCancellation option to branchtransfers.reason ENUM",
|
||||||
|
up => sub {
|
||||||
|
my ($args) = @_;
|
||||||
|
my ($dbh) = @$args{qw(dbh)};
|
||||||
|
|
||||||
|
# Add RecallCancellation ENUM option to branchtransfers.reason
|
||||||
|
$dbh->do(q{
|
||||||
|
ALTER TABLE branchtransfers MODIFY COLUMN 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'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
|
@ -1566,7 +1566,7 @@ CREATE TABLE `branchtransfers` (
|
||||||
`datecancelled` datetime DEFAULT NULL COMMENT 'the date the transfer was cancelled',
|
`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',
|
`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',
|
`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') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered 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','CancelRecall') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation',
|
||||||
PRIMARY KEY (`branchtransfer_id`),
|
PRIMARY KEY (`branchtransfer_id`),
|
||||||
KEY `frombranch` (`frombranch`),
|
KEY `frombranch` (`frombranch`),
|
||||||
|
|
|
@ -40,7 +40,10 @@ my $recall_id = $query->param('recall_id');
|
||||||
if ( $op eq 'cancel' ) {
|
if ( $op eq 'cancel' ) {
|
||||||
my $recall = Koha::Recalls->find( $recall_id );
|
my $recall = Koha::Recalls->find( $recall_id );
|
||||||
if ( $recall->in_transit ) {
|
if ( $recall->in_transit ) {
|
||||||
C4::Items::ModItemTransfer( $recall->item->itemnumber, $recall->item->holdingbranch, $recall->item->homebranch, 'CancelRecall' );
|
C4::Items::ModItemTransfer(
|
||||||
|
$recall->item->itemnumber, $recall->item->holdingbranch,
|
||||||
|
$recall->item->homebranch, 'RecallCancellation'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$recall->set_cancelled;
|
$recall->set_cancelled;
|
||||||
$op = 'list';
|
$op = 'list';
|
||||||
|
|
|
@ -78,7 +78,10 @@ if ( $op eq 'cancel' ) {
|
||||||
} elsif ( $op eq 'transit' ) {
|
} elsif ( $op eq 'transit' ) {
|
||||||
# cancel recall and return item to home library
|
# cancel recall and return item to home library
|
||||||
if ( $recall->in_transit ) {
|
if ( $recall->in_transit ) {
|
||||||
C4::Items::ModItemTransfer( $recall->item->itemnumber, $recall->item->holdingbranch, $recall->item->homebranch, 'CancelRecall' );
|
C4::Items::ModItemTransfer(
|
||||||
|
$recall->item->itemnumber, $recall->item->holdingbranch,
|
||||||
|
$recall->item->homebranch, 'RecallCancellation'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$recall->set_cancelled;
|
$recall->set_cancelled;
|
||||||
if ( $recall->cancelled ){
|
if ( $recall->cancelled ){
|
||||||
|
|
Loading…
Reference in a new issue