Lines 38-43
use Carp qw( carp croak );
Link Here
|
38 |
use File::Spec; |
38 |
use File::Spec; |
39 |
use Try::Tiny qw( catch try ); |
39 |
use Try::Tiny qw( catch try ); |
40 |
|
40 |
|
|
|
41 |
use Koha::IssuingRules; |
41 |
use Koha::Calendar; |
42 |
use Koha::Calendar; |
42 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
43 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
43 |
use Koha::Patrons; |
44 |
use Koha::Patrons; |
Lines 155-164
for my $overdue ( @{$overdues} ) {
Link Here
|
155 |
++$counted; |
156 |
++$counted; |
156 |
|
157 |
|
157 |
my ( $amount, $unitcounttotal, $unitcount); |
158 |
my ( $amount, $unitcounttotal, $unitcount); |
158 |
if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )) { |
159 |
if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )->in_units( 'days' ) ) { |
159 |
my $itype = $overdue->{itemtype} || $overdue->{itype}; |
160 |
my $itype = $overdue->{itemtype} || $overdue->{itype}; |
160 |
my $data = C4::Circulation::GetIssuingRule( $borrower->{categorycode}, $itype, $branchcode ); |
161 |
my $data = Koha::IssuingRules->get_effective_issuing_rule( { categorycode => $borrower->{categorycode}, itemtype => $itype, branchcode => $branchcode } ); |
161 |
$amount = $data->{overduefinescap}; |
162 |
if ( defined($data->overduefinescap) ) { |
|
|
163 |
$amount = $data->overduefinescap; |
164 |
} |
165 |
else { |
166 |
print "No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $borrower->{categorycode}}\n"; |
167 |
} |
162 |
} |
168 |
} |
163 |
if (!$amount) { |
169 |
if (!$amount) { |
164 |
( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today ); |
170 |
( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today ); |
165 |
- |
|
|