View | Details | Raw Unified | Return to bug 19336
Collapse All | Expand All

(-)a/misc/cronjobs/fines.pl (-4 / +9 lines)
Lines 36-41 use Getopt::Long; Link Here
36
use Carp;
36
use Carp;
37
use File::Spec;
37
use File::Spec;
38
38
39
use Koha::IssuingRules;
39
use Koha::Calendar;
40
use Koha::Calendar;
40
use Koha::DateUtils;
41
use Koha::DateUtils;
41
use C4::Log;
42
use C4::Log;
Lines 126-135 for my $overdue ( @{$overdues} ) { Link Here
126
    ++$counted;
127
    ++$counted;
127
128
128
    my ( $amount, $unitcounttotal, $unitcount);
129
    my ( $amount, $unitcounttotal, $unitcount);
129
    if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )) {
130
    if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )->in_units( 'days' ) ) {
130
        my $itype = $overdue->{itemtype} || $overdue->{itype};
131
        my $itype = $overdue->{itemtype} || $overdue->{itype};
131
        my $data = C4::Circulation::GetIssuingRule( $borrower->{categorycode}, $itype, $branchcode );
132
        my $data = Koha::IssuingRules->get_effective_issuing_rule( { categorycode => $borrower->{categorycode}, itemtype => $itype, branchcode => $branchcode } );
132
        $amount = $data->{overduefinescap};
133
        if ( defined($data->overduefinescap) ) {
134
            $amount = $data->overduefinescap;
135
        }
136
        else {
137
            print "No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $borrower->{categorycode}}\n";
138
        }
133
    }
139
    }
134
    if (!$amount) {
140
    if (!$amount) {
135
        ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today );
141
        ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today );
136
- 

Return to bug 19336