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

(-)a/misc/cronjobs/fines.pl (-5 / +14 lines)
Lines 44-55 my $help; Link Here
44
my $verbose;
44
my $verbose;
45
my $output_dir;
45
my $output_dir;
46
my $log;
46
my $log;
47
my $maxfinesdays;
47
48
48
GetOptions(
49
GetOptions(
49
    'h|help'    => \$help,
50
    'h|help'    => \$help,
50
    'v|verbose' => \$verbose,
51
    'v|verbose' => \$verbose,
51
    'l|log'     => \$log,
52
    'l|log'     => \$log,
52
    'o|out:s'   => \$output_dir,
53
    'o|out=s'   => \$output_dir,
54
    'maxfinesdays=i' => \$maxfinesdays
53
);
55
);
54
my $usage = << 'ENDUSAGE';
56
my $usage = << 'ENDUSAGE';
55
57
Lines 63-68 This script has the following parameters : Link Here
63
    -l --log: log the output to a file (optional if the -o parameter is given)
65
    -l --log: log the output to a file (optional if the -o parameter is given)
64
    -o --out:  ouput directory for logs (defaults to env or /tmp if !exist)
66
    -o --out:  ouput directory for logs (defaults to env or /tmp if !exist)
65
    -v --verbose
67
    -v --verbose
68
       --maxfinesdays: number of days after which normal fine amount should jump to maximal amount
66
69
67
ENDUSAGE
70
ENDUSAGE
68
71
Lines 122-130 for my $overdue ( @{$overdues} ) { Link Here
122
    }
125
    }
123
    ++$counted;
126
    ++$counted;
124
127
125
    my ( $amount, $type, $unitcounttotal ) =
128
    my ( $amount, $type, $unitcounttotal );
126
      CalcFine( $overdue, $borrower->{categorycode},
129
    if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )) {
127
        $branchcode, $datedue, $today );
130
        my $itype = $overdue->{itemtype} || $overdue->{itype};
131
        my $data = C4::Circulation::GetIssuingRule( $borrower->{categorycode}, $itype, $branchcode );
132
        $amount = $data->{overduefinescap};
133
    }
134
    if (!$amount) {
135
        ( $amount, $type, $unitcounttotal ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today );
136
    }
137
128
    $type ||= q{};
138
    $type ||= q{};
129
139
130
    # Don't update the fine if today is a holiday.
140
    # Don't update the fine if today is a holiday.
131
- 

Return to bug 19336