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

(-)a/misc/cronjobs/fines.pl (-4 / +9 lines)
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 154-163 for my $overdue ( @{$overdues} ) { Link Here
154
    ++$counted;
155
    ++$counted;
155
156
156
    my ( $amount, $unitcounttotal, $unitcount);
157
    my ( $amount, $unitcounttotal, $unitcount);
157
    if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )) {
158
    if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )->in_units( 'days' ) ) {
158
        my $itype = $overdue->{itemtype} || $overdue->{itype};
159
        my $itype = $overdue->{itemtype} || $overdue->{itype};
159
        my $data = C4::Circulation::GetIssuingRule( $borrower->{categorycode}, $itype, $branchcode );
160
        my $data = Koha::IssuingRules->get_effective_issuing_rule( { categorycode => $borrower->{categorycode}, itemtype => $itype, branchcode => $branchcode } );
160
        $amount = $data->{overduefinescap};
161
        if ( defined($data->overduefinescap) ) {
162
            $amount = $data->overduefinescap;
163
        }
164
        else {
165
            print "No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $borrower->{categorycode}}\n";
166
        }
161
    }
167
    }
162
    if (!$amount) {
168
    if (!$amount) {
163
        ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today );
169
        ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today );
164
- 

Return to bug 19336