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

(-)a/misc/cronjobs/fines.pl (-4 / +13 lines)
Lines 49-54 my $output_dir; Link Here
49
my $log;
49
my $log;
50
my $maxdays;
50
my $maxdays;
51
my $verify_issue;
51
my $verify_issue;
52
my $maxfinesdays;
52
53
53
my $command_line_options = join(" ",@ARGV);
54
my $command_line_options = join(" ",@ARGV);
54
cronlogaction({ info => $command_line_options });
55
cronlogaction({ info => $command_line_options });
Lines 60-65 GetOptions( Link Here
60
    'o|out:s'   => \$output_dir,
61
    'o|out:s'   => \$output_dir,
61
    'm|maxdays:i' => \$maxdays,
62
    'm|maxdays:i' => \$maxdays,
62
    'i|verifyissue' => \$verify_issue,
63
    'i|verifyissue' => \$verify_issue,
64
    'maxfinesdays=i' => \$maxfinesdays
63
);
65
);
64
my $usage = << 'ENDUSAGE';
66
my $usage = << 'ENDUSAGE';
65
67
Lines 76-81 This script has the following parameters : Link Here
76
    -m --maxdays: how many days back of overdues to process
78
    -m --maxdays: how many days back of overdues to process
77
    -i --verifyissue: verify the issue before updating the fine in case the
79
    -i --verifyissue: verify the issue before updating the fine in case the
78
               item is returned while the fines job is running
80
               item is returned while the fines job is running
81
    --maxfinesdays: number of days after which normal fine amount should jump to maximal amount
79
82
80
ENDUSAGE
83
ENDUSAGE
81
84
Lines 150-158 for my $overdue ( @{$overdues} ) { Link Here
150
    }
153
    }
151
    ++$counted;
154
    ++$counted;
152
155
153
    my ( $amount, $unitcounttotal, $unitcount ) =
156
    my ( $amount, $unitcounttotal, $unitcount);
154
      CalcFine( $overdue, $patron->categorycode,
157
    if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )) {
155
        $branchcode, $datedue, $today );
158
        my $itype = $overdue->{itemtype} || $overdue->{itype};
159
        my $data = C4::Circulation::GetIssuingRule( $borrower->{categorycode}, $itype, $branchcode );
160
        $amount = $data->{overduefinescap};
161
    }
162
    if (!$amount) {
163
        ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today );
164
    }
165
156
166
157
    # Don't update the fine if today is a holiday.
167
    # Don't update the fine if today is a holiday.
158
    # This ensures that dropbox mode will remove the correct amount of fine.
168
    # This ensures that dropbox mode will remove the correct amount of fine.
159
- 

Return to bug 19336