bug 7821 follow-up: escaping {} in regexp
[koha_gimpoz] / C4 / Overdues.pm
index 583fb96..7676a87 100644 (file)
@@ -252,7 +252,8 @@ or "Final Notice".  But CalcFine never defined any value.
 =cut
 
 sub CalcFine {
-    my ( $item, $bortype, $branchcode, $start_date, $end_date  ) = @_;
+    my ( $item, $bortype, $branchcode, $due_dt, $end_date  ) = @_;
+    my $start_date = $due_dt->clone();
     my $dbh = C4::Context->dbh;
     my $amount = 0;
     my $charge_duration;
@@ -272,7 +273,7 @@ sub CalcFine {
         $chargeable_units = $charge_duration->hours(); # TODO closed times???
     }
     else {
-        $chargeable_units = $charge_duration->day;
+        $chargeable_units = $charge_duration->days;
     }
     my $days_minus_grace = $chargeable_units - $data->{firstremind};
     if ($data->{'chargeperiod'}  && $days_minus_grace  ) {