include grace period when calculating overdue fine
authorMichael Hafen <mdhafen@tech.washk12.org>
Wed, 2 Sep 2009 20:14:59 +0000 (14:14 -0600)
committerGalen Charlton <gmcharlt@gmail.com>
Tue, 15 Sep 2009 02:45:40 +0000 (22:45 -0400)
Before the grace period was not included in the number of days overdue when
calculating the fine.  My librarians seem to think the number of days overdue
should include the grace period.

Fine is not assessed before the grace period is up though.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>

C4/Overdues.pm

index 6b429c5..8f40e8b 100644 (file)
@@ -263,7 +263,7 @@ sub CalcFine {
        # correct for grace period.
        my $days_minus_grace = $daystocharge - $data->{'firstremind'};
     if ($data->{'chargeperiod'} > 0 && $days_minus_grace > 0 ) { 
-        $amount = int($days_minus_grace / $data->{'chargeperiod'}) * $data->{'fine'};
+        $amount = int($daystocharge / $data->{'chargeperiod'}) * $data->{'fine'};
     } else {
         # a zero (or null)  chargeperiod means no charge.
     }