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