Fines fixes: apparent problems with fines prevent processing.
authorJoe Atzberger <joe.atzberger@liblime.com>
Tue, 26 Aug 2008 03:57:01 +0000 (22:57 -0500)
committerChris Cormack <chris@bigballofwax.co.nz>
Thu, 3 Sep 2009 23:12:41 +0000 (11:12 +1200)
CalcFine returned values that mismatched expectations in fines.pl.

fines.pl refactored: added debugging, prevent needless recreation of
Calendar objects by storing them in hash by branch.
Still outstanding problems with fines, including the output of a field
that has no other references in Koha (so is always undef) and the
incorrect description of FinesMode.

Calendar exported "new" erroneously.  I also cleaned up the queries to
avoid needlessly compiling additional statement handles.

Please test and consider application to 3.0 maintenance.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
misc/cronjobs/fines.pl

index de9e8cf..0d0b972 100755 (executable)
@@ -90,7 +90,7 @@ for (my $i=0; $i<scalar(@$data); $i++) {
     my $datedue_days = Date_to_Days(split(/-/,$datedue->output('iso')));
     my $due_str = $datedue->output();
     unless (defined $data->[$i]->{'borrowernumber'}) {
-        print STDERR "ERROR in Getoverdues line $i: issues.borrowernumber IS NULL.  Repair 'issues' table now!  Skipping record.\n";
+        warn "ERROR in Getoverdues line $i: issues.borrowernumber IS NULL.  Repair 'issues' table now!  Skipping record.\n";
         next;   # Note: this doesn't solve everything.  After NULL borrowernumber, multiple issues w/ real borrowernumbers can pile up.
     }
     my $borrower = BorType($data->[$i]->{'borrowernumber'});