Bug 22547: (QA follow-up) Warn in debug mode
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 9 Apr 2019 16:47:35 +0000 (13:47 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 17 Apr 2019 16:49:33 +0000 (16:49 +0000)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

C4/Overdues.pm

index b44aa58..a6ff257 100644 (file)
@@ -551,7 +551,7 @@ sub UpdateFine {
     while (my $rec = $sth->fetchrow_hashref) {
         if ( $rec->{issue_id} == $issue_id && $rec->{accounttype} eq 'FU' ) {
             if ($data) {
-                warn "Not a unique accountlines record for issue_id $issue_id";
+                $debug and warn "Not a unique accountlines record for issue_id $issue_id";
                 #FIXME Should we still count this one in total_amount ??
             }
             else {
@@ -566,7 +566,7 @@ sub UpdateFine {
         if ($total_amount_other + $amount > $maxfine) {
             my $new_amount = $maxfine - $total_amount_other;
             return if $new_amount <= 0.00;
-            warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached";
+            $debug and warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached";
             $amount = $new_amount;
         }
     }