The code was modified to change the holding branch ONLY if the return to the
right branch is done. If you set IndependantBranch to on, you must return the
document to the HomeBranch.
And verify the return is done before show the message that allow to transfert
the document to another branch.
---
C4/Circulation.pm | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index ca52e27..432a519 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -1352,22 +1352,23 @@ sub AddReturn {
}
MarkIssueReturned($borrower->{'borrowernumber'},
$iteminformation->{'itemnumber'},$circControlBranch);
$messages->{'WasReturned'} = 1; # FIXME is the "= 1" right?
- }
-
- # continue to deal with returns cases, but not only if we have an issue
+
- # the holdingbranch is updated if the document is returned in an other
location .
- if ( $iteminformation->{'holdingbranch'} ne
C4::Context->userenv->{'branch'} ) {
-
UpdateHoldingbranch(C4::Context->userenv->{'branch'},$iteminformation->{'itemnumber'});
- # reload iteminformation holdingbranch
with the userenv value
- $iteminformation->{'holdingbranch'} =
C4::Context->userenv->{'branch'};
+ # continue to deal with returns cases, but not only if we have an
issue
+
+ # the holdingbranch is updated if the document is returned in an
other location .
+ if ( $iteminformation->{'holdingbranch'} ne
C4::Context->userenv->{'branch'} ) {
+
UpdateHoldingbranch(C4::Context->userenv->{'branch'},$iteminformation->{'itemnumber'});
+ # reload iteminformation holdingbranch
with the userenv value
+ $iteminformation->{'holdingbranch'} =
C4::Context->userenv->{'branch'};
+ }
+ ModDateLastSeen( $iteminformation->{'itemnumber'} );
+ ModItem({ onloan => undef }, $biblio->{'biblionumber'},
$iteminformation->{'itemnumber'});
+
+ if ($iteminformation->{borrowernumber}){
+ ($borrower) = C4::Members::GetMemberDetails(
$iteminformation->{borrowernumber}, 0 );
+ }
}
- ModDateLastSeen( $iteminformation->{'itemnumber'} );
- ModItem({ onloan => undef }, $biblio->{'biblionumber'},
$iteminformation->{'itemnumber'});
-
- if ($iteminformation->{borrowernumber}){
- ($borrower) = C4::Members::GetMemberDetails(
$iteminformation->{borrowernumber}, 0 );
- }
# fix up the accounts.....
if ( $iteminformation->{'itemlost'} ) {
$messages->{'WasLost'} = 1;
@@ -1431,7 +1432,7 @@ sub AddReturn {
#adding message if holdingbranch is non equal a userenv branch to
return the document to homebranch
#we check, if we don't have reserv or transfert for this document, if
not, return it to homebranch .
- if ( ($iteminformation->{'holdingbranch'} ne
$iteminformation->{'homebranch'}) and not $messages->{'WrongTransfer'} and
($validTransfert ne 1) and ($reserveDone ne 1) ){
+ if ($doreturn and ($iteminformation->{'holdingbranch'} ne
$iteminformation->{'homebranch'}) and not $messages->{'WrongTransfer'} and
($validTransfert ne 1) and ($reserveDone ne 1) ){
if (C4::Context->preference("AutomaticItemReturn") ==
1) {
ModItemTransfer($iteminformation->{'itemnumber'},
C4::Context->userenv->{'branch'}, $iteminformation->{'homebranch'});
$messages->{'WasTransfered'} = 1;
--
1.5.6.3
_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches