From d903e7531f4d75021a726035b6bf80e817002988 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 30 Jul 2009 11:27:22 -0400 Subject: [PATCH] bug 3435 followup: tweak AddReturn cleanup We're returning issue information when available, not just item information. Fixes problem where circ/returns.pl wasn't displaying the due date and patron when returning a loan. Signed-off-by: Galen Charlton --- C4/Circulation.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 745ceddcb7..d082002b21 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1524,8 +1524,10 @@ sub AddReturn { } # fix up the overdues in accounts... - my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox); - defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!"; # zero is OK, check defined + if ($borrowernumber) { + my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox); + defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!"; # zero is OK, check defined + } # find reserves..... # if we don't have a reserve with the status W, we launch the Checkreserves routine @@ -1581,7 +1583,7 @@ sub AddReturn { $messages->{'NeedsTransfer'} = 1; # TODO: instead of 1, specify branchcode that the transfer SHOULD go to, $item->{homebranch} } } - return ( $doreturn, $messages, $item, $borrower ); + return ( $doreturn, $messages, $issue, $borrower ); } =head2 MarkIssueReturned -- 2.39.5