From 960e023e60c42bc9561f787bc70db2bc407c8e86 Mon Sep 17 00:00:00 2001 From: Alexis Ripetti Date: Fri, 27 Aug 2021 09:39:05 -0400 Subject: [PATCH] Bug 19336: (QA follow-up) Using CirculationRules instead of IssuingRules --- misc/cronjobs/fines.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl index dca99d92a7..a64bb15186 100755 --- a/misc/cronjobs/fines.pl +++ b/misc/cronjobs/fines.pl @@ -38,7 +38,7 @@ use Carp qw( carp croak ); use File::Spec; use Try::Tiny qw( catch try ); -use Koha::IssuingRules; +use Koha::CirculationRules; use Koha::Calendar; use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; @@ -158,17 +158,17 @@ for my $overdue ( @{$overdues} ) { my ( $amount, $unitcounttotal, $unitcount); if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )->in_units( 'days' ) ) { my $itype = $overdue->{itemtype} || $overdue->{itype}; - my $data = Koha::IssuingRules->get_effective_issuing_rule( { categorycode => $borrower->{categorycode}, itemtype => $itype, branchcode => $branchcode } ); - if ( defined($data->overduefinescap) ) { - $amount = $data->overduefinescap; + 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 = $borrower->{categorycode}}\n"; + print "No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $patron->categorycode}\n"; } } if (!$amount) { - ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today ); + ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $patron->categorycode, $branchcode, $datedue, $today ); } -- 2.34.1