[Koha-patches] [PATCH] bug 3435 followup: tweak AddReturn cleanup

Galen Charlton galen.charlton at liblime.com
Thu Jul 30 17:29:19 CEST 2009


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 <galen.charlton at liblime.com>
---
 C4/Circulation.pm |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index 745cedd..d082002 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
-- 
1.5.6.5




More information about the Koha-patches mailing list