Fix various Traditional and holds-go-home best-hold sort orders user/senator/best-hold-fixes
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 3 Apr 2013 20:35:51 +0000 (16:35 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 19 Apr 2013 17:45:19 +0000 (13:45 -0400)
commit3c09851f91ff585665d6570aad5a7566829f0946
tree8a7e03b2bdfcf8874a6bd2b37f8e95b46f306c3b
parentbdc5fd42a9f816928860e049caf285adbd58d651
Fix various Traditional and holds-go-home best-hold sort orders

Use copy's call number's owning_lib instead of copy's circ_lib

    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).

approx is a more correct first 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.

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.

Clear up holds-go-home logic with better code AND add TechRef
documentation with diagram in attempt to be as clear as possible.

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]
docs/TechRef/Circ/holds-go-home.txt [new file with mode: 0644]