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 148-157 for my $overdue ( @{$overdues} ) { Link Here
148
    ++$counted;
149
    ++$counted;
149
150
150
    my ( $amount, $unitcounttotal, $unitcount);
151
    my ( $amount, $unitcounttotal, $unitcount);
151
    if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )) {
152
    if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )->in_units( 'days' ) ) {
152
        my $itype = $overdue->{itemtype} || $overdue->{itype};
153
        my $itype = $overdue->{itemtype} || $overdue->{itype};
153
        my $data = C4::Circulation::GetIssuingRule( $borrower->{categorycode}, $itype, $branchcode );
154
        my $data = Koha::IssuingRules->get_effective_issuing_rule( { categorycode => $borrower->{categorycode}, itemtype => $itype, branchcode => $branchcode } );
154
        $amount = $data->{overduefinescap};
155
        if ( defined($data->overduefinescap) ) {
156
            $amount = $data->overduefinescap;
157
        }
158
        else {
159
            print "No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $borrower->{categorycode}}\n";
160
        }
155
    }
161
    }
156
    if (!$amount) {
162
    if (!$amount) {
157
        ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today );
163
        ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today );
158
- 

Return to bug 19336