[Koha-patches] [PATCH] include grace period when calculating overdue fine

Michael Hafen mdhafen at tech.washk12.org
Wed Sep 2 22:14:59 CEST 2009


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.
---
 C4/Overdues.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/C4/Overdues.pm b/C4/Overdues.pm
index 6b429c5..8f40e8b 100644
--- a/C4/Overdues.pm
+++ b/C4/Overdues.pm
@@ -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.
     }
-- 
1.6.0.4




More information about the Koha-patches mailing list