[OPEN-ILS-DEV] Lost item handling

Bill Ott bott at grpl.org
Tue Jan 27 12:46:31 EST 2009


Bill Ott said the following on 01/22/2009 08:35 PM:
>
>>> Oh, and a final note.  I don't have it worked in here yet, but 
>>> originally I
>>> mentioned the voided charge by date.  For us, we only accept the 
>>> item back
>>> for 1 year post due-date.  After that, you can give it back, but we 
>>> still
>>> charge for it.  So, while anything but a zero will trigger these now, a
>>> duration is what's really needed (e.g. "1 year").
>>>
>>>     
>>
>> Right.  That would be another (optional) org setting, I think.  There
>> are functions for turning dates and intervals into integers (see:
>> interval_to_seconds in OpenSRF::Utils) to facilitate age comparisons.
>>
>>   
>
> I'm back to plugging away at this, and I have it cleaned up a bit and 
> tested.  All seems to be working except for this call:
>  OpenSRF::Utils->noo_es_time($circ->due_date)
>
> I can reproduce the code elsewhere and it works as expected, but for 
> some reason calling the method always returns the 2002 from here:
>  return timelocal(int($tm[1]), int($tm[2]), int($tm[3]), int($tm[4]) 
> || 1, int($tm[5]), int($tm[6]) || 2002 );
>
> The due_date is: 2009-02-12T16:37:26-0500, so I would expect something 
> like: 1234480779, but instead get: 1009861200
>
> I don't see where this method is used elsewhere, is there something 
> obvious I'm missing?


I worked around this by simply putting a timelocal() call right where I 
needed it.

Attached is my latest incarnation.  I believe it does everything I set 
out to do, and I think I've tested all possible combinations, but you 
can only checkout and lose an item so many times before you lose track ;-)





-------------- next part --------------
A non-text attachment was scrubbed...
Name: Circulate.pm.diff
Type: text/x-patch
Size: 6167 bytes
Desc: not available
Url : http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20090127/5d9282e1/attachment.bin 


More information about the Open-ils-dev mailing list