From 118bd153e2eaed19ee42a947cbb009348f874f35 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 4 Jan 2024 12:00:13 +0000 Subject: [PATCH] Bug 35100: Prevent StockrotationAdvance transfers from being cancelled ModItemTransfer is still very heavy handed and outright overrules existing transfers in the queue. For StockrotationAdvance transfers it's important that they remain in the queue to get actioned later, even if a higher precident transfer is actions in the interim. This patch adds a clause to the cancellation call within request_transfer such that StockrationAdvance transfers are left in tact for the next time the item is checked in. Test plan 1) Item is added to stock rotation 2) The cronjob creates a 'StockRotationAdvance' transfer 3) The item is checked in, which initiates the transfer, however, a hold is triggered 4) The hold is confirmed, which replaces the StockRotationAdvance 5) The item is checked out 6) The item is checked in, which initiates the transfer again 7) The item is checked in at it's destination and the StockrotationAdvance transfer has the proper date arrived date set. Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- Koha/Item.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index 05d65d1da3..48a8f2ce1b 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -776,7 +776,7 @@ sub request_transfer { if ( $request && !$params->{enqueue} && !$params->{replace} ); $request->cancel( { reason => $params->{reason}, force => 1 } ) - if ( defined($request) && $params->{replace} ); + if ( defined($request) && $params->{replace} && ( $request->reason ne 'StockrotationAdvance' ) ); my $transfer = Koha::Item::Transfer->new( { -- 2.39.5