diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 7faa2e9f21..171651cdb3 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -563,7 +563,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 ( defined $overdue->issue_id && $overdue->issue_id == $issue_id && $overdue->status eq 'UNRETURNED' ) { + if ( defined $overdue->checkout && $overdue->checkout->issue_id == $issue_id && $overdue->status eq 'UNRETURNED' ) { if ($accountline) { Koha::Logger->get->debug("Not a unique accountlines record for issue_id $issue_id"); # FIXME Do we really need to log that? #FIXME Should we still count this one in total_amount ?? diff --git a/Koha/Item.pm b/Koha/Item.pm index a5abbbbcbf..902dd7dcdc 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -1591,7 +1591,7 @@ sub _set_found_trigger { interface => C4::Context->interface, library_id => $branchcode, item_id => $self->itemnumber, - issue_id => $lost_charge->issue_id + issue_id => $lost_charge->checkout ? $lost_charge->checkout->issue_id : undef, } ); @@ -1747,7 +1747,7 @@ sub _set_found_trigger { interface => C4::Context->interface, library_id => $branchcode, item_id => $self->itemnumber, - issue_id => $processing_charge->issue_id + issue_id => $processing_charge->checkout ? $processing_charge->checkout->issue_id : undef, } );