Fix various Traditional and holds-go-home best-hold sort orders
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 3 Apr 2013 17:58:07 +0000 (13:58 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 5 Apr 2013 14:49:11 +0000 (10:49 -0400)
commit849e78b114d772f03185626efd74dbe30e7e7b42
tree9c0cba140c757cb03442b6962efbe13e7df675dc
parent6ff36a812b3ab0ba415520e913091f4129f98542
Fix various Traditional and holds-go-home best-hold sort orders

approx is a more correct determinant to give the behavior sites are used
to.  hprox can cause copies to be too eager to go home when there are
holds with that copy's circ lib as its request lib (if that's what you
want, then you do pick or create a sort-order with hprox near the top).

Address a problem in the copy_has_not_been_home CTE. This expression was
always meant to provide a TRUE or FALSE value as its lone result, but
would return NULL in cases where copies had no transit history.

Also use pickup_lib, not request_lib, as the determinant of
nearness-to-home.  request_lib was used with the thinking that an item's
"owning" patrons should have their wishes favored at holds-go-home time,
even if where they wanted to send the copy was not actually home, but
that's neither necessarily desired nor very intuitive.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.best-hold-order-traditional-approx.sql [new file with mode: 0644]