View | Details | Raw Unified | Return to bug 24146
Collapse All | Expand All

(-)a/C4/Overdues.pm (-7 / +13 lines)
Lines 551-562 sub UpdateFine { Link Here
551
        $total_amount_other += $overdue->amountoutstanding;
551
        $total_amount_other += $overdue->amountoutstanding;
552
    }
552
    }
553
553
554
    if (my $maxfine = C4::Context->preference('MaxFine')) {
554
    if ( my $maxfine = C4::Context->preference('MaxFine') ) {
555
        if ($total_amount_other + $amount > $maxfine) {
555
        my $maxIncrease = $maxfine - $total_amount_other;
556
            my $new_amount = $maxfine - $total_amount_other;
556
        return if $maxIncrease <= 0.00;
557
            return if $new_amount <= 0.00;
557
        if ($accountline) {
558
            $debug and warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached";
558
            if ( ( $amount - $accountline->amount ) > $maxIncrease ) {
559
            $amount = $new_amount;
559
                my $new_amount = $accountline->amount + $maxIncrease;
560
                $debug and warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached";
561
                $amount = $new_amount;
562
            }
563
        }
564
        elsif ( $amount > $maxIncrease ) {
565
            $debug and warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $maxIncrease - MaxFine reached";
566
            $amount = $maxIncrease;
560
        }
567
        }
561
    }
568
    }
562
569
563
- 

Return to bug 24146