[OPEN-ILS-DEV] Reshelving Complete

Doug Kyle dkyle at grpl.org
Tue Nov 17 15:21:30 EST 2009


Mike Rylander wrote:
> On Tue, Nov 10, 2009 at 9:08 AM, Doug Kyle <dkyle at grpl.org> wrote:
>   
>> Mike Rylander wrote:
>>     
>>> On Mon, Nov 9, 2009 at 1:39 PM, Doug Kyle <dkyle at grpl.org> wrote:
>>>
>>>       
>>>> Doug Kyle wrote:
>>>>
>>>>         
>>>>> Paul Waak wrote:
>>>>>
>>>>>           
>>>>>> On Sep 18, 2009, at 9:13 AM, Mike Rylander wrote:
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> [big snip]
>>>>>>> So, are their any circulation-manager-type folks out there that would
>>>>>>> be willing to weigh in on this?  To summarize, the options on the
>>>>>>> table are:
>>>>>>>
>>>>>>> 1) Tie reshelving-complete to the last edit time (effectively the
>>>>>>> "last time we touched the copy") for copies in the Reshelving status
>>>>>>> [non-circulation edits would extend the reshelving delay]
>>>>>>> 2) Extend the current behavior (checkin time OR create time for new,
>>>>>>> uncirculated copies) to make it aware of transits and apply the delay
>>>>>>> only after a post-circulation transit is complete [more complicated,
>>>>>>> and possibly slower, reshelving query]
>>>>>>>
>>>>>>>               
>>>> [snip]
>>>>
>>>> I'm not sure what plans are for this issue, but here is a patch that we
>>>> are
>>>> using with the current behavior to account for transit time.
>>>>
>>>>         
>>> Thanks, Doug!  One quick question, should the new join be a LEFT JOIN
>>> for copies that have circulated but not transited?
>>>
>>>
>>>       
>> Indeed it should, thanks Mike.
>>
>>     
>
> I've attached a mildly reworked version of the patch which I'd love
> some more eyes on.  Gimme an aye (heh) and I'll commit it.
>
>   

It appears this query is missing items that have never transited.  I'm 
thinking that is because the left join on action.transit_copy returns 
nulls where no transit exists, and the HAVING clause

MAX(circ.checkin_time) > MAX(trans.dest_recv_time)

does not return true for NULL (unknown) values, so instead we need

( MAX(circ.checkin_time) > MAX(trans.dest_recv_time) or 
MAX(trans.dest_recv_time) IS NULL )

Sound correct?




More information about the Open-ils-dev mailing list