From 5dddbf87d14b1341fecf6c06da6f3fb014887653 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 26 Oct 2015 08:30:57 -0400 Subject: [PATCH] Bug 15062 - Holds queue with Transport Cost Matrix will transfer item even if transfers disabled If the transfer of an item from Library A to Library B is disabled in the Transport Cost Matrix, but the only item on a record is from Library A, the holds queue will request a transfer of that item from Library A to Library B even though the rules state such a transfer is not allowed! Test Plan: 1) Enable the transport cost matrix 2) For simplicity, leave all cells disabled on it, save this state. This state means that only items at each location should fill holds where the pickup library is that same location. 3) Create a record with one item, set its home and holding branch to Library A 4) Create a hold for pickup at Library B 5) Rebuild the holds queue 6) Note the transfer request for the item to Library B 7) Apply this patch 8) Rebuild the holds queue 9) Note the transfer request is gone --- C4/HoldsQueue.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 08f6307..f5a9be7 100755 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -446,7 +446,7 @@ sub MapItemsToHoldRequests { } } else { - warn "No transport costs for $pickup_branch"; + next; } } @@ -618,7 +618,7 @@ sub least_cost_branch { # Nothing really spectacular: supply to branch, a list of potential from branches # and find the minimum from - to value from the transport_cost_matrix - return $from->[0] if @$from == 1; + return $from->[0] if ( @$from == 1 && $transport_cost_matrix->{$to}{$from->[0]}->{disable_transfer} != 1 ); # If the pickup library is in the list of libraries to pull from, # return that library right away, it is obviously the least costly -- 1.7.2.5