7 A copy prefers to fulfill a hold near its home when:
9 - The last event for a copy was NOT at home *and* ...
10 - The copy has not circulated from home within the defined period *and* ...
11 - The copy has neither departed from home by transit nor arrived at home
12 by transit within the defined period.
17 In the preceding section, some terms are used that want explanation.
19 _Event_ refers to either a circulation or a transit related to a copy. An
20 event has only two qualities we care about: moment and place.
22 - When the event comes from a circulation, _moment_ is checkin_time if
23 we have it, otherwise xact_start. When the event comes from a transit,
24 moment is dest_recv_time if we have it, otherwise source_send_time.
26 - When the event comes from a circulation, _place_ is checkin_lib if we
27 have it, otherwise circ_lib. When the event comes from a transit,
28 place is dest, *always*.
30 - When the copy in question has neither any transit history nor any
31 circulation history, we produce a synthetic event with _moment_ equal
32 to the present time, and _place_ equal to the copy's call number's
33 owning_lib (see 'home' below).
35 _Home_ is the value of the copy's call number's owning_lib field, which
36 incidentally is usually equal to the copy's circ_lib field except where
39 _The defined period_ is the time between the present moment (_NOW()_
40 to the database) and the present moment less the value of the interval
41 defined in the _circ.hold_go_home_interval_ org unit setting at a scope
42 of the copy's _home_. E.g., if the setting contains the string "6 months",
43 the defined period is the last 6 months before the present moment, or
44 anything greater than _NOW() - '6 months'::INTERVAL_.
49 ............................................
57 ------------------------- -----------------------
58 | Was last event at home? | -----Yes.-----> | Don't try to go home. |
59 ------------------------- -----------------------
63 ------------------------------------------------ | |
64 | Did copy circ from home during defined period? |--Yes.--/ |
65 ------------------------------------------------ |
70 ------------------------------------------------------ |
71 | Did copy leave or arrive home during defined period? |--Yes.---/
72 ------------------------------------------------------
81 ............................................
84 Implications in Best-Hold Selection Sort Order
85 ----------------------------------------------
87 The calculations described above are all embodied in the best-hold selection
88 sort order determinant _shtime_.
90 _htime_ is a simpler version of the same, with all reference to transits
91 removed, considering only circulations. This means events become thin
92 circulations, the "Did a transit bring copy home..." step in the flow chart