Lines 56-67
my $command_line_options = join( " ", @ARGV );
Link Here
|
56 |
cronlogaction( { info => $command_line_options } ); |
56 |
cronlogaction( { info => $command_line_options } ); |
57 |
|
57 |
|
58 |
GetOptions( |
58 |
GetOptions( |
59 |
'h|help' => \$help, |
59 |
'h|help' => \$help, |
60 |
'v|verbose' => \$verbose, |
60 |
'v|verbose' => \$verbose, |
61 |
'l|log' => \$log, |
61 |
'l|log' => \$log, |
62 |
'o|out:s' => \$output_dir, |
62 |
'o|out:s' => \$output_dir, |
63 |
'm|maxdays:i' => \$maxdays, |
63 |
'm|maxdays:i' => \$maxdays, |
64 |
'i|verifyissue' => \$verify_issue, |
64 |
'i|verifyissue' => \$verify_issue, |
65 |
'maxfinesdays=i' => \$maxfinesdays |
65 |
'maxfinesdays=i' => \$maxfinesdays |
66 |
); |
66 |
); |
67 |
my $usage = << 'ENDUSAGE'; |
67 |
my $usage = << 'ENDUSAGE'; |
Lines 100-105
try {
Link Here
|
100 |
exit; |
100 |
exit; |
101 |
}; |
101 |
}; |
102 |
|
102 |
|
|
|
103 |
cronlogaction( { info => $command_line_options } ); |
104 |
|
103 |
my @borrower_fields = qw(cardnumber categorycode surname firstname email phone address citystate); |
105 |
my @borrower_fields = qw(cardnumber categorycode surname firstname email phone address citystate); |
104 |
my @item_fields = qw(itemnumber barcode date_due); |
106 |
my @item_fields = qw(itemnumber barcode date_due); |
105 |
my @other_fields = qw(days_overdue fine); |
107 |
my @other_fields = qw(days_overdue fine); |
Lines 151-173
for my $overdue ( @{$overdues} ) {
Link Here
|
151 |
} |
153 |
} |
152 |
++$counted; |
154 |
++$counted; |
153 |
|
155 |
|
154 |
my ( $amount, $unitcounttotal, $unitcount); |
156 |
my ( $amount, $unitcounttotal, $unitcount ); |
155 |
if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )->in_units( 'days' ) ) { |
157 |
if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days($today)->in_units('days') ) { |
156 |
my $itype = $overdue->{itemtype} || $overdue->{itype}; |
158 |
my $itype = $overdue->{itemtype} || $overdue->{itype}; |
157 |
my $data = Koha::CirculationRules->get_effective_rule( { rule_name => 'overduefinescap', categorycode => $patron->categorycode, itemtype => $itype, branchcode => $branchcode } ); |
159 |
my $data = Koha::CirculationRules->get_effective_rule( |
158 |
if ( defined($data->rule_value) ) { |
160 |
{ |
159 |
$amount = $data->rule_value; |
161 |
rule_name => 'overduefinescap', categorycode => $patron->categorycode, itemtype => $itype, |
|
|
162 |
branchcode => $branchcode |
163 |
} |
164 |
); |
165 |
if ( defined( $data->rule_value ) ) { |
166 |
$amount = $data->rule_value; |
160 |
$unitcount = 'n/a'; |
167 |
$unitcount = 'n/a'; |
161 |
} |
168 |
} else { |
162 |
else { |
169 |
print |
163 |
print "No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $patron->categorycode}\n"; |
170 |
"No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $patron->categorycode}\n"; |
164 |
} |
171 |
} |
165 |
} |
172 |
} |
166 |
if (!$amount) { |
173 |
if ( !$amount ) { |
167 |
( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $patron->categorycode, $branchcode, $datedue, $today ); |
174 |
( $amount, $unitcounttotal, $unitcount ) = |
|
|
175 |
CalcFine( $overdue, $patron->categorycode, $branchcode, $datedue, $today ); |
168 |
} |
176 |
} |
169 |
|
177 |
|
170 |
|
|
|
171 |
# Don't update the fine if today is a holiday. |
178 |
# Don't update the fine if today is a holiday. |
172 |
# This ensures that dropbox mode will remove the correct amount of fine. |
179 |
# This ensures that dropbox mode will remove the correct amount of fine. |
173 |
if ( |
180 |
if ( |
174 |
- |
|
|