Bug 766: remove CGI::scrolling_list from request.pl
[koha.git] / C4 / Overdues.pm
index bc1c7a7..9c05668 100644 (file)
@@ -540,14 +540,14 @@ sub UpdateFine {
                 next;
             }
         }
-        $total_amount_other += $rec->{'amount'};
+        $total_amount_other += $rec->{'amountoutstanding'};
     }
+
     if (my $maxfine = C4::Context->preference('MaxFine')) {
         if ($total_amount_other + $amount > $maxfine) {
             my $new_amount = $maxfine - $total_amount_other;
-            warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached";
             return if $new_amount <= 0.00;
-
+            warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached";
             $amount = $new_amount;
         }
     }