Changing due dates for special occasions (christmas etc)
Submitted by Tim Hodson on Tue, 2005-12-20 10:22.
Hi,
Just wondering what other libraries do in terms of changing due dates for libraries when coming to christmas period?
Also wondering how you cope with emergency library closures?
Reason I ask, is that I have written some scripts that I use in herefordshire to cope with periods of closure and emergency building works etc, and wondered if anyone else would be interested.
Tim



Re:Changing due dates for special occasions (christmas etc)
Tim,
For holiday closures, we at Wirral work out which date for a particular loan period we need to stamp the books to, then we work out the number of days for that loan period. Then we run a script via the cron to set the due days.
e.g.
for a 4 week loan period we'd use a script like:
-------------------------------------------------------------------------------
case $# in
2) break;
;;
*) echo '\nUsage: script-name database period_days\n' 1>&2; exit 1
esac
date
isql -Usa -P <<- END > /scratch/set_due_4week.out
use $1
go
update DUE_DATE
set PERIOD_DAYS = $2
where DUE_DATE_ID = 6
go
END
------------------------------------------------------------------------
Then we'd pass the script 'prod_talis' as the database and for example, '30' as the new loan period. We'd run this script over a few days via the cron, passing the new loan period parameters each day, until on the last day it would get passed the normal '28' to reset the correct value.
e.g. the cron line would be:
/bin/su - talis -c "/users/talis/set_due_4week prod_talis 30"
then
/bin/su - talis -c "/users/talis/set_due_4week prod_talis 29"
then
/bin/su - talis -c "/users/talis/set_due_4week prod_talis 28"
Clear as mud eh?
I'd be interested in seeing how you go about it though.
Cheers
Mark
Re:Changing due dates for special occasions (christmas etc)
Pretty much the same way. Although for christmas we basically give everyone an extra week. (we are a public library so don't work to ends of term etc), so a script which does as you described, sets the due date days to whatever we need. I simply pass the DUE_DATE_ID and PERIOD_DAYS to the script.
We give people a week, to try and spread out the returns after christmas, and to keep the due weekday to a day that is the borrowers 'usual' day in.
A cron script running in the morning of the appropraite week either giveth or taketh away that extra week.
I also have a script that will toggle a single site's due dates from the defaults that every site uses, to a set of 'emergency' due dates (and back again). (due date types pre defined in talis) which can then have duedates changed at will. I use these for times when a library is closed for an extended period and we don't want lots of books coming back.
Due Dates
Tim,
We are currently about to have a bit of refurbishment done to a few of our libraries and a script that could alter single sites due dates may be a help. Any chance I could have a copy of the script you produced?
Thanks
Mark
http://www.wirral-libraries.net/
http://www.stembystem.co.uk/
There is an article called
There is an article called How to update due date rules via SQL on the TDN which has details about updating due dates including details and a script from Tim you might find helpful.
Brian Crampton
Developer, Talis
Due dates
Brian,
Thanks, I saw that, but as far as I can see that will change the due dates globally, not just for one site. I think Tim had a script specifically for altering just one site without affecting all the others.
Cheers
Mark
http://www.wirral-libraries.net/
http://www.stembystem.co.uk/
Due dates
Hi Mark,
The process is similar to that in the article...
1/ create an 'emergency' due date type, so where our due date type is normally named 'Z3W' we created a new one named 'Z3WE'
2/ set the due date for 'Z3WE' to the correct number of days or a particular date/time. We use the spreadsheet as in the PDF brian linked, and set a number of days so that returns are staggered.
3/ I then use a shell script that toggles the emergency due date on or off. it accepts two arguments, the LOCATION_PROFILE_ID and whether to turn ON or OFF! This uses SQL as in the 'another approach' section of the PDF. The script is then set up in the cron for the early hours of the days on which the emergency rules will be turned ON and OFF.
Mark, I will happily send you a copy of the script (I'll need your email!)
Brian, perhaps it could be added to the appendix in the PDF? I'll send you a copy tomorrow.
Thanks
Tim
---
Tim Hodson
Herefordshire Libraries
www.timhodson.com
informationtakesover.co.uk (blog)
Due dates script
OK. I'll update the article with the script.
I'll include something about the dead days script as well.
Brian Crampton
Developer, Talis
due date article updated
The How to update due date rules via SQL article has been updated with details of Tim's script.
Brian Crampton
Developer, Talis
Dead days
By the way, our libraries have had a period of closure while moving from one premises to another, so we set the days as being dead for fines and returns, just in case anything slipped the net, and for other non standard loans.
I have a handy SQL statement that will iterate through all dates in a range and set the days as dead for individual site profiles.
Tim Hodson
Herefordshire Libraries
www.timhodson.com
informationtakesover.co.uk (blog)
Thanks Tim
Thanks Tim,
Much appreciated.
my e-mail address is: markhughes @ wirral-libraries.net
Cheers
Mark
http://www.wirral-libraries.net/
http://www.stembystem.co.uk/