<br><div class="gmail_quote">On Tue, Feb 26, 2008 at 11:54 AM, George Adams <<a href="mailto:g_adams27@hotmail.com">g_adams27@hotmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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?</blockquote><div><br>Probably you want cronjobs/fines2.pl<br><br>Schedule only one of these scripts nightly, of course. Running multiple scripts will trigger multiple fines.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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<br>
a record within the OPAC?<br></blockquote></div><br>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. <br>
<br>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.<br>
<br>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. <br>
<br>As for Koha's logic, the nightly cron job preserves the authoritative nature of the fines table. <br><br>--joe atzberger<br>