add logic to support max_fine capping at item price, if OU setting is, ur, set
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 13 Nov 2009 16:37:25 +0000 (16:37 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 13 Nov 2009 16:37:25 +0000 (16:37 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14901 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm

index 39f34cd..4c90660 100644 (file)
@@ -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;
 }