Best Sort Order - System level sort for copy owning location and hold pickup location
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
Hello, we would like a best hold sort order option that will always give holds in the same system as the copy owning location priority.
This would be like the hprox option, which gives holds with the same pickup location as the copy owning location priority.
I first thought that it would work to grab the copy owning lib parent and the hold pickup lib parent, but that doesn't work for more complicated org unit hierarchies, where there may be sub system groups, or sub branch pickup locations.
One option would be to make the hprox sort depth aware, add an org unit setting that specifies a depth that is taken into account when calculating the hprox sort. The default setting would use the depth of the passed org units. That way the behavior wouldn't change by default.
Another option is to create a new sort option for this, hdprox, Home proximity with depth. But since I cannot think of why a system would use both hprox and hdprox at the same time, I'm really leaning towards modifying hprox.
In my testing, something along the lines of this works for a system level hprox.
actor.org_
If I wanted to just hard code it to depth 1 (system in our case) I think I could just modify the line at:
http://
Josh
tags: | added: holds wishlist |
tags: |
added: circ-holds removed: holds |
tags: |
added: sorting removed: wishlist |
Changed in evergreen: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
Here is a sort clause that tries to keep the default hprox behavior by default, but if the circ.hold_ hprox_depth library setting is set for the copy owning location then use that as the depth.
Although I think this might need another COALESCE for the case when the depth is set to lower than what exists for an OU. For the case where one system uses sub systems, while others don't.
I think I'll just hard code the simple version for our needs. If anyone else would find this generally useful then I'll keep working on it. But if it is only something we want to use then I will probably just keep this modification local.
actor.org_ unit_proximity( org_unit_ ancestor_ at_depth( :copyowninglib, to_text( value): :INT unit_ancestor_ setting( 'circ.hold_ hprox_depth' , :copyowninglib)) :copyowninglib org_unit_ ancestor_ at_depth( h.pickup_ lib, to_text( value): :INT unit_ancestor_ setting( 'circ.hold_ hprox_depth' , :copyowninglib)) :copyowninglib
(actor.
COALESCE(
(SELECT oils_json_
FROM actor.org_
,
(SELECT aout.depth
FROM actor.org_unit aou
JOIN actor.org_unit_type aout ON aout.id=aou.ou_type
WHERE aou.id=
)
))).id
,
(actor.
COALESCE(
(SELECT oils_json_
FROM actor.org_
,
(SELECT aout.depth
FROM actor.org_unit aou
JOIN actor.org_unit_type aout ON aout.id=aou.ou_type
WHERE aou.id=
)
))).id
)