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

(-)a/misc/cronjobs/fines.pl (-4 / +13 lines)
Lines 48-53 my $verbose; Link Here
48
my $output_dir;
48
my $output_dir;
49
my $log;
49
my $log;
50
my $maxdays;
50
my $maxdays;
51
my $maxfinesdays;
51
52
52
GetOptions(
53
GetOptions(
53
    'h|help'    => \$help,
54
    'h|help'    => \$help,
Lines 55-60 GetOptions( Link Here
55
    'l|log'     => \$log,
56
    'l|log'     => \$log,
56
    'o|out:s'   => \$output_dir,
57
    'o|out:s'   => \$output_dir,
57
    'm|maxdays:i' => \$maxdays,
58
    'm|maxdays:i' => \$maxdays,
59
    'maxfinesdays=i' => \$maxfinesdays
58
);
60
);
59
my $usage = << 'ENDUSAGE';
61
my $usage = << 'ENDUSAGE';
60
62
Lines 69-74 This script has the following parameters : Link Here
69
    -o --out:  ouput directory for logs (defaults to env or /tmp if !exist)
71
    -o --out:  ouput directory for logs (defaults to env or /tmp if !exist)
70
    -v --verbose
72
    -v --verbose
71
    -m --maxdays: how many days back of overdues to process
73
    -m --maxdays: how many days back of overdues to process
74
       --maxfinesdays: number of days after which normal fine amount should jump to maximal amount
72
75
73
ENDUSAGE
76
ENDUSAGE
74
77
Lines 144-152 for my $overdue ( @{$overdues} ) { Link Here
144
    }
147
    }
145
    ++$counted;
148
    ++$counted;
146
149
147
    my ( $amount, $unitcounttotal, $unitcount ) =
150
    my ( $amount, $unitcounttotal, $unitcount);
148
      CalcFine( $overdue, $patron->categorycode,
151
    if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )) {
149
        $branchcode, $datedue, $today );
152
        my $itype = $overdue->{itemtype} || $overdue->{itype};
153
        my $data = C4::Circulation::GetIssuingRule( $borrower->{categorycode}, $itype, $branchcode );
154
        $amount = $data->{overduefinescap};
155
    }
156
    if (!$amount) {
157
        ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today );
158
    }
159
150
160
151
    # Don't update the fine if today is a holiday.
161
    # Don't update the fine if today is a holiday.
152
    # This ensures that dropbox mode will remove the correct amount of fine.
162
    # This ensures that dropbox mode will remove the correct amount of fine.
153
- 

Return to bug 19336