[Koha] Calculating fines?

George Adams g_adams27 at hotmail.com
Thu Feb 28 11:21:48 NZDT 2008


Thanks again to everyone who helped with the overdue fine processing, both with code help and explanatory help for why it works the way it does.  Chris, thanks for the bugfix for cronjobs/fines2.pl - changing "C4::context" to "C4::Context" did indeed fix that problem.

cronjobs/fines2.pl still died with the following error:

    Can't use string ("0") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Overdues.pm line 511.

Poring through the code, it appears that this command caused the error:

    &logaction(
        C4::Context->userenv->{'number'},
        "FINES",
        $type,
        $borrowernumber,
        "due=".$due."  amount=".$amount." itemnumber=".$itemnum
        ) if C4::Context->preference("FinesLog");


I changed it to this, which seemed to fix the problem:

    &logaction(
        "",
        "FINES",
        $type,
        $borrowernumber,
        "due=".$due."  amount=".$amount." itemnumber=".$itemnum
        ) if C4::Context->preference("FinesLog");


I'm not sure what C4::Context->userenv->{'number'} was supposed to be, but I was guessing that it would normally be assigned a value if the script was running in a web environment but not in a cron environment.  Since blanking it out didn't seem to hurt anything, I decided it was a Good Enough fix for me.  Just in case anyone else needs to know.



_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20080227/500b8ff0/attachment.html


More information about the Koha mailing list