[Koha] Calculating fines?

Joe Atzberger ohiocore at gmail.com
Wed Feb 27 13:58:14 NZDT 2008


On Tue, Feb 26, 2008 at 11:54 AM, George Adams <g_adams27 at hotmail.com>
wrote:

> 1) All 4 of these scripts say "This script is meant to be run nightly out
> of cron".  Which of these should I actually setup to run nightly?


Probably you want cronjobs/fines2.pl

Schedule only one of these scripts nightly, of course.  Running multiple
scripts will trigger multiple fines.


> 2) Why is a cronjob even necessary?  i.e. why can't Koha look at today's
> date and the books' due dates, then calculate on the fly what the overdue
> fines are whenever the patron or librarian pulls up
> a record within the OPAC?
>

The performance of such an implementation would be at a disadvantage.  The
fines rules can be somewhat complex with inheritance of defaults based on
item category.   You would need to recalculate possible fines for each of a
patron's checked out items on each of their subsequent transactions.  You
wouldn't know whether a patron was able to check out anything until you
completed this computation.

How would you handle an arbitrary fine (for usage, new library card,
services, etc.)? or the overdue fine after the item is returned?  Clearly
you would need a populate fine table anyway, but it isn't authoritative.  On
each of your transactions, you'd already be doing the fines query that Koha
normally does, and then going on to compute "on the fly" for each of the
checked out items.  Both the logic and the performance of fines accounting
are compromised in this model.

Then what would a library do if they wanted to send notices about overdue
fines?  They would have to pick a time to process all the checked out items,
determine the amount of fines, combine them with the partial fines table,
send or print messages, etc.  You can see that the nightly fines cron task
functions as a subset of this.

As for Koha's logic, the nightly cron job preserves the authoritative nature
of the fines table.

--joe atzberger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20080226/caa6e6c6/attachment.html


More information about the Koha mailing list