Bug 28144: Check if issue_id defined
Historical OVERDUE fines may not have an issue_id - this causes
flooding of the logs when calling update fine
Trivial change, reading the code should be enough, but test plan below
To test:
1 - Create some fines without an issue_id
- Either checkout an old version of Koha and add manually or
- Checkout some items (backdated) to a patron, run fines.pl then
UPDATE accountlines SET issue_id = NULL;
2 - Checkout a backdated item with fines in the circ rule to the same patron
3 - Run fines.pl
4 - Note the errors
5 - Apply patch
6 - Repeat and note no errors
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bf13a36c8a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f76e840970)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This commit is contained in:
parent
b62b66bddc
commit
cf49c5126e
|
|
@ -545,7 +545,7 @@ sub UpdateFine {
|
|||
# - accumulate fines for other items
|
||||
# so we can update $itemnum fine taking in account fine caps
|
||||
while (my $overdue = $overdues->next) {
|
||||
if ( $overdue->issue_id == $issue_id && $overdue->status eq 'UNRETURNED' ) {
|
||||
if ( defined $overdue->issue_id && $overdue->issue_id == $issue_id && $overdue->status eq 'UNRETURNED' ) {
|
||||
if ($accountline) {
|
||||
$debug and warn "Not a unique accountlines record for issue_id $issue_id";
|
||||
#FIXME Should we still count this one in total_amount ??
|
||||
|
|
|
|||
Loading…
Reference in New Issue