https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19336

Katrin Fischer <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Signed Off

--- Comment #45 from Katrin Fischer <[email protected]> ---
I am aware that this has gone through a lot of different hands already. The
fines.pl script is quite a sensitive spot. We want to add the new feature,
without breaking anything of the old behavior.

I tried reviewing the code myself, but it's also not our prettiest script and
there is a lot of variables flying around.

May I request a second set of QA eyes here please?



-    my ( $amount, $unitcounttotal, $unitcount ) =
-      CalcFine( $overdue, $patron->categorycode,
-        $branchcode, $datedue, $today );
+    my ( $amount, $unitcounttotal, $unitcount );
+    if ( defined($maxfinesdays) && $maxfinesdays <=
$datedue->delta_days($today)->in_units('days') ) {
+        my $itype = $overdue->{itemtype} || $overdue->{itype};
+        my $data  = Koha::CirculationRules->get_effective_rule(
+            {
+                rule_name  => 'overduefinescap', categorycode =>
$patron->categorycode, itemtype => $itype,
+                branchcode => $branchcode
+            }
+        );
+        if ( defined( $data->rule_value ) ) {
+            $amount    = $data->rule_value;
+            $unitcount = 'n/a';
+        } else {
+            print
+                "No overduefinescap defined for {branchcode = $branchcode,
itemtype = $itype and categorycode = $patron->categorycode}\n";
+        }
+    }
+    if ( !$amount ) {
+        ( $amount, $unitcounttotal, $unitcount ) =
+            CalcFine( $overdue, $patron->categorycode, $branchcode, $datedue,
$today );
+    }

Some things I wondered about:

+    if ( !$amount ) {
Why this added condition on the calculation? 
To me it looks like that would keep fines from increasing. I had expected an
else case that keeps things like before if the new option is not used.

+            $unitcount = 'n/a';
Why this assignment? Unit count is usually numeric, but now set to a string.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to