From 6ff36a812b3ab0ba415520e913091f4129f98542 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Wed, 3 Apr 2013 16:35:51 -0400 Subject: [PATCH] Holds-go-home's key determinant, htime, has bug Should compare checkin lib to copy's (call number's) owning_lib, not hold request lib. You might think the comparison should be to acp.circ_lib, but that doesn't work with floating copies (for non-floaters, acp.circ_lib should be equal to acp.call_number.owning_lib). Signed-off-by: Lebbeous Fogle-Weekley --- .../lib/OpenILS/Application/Storage/Publisher/action.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm index baa7098e45..c0c953b1f5 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm @@ -30,14 +30,14 @@ my %HOLD_SORT_ORDER_BY = ( htime => q! CASE WHEN copy_has_not_been_home.result - THEN actor.org_unit_proximity(%d, h.request_lib) + THEN actor.org_unit_proximity(%d, acn.owning_lib) ELSE 999 END !, shtime => q! CASE WHEN copy_has_not_been_home_even_to_idle.result - THEN actor.org_unit_proximity(%d, h.request_lib) + THEN actor.org_unit_proximity(%d, acn.owning_lib) ELSE 999 END !, @@ -413,7 +413,12 @@ sub build_hold_sort_clause { ) ) AS result ) !, $cp->id, $cp->circ_lib, $cp->circ_lib, $cp->id); - $joins .= " JOIN copy_has_not_been_home ON (true) "; + + $joins .= q! + JOIN copy_has_not_been_home ON (true) + JOIN asset.copy acp ON (hm.target_copy = acp.id) + JOIN asset.call_number acn ON (acn.id = acp.call_number) + !; } if ($ctes_needed == 2) { -- 2.11.0