From: miker Date: Fri, 13 Nov 2009 16:37:25 +0000 (+0000) Subject: add logic to support max_fine capping at item price, if OU setting is, ur, set X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fcbeba8eca6c6c52f6906b5c1082e2573a6ba039;p=evergreen%2Fmasslnc.git add logic to support max_fine capping at item price, if OU setting is, ur, set git-svn-id: svn://svn.open-ils.org/ILS/trunk@14901 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index 39f34cd669..4c906603ff 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -1015,7 +1015,16 @@ sub get_max_fine_amount { if ($U->is_true($max_fine_rule->is_percent)) { my $price = $U->get_copy_price($self->editor, $self->copy, $self->volume); $max_amount = $price * $max_fine_rule->amount / 100; - } + } elsif ( + $U->ou_ancestor_setting_value( + $self->circ->circ_lib, + 'circ.max_fine.cap_at_price', + $self->editor + ) + ) { + my $price = $U->get_copy_price($self->editor, $self->copy, $self->volume); + $max_amount = ( $price && $max_amount > $price ) ? $price : $max_amount; + } return $max_amount; }