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>
# 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.
}