|
Lines 127-132
for my $overdue ( @{$overdues} ) {
Link Here
|
| 127 |
"ERROR in Getoverdues : issues.borrowernumber IS NULL. Repair 'issues' table now! Skipping record.\n"; |
127 |
"ERROR in Getoverdues : issues.borrowernumber IS NULL. Repair 'issues' table now! Skipping record.\n"; |
| 128 |
next; |
128 |
next; |
| 129 |
} |
129 |
} |
|
|
130 |
|
| 131 |
# if the issue changed before the script got to it, then pass on it. |
| 132 |
my $issue = Koha::Checkouts->find({ issue_id => $overdue->{issue_id} }); |
| 133 |
next if ( ! $issue or $issue->date_due ne $overdue->{date_due} ); |
| 134 |
|
| 135 |
my $datedue = dt_from_string( $overdue->{date_due} ); |
| 136 |
next unless $issue->is_overdue( $datedue ); |
| 137 |
|
| 130 |
my $patron = Koha::Patrons->find( $overdue->{borrowernumber} ); |
138 |
my $patron = Koha::Patrons->find( $overdue->{borrowernumber} ); |
| 131 |
my $branchcode = |
139 |
my $branchcode = |
| 132 |
( $control eq 'ItemHomeLibrary' ) ? $overdue->{homebranch} |
140 |
( $control eq 'ItemHomeLibrary' ) ? $overdue->{homebranch} |
|
Lines 138-147
for my $overdue ( @{$overdues} ) {
Link Here
|
| 138 |
$is_holiday{$branchcode} = set_holiday( $branchcode, $today ); |
146 |
$is_holiday{$branchcode} = set_holiday( $branchcode, $today ); |
| 139 |
} |
147 |
} |
| 140 |
|
148 |
|
| 141 |
my $datedue = dt_from_string( $overdue->{date_due} ); |
|
|
| 142 |
if ( DateTime->compare( $datedue, $today ) == 1 ) { |
| 143 |
next; # not overdue |
| 144 |
} |
| 145 |
++$counted; |
149 |
++$counted; |
| 146 |
|
150 |
|
| 147 |
my ( $amount, $unitcounttotal, $unitcount ) = |
151 |
my ( $amount, $unitcounttotal, $unitcount ) = |
|
Lines 157-165
for my $overdue ( @{$overdues} ) {
Link Here
|
| 157 |
&& ( $amount && $amount > 0 ) |
161 |
&& ( $amount && $amount > 0 ) |
| 158 |
) |
162 |
) |
| 159 |
{ |
163 |
{ |
| 160 |
# if the issue changed before the script got to it, then pass on it. |
|
|
| 161 |
my $issue = Koha::Checkouts->find({ issue_id => $overdue->{issue_id} }); |
| 162 |
next if ( ! $issue or $issue->date_due ne $overdue->{date_due} ); |
| 163 |
UpdateFine( |
164 |
UpdateFine( |
| 164 |
{ |
165 |
{ |
| 165 |
issue_id => $overdue->{issue_id}, |
166 |
issue_id => $overdue->{issue_id}, |
| 166 |
- |
|
|