[OPEN-ILS-GENERAL] circulation scripts

Jason Etheridge jason at esilibrary.com
Mon Sep 28 12:09:28 EDT 2009


On Sun, Sep 27, 2009 at 6:18 PM, Nuku Ameyibor <nayibor at gmail.com> wrote:
> how can you set  circulation  up so that if you are renewing  a book and you
> are  owing you cannot renew the book or if you are owing a certain amount
> you cant renew anymore

Note: the only thing I'm really familiar with is the script-based
circulation behavior.  I don't know the completely in-database options
yet.

The script that would be involved here is circ_permit_renew.js,
however, I don't think any fines information gets injected into that
environment, and it would take some code modification to do so.  So
that leaves us with standing penalties as a mechanism for doing
this...

>     'Lecturer' : {
>         maxItemsOut         : 1,
>         fineThreshold       : 5,
>         overdueThreshold    : 5,
>         maxHolds            : 1
>     },
>
> this is my circ_group  rule for a lecturer . does the finethreshold work
> for when someone is renewing a book or it only works for fresh checkouts
> how can i modify this or modify it in  some other circulation    script to
> make if perform that required behaviour   like eg

The threshold settings here get picked up by a script called
patron_penalty.js, and if the criteria is met, then one or more
standing penalties (or blocks) are associated with the patron's
account.  In EG 1.4 and earlier, I believe these penalties do indeed
block renewals.  In EG 1.6, we can explicitly configure the behavior
(whether they block circs, renewals, and/or holds), and by default,
the penalty for excessive fines blocks it all.

The main problem with standing penalties currently is that the
configuration is global per profile/permission group, and cannot vary
per library.

So, for your Lecturer example above, once a Lecturer has accumulated
over $5 in fines and bills, then an indicator for "Maximum Bills" will
show on their account, their name will show up with a purple
background (I'm changing this to a purple border barring any outcry
from end-users), and any attempts at circ or renewal by staff will
result in a Failure/Override dialog, and any attempts by the patron
herself will result in a failure.

For some things, you can duplicate the criteria of standing penalties
in your circ permit scripts (and have them customizable per library),
but I don't believe fines information is among the data available to
those scripts.

> 2. had another question about  how i  can setup the system such that if  some
> has overdue items for some amount of time. a bigger penalty will be placed
> on him so that  say after he is overdue for  5 days and he is charged the normal
> maybe 50cents/day.after six days he is  he is chaged   $1/day and after  1 month
> he is charged  $10 fixed with no more charges.

Some of this would take development, though you could certainly write
some SQL and put it into a CRON job to handle this.  The behavior for
a circulation is set at the time of the circulation (and possibly
reset during a renewal, which really creates a new circulation record,
albeit one with flags letting you know it's a renewal).  However, you
could write SQL to modify the rules for existing circulations,
effectively changing their behavior "mid-stream".

There is a notion of going from overdue to "long overdue", which
supports the fixed charge/stop fines behavior, but I think it too
requires scripting and does not work out of the box, so to speak.

> 3. i was also wondering what   the tag cirulate as a particlar kind of item
> affect an item in the copy editor ? becuase you created the book as a
> particlar kind of item when u were first creating it  so what does this do?

Most libraries tend to base their circulation behavior on the circ
modifier field for an item, but it's also possible to base rules and
behavior on data in the bib record.  The Circulate As Type field on an
item tricks the circ scripts into thinking that the item is associated
a different type of bib record than it actually is.  So for example, a
bib record may say that it's a Projected Medium, and you might have a
loan period for that.  And you may have a different loan period for a
Kit.  An item may be attached to a Projected Medium bib record, but
tell the circ scripts to treat it as if it were a Kit instead.

> 4last but not the least, how does the billing olay out if you select normal
> when you are checking out books?

In the Due Date box, a value of Normal just means use whatever due
date the normal circ rules come up with, and has nothing to do with
the Short/Normal/Extended loan duration field on an item, nor the
Low/Normal/High fine level field.

> 4. i set up some marc templates but i dont see them in the template editor
> when i am loading mark records. i restarted the sytem from scratch .checked
> for errors in the opensrf.xml  mark templates and still no errors.i dont
> think the  errors are from the code for the  marc types in the marc
> templates folder .they seem alright to me.

Those should show up in a drop-down menu when you select Cataloging ->
Create new MARC record in the staff client.

> 5.where is the best place i can see errors or problems with my configuration
> files when i am startng up configuration.say i enter  a circulation script
> wrongly or i  dont enter the correct format for a duration rule i want to
> use in the config.cgi/cgi-bin interface .where is the best place to view
> such errors

You'll only be able to see an error with a circulation script at the
time of circulation.  Those are run on demand, and can even be
replaced without restarting the system.  They'll show up in the
/openils/var/log/ files by default, and as a pop-up alert in the staff
client.  It's also possible to catch some syntax errors early if you
run the script against a command-line javascript interpreter (such as
the one provided by the spidermonkey-bin Debian/Ubuntu package),
though it may be dangerous to install such an interpreter in a
production Evergreen environment (which makes use of its own compiled
spidermonkey libraries).

Hope this helps!

-- 
Jason Etheridge
 | VP, Tactical Development
 | Equinox Software, Inc. / The Evergreen Experts
 | phone:  1-877-OPEN-ILS (673-6457)
 | email:  jason at esilibrary.com
 | web:  http://www.esilibrary.com


More information about the Open-ils-general mailing list