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 150-159
for my $overdue ( @{$overdues} ) {
Link Here
|
150 |
} |
151 |
} |
151 |
++$counted; |
152 |
++$counted; |
152 |
|
153 |
|
153 |
my ( $amount, $unitcounttotal, $unitcount ) = CalcFine( |
154 |
my ( $amount, $unitcounttotal, $unitcount); |
154 |
$overdue, $patron->categorycode, |
155 |
if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )->in_units( 'days' ) ) { |
155 |
$branchcode, $datedue, $today |
156 |
my $itype = $overdue->{itemtype} || $overdue->{itype}; |
156 |
); |
157 |
my $data = Koha::IssuingRules->get_effective_issuing_rule( { categorycode => $borrower->{categorycode}, itemtype => $itype, branchcode => $branchcode } ); |
|
|
158 |
if ( defined($data->overduefinescap) ) { |
159 |
$amount = $data->overduefinescap; |
160 |
} |
161 |
else { |
162 |
print "No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $borrower->{categorycode}}\n"; |
163 |
} |
164 |
} |
165 |
if (!$amount) { |
166 |
( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today ); |
167 |
} |
168 |
|
157 |
|
169 |
|
158 |
# Don't update the fine if today is a holiday. |
170 |
# Don't update the fine if today is a holiday. |
159 |
# This ensures that dropbox mode will remove the correct amount of fine. |
171 |
# This ensures that dropbox mode will remove the correct amount of fine. |
160 |
- |
|
|