From 3393c9dc5fa80fde61b19e604096f1da852cc40f Mon Sep 17 00:00:00 2001 From: genji Date: Sun, 28 Jan 2007 01:29:28 +0000 Subject: [PATCH] Bug 1201 fixed by changing transferbook. Books will no longer be returned by transferbook. Thus, breaking the loop. Transfer book should be used when transfering books from branch to branch. if a book is returned at a branch, transfer the book there. if a book is transfered to a branch, while its on loan, set holding to the new branch. Useful if a borrower moves branches, while borrowing books. --- C4/Circulation/Circ2.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/C4/Circulation/Circ2.pm b/C4/Circulation/Circ2.pm index 0b331aec80..8e127e0964 100755 --- a/C4/Circulation/Circ2.pm +++ b/C4/Circulation/Circ2.pm @@ -428,7 +428,7 @@ The item was eligible to be transferred. Barring problems communicating with the #' # FIXME - This function tries to do too much, and its API is clumsy. # If it didn't also return books, it could be used to change the home -# branch of a book while the book is on loan. +# branch of a book while the book is on loan. - Your idea, my fix. # # Is there any point in returning the item information? The caller can # look that up elsewhere if ve cares. @@ -466,12 +466,15 @@ sub transferbook { $messages->{'DestinationEqualsHolding'} = 1; $dotransfer = 0; } - # check if it is still issued to someone, return it... - my ($currentborrower) = currentborrower($iteminformation->{'itemnumber'}); - if ($currentborrower) { - returnbook($barcode, $fbr); - $messages->{'WasReturned'} = $currentborrower; - } + # Depreciated - check if it is still issued to someone, return it... + # returnbook here, sends it into a loop. And, by doing this, it enables + # this sub to be used to transfer books between branches while the book is + # on loan. +# my ($currentborrower) = currentborrower($iteminformation->{'itemnumber'}); +# if ($currentborrower) { +# returnbook($barcode, $fbr); +# $messages->{'WasReturned'} = $currentborrower; +# } # find reserves..... # FIXME - Don't call &CheckReserves unless $ignoreRs is true. # That'll save a database query.