Lines 131-141
for my $overdue ( @{$overdues} ) {
Link Here
|
131 |
( $control eq 'ItemHomeLibrary' ) ? $overdue->{homebranch} |
131 |
( $control eq 'ItemHomeLibrary' ) ? $overdue->{homebranch} |
132 |
: ( $control eq 'PatronLibrary' ) ? $patron->branchcode |
132 |
: ( $control eq 'PatronLibrary' ) ? $patron->branchcode |
133 |
: $overdue->{branchcode}; |
133 |
: $overdue->{branchcode}; |
134 |
|
134 |
# In final case, CircControl must be PickupLibrary. (branchcode comes from issues table here). |
135 |
# In final case, CircControl must be PickupLibrary. (branchcode comes from issues table here). |
|
|
136 |
if ( !exists $is_holiday{$branchcode} ) { |
137 |
$is_holiday{$branchcode} = set_holiday( $branchcode, $today ); |
138 |
} |
139 |
|
135 |
|
140 |
my $datedue = dt_from_string( $overdue->{date_due} ); |
136 |
my $datedue = dt_from_string( $overdue->{date_due} ); |
141 |
if ( DateTime->compare( $datedue, $today ) == 1 ) { |
137 |
if ( DateTime->compare( $datedue, $today ) == 1 ) { |
Lines 147-155
for my $overdue ( @{$overdues} ) {
Link Here
|
147 |
CalcFine( $overdue, $patron->categorycode, |
143 |
CalcFine( $overdue, $patron->categorycode, |
148 |
$branchcode, $datedue, $today ); |
144 |
$branchcode, $datedue, $today ); |
149 |
|
145 |
|
150 |
# Don't update the fine if today is a holiday. |
146 |
if ( $mode eq 'production' ) { |
151 |
# This ensures that dropbox mode will remove the correct amount of fine. |
|
|
152 |
if ( $mode eq 'production' && !$is_holiday{$branchcode} ) { |
153 |
if ( $amount && $amount > 0 ) { |
147 |
if ( $amount && $amount > 0 ) { |
154 |
UpdateFine( |
148 |
UpdateFine( |
155 |
{ |
149 |
{ |
Lines 193-205
Number of Overdue Items:
Link Here
|
193 |
EOM |
187 |
EOM |
194 |
} |
188 |
} |
195 |
|
189 |
|
196 |
sub set_holiday { |
|
|
197 |
my ( $branch, $dt ) = @_; |
198 |
|
199 |
my $calendar = Koha::Calendar->new( branchcode => $branch ); |
200 |
return $calendar->is_holiday($dt); |
201 |
} |
202 |
|
203 |
sub get_filename { |
190 |
sub get_filename { |
204 |
my $directory = shift; |
191 |
my $directory = shift; |
205 |
if ( !$directory ) { |
192 |
if ( !$directory ) { |
206 |
- |
|
|