From 15fbaea348320f1b568581cfb4677f8d4d742b53 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Sun, 23 Aug 2009 09:53:56 -0400 Subject: [PATCH] bug 3409 followup - fix use of $hbr $hbr in this context is a branch code, not an item field. Also added use of C4::Debug; Signed-off-by: Galen Charlton --- C4/Circulation.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 5edc736603..b1fe99ab61 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -32,6 +32,7 @@ use C4::Calendar; use C4::Accounts; use C4::ItemCirculationAlertPreference; use C4::Message; +use C4::Debug; use Date::Calc qw( Today Today_and_Now @@ -1552,14 +1553,14 @@ 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 ($doreturn and ($branch ne $item->{$hbr}) and not $messages->{'WrongTransfer'} and ($validTransfert ne 1) ){ + if ($doreturn and ($branch ne $hbr) and not $messages->{'WrongTransfer'} and ($validTransfert ne 1) ){ if ( C4::Context->preference("AutomaticItemReturn" ) or (C4::Context->preference("UseBranchTransferLimits") and - ! IsBranchTransferAllowed($branch, $item->{$hbr}, $item->{C4::Context->preference("BranchTransferLimitsType")} ) + ! IsBranchTransferAllowed($branch, $hbr, $item->{C4::Context->preference("BranchTransferLimitsType")} ) )) { - warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->{'itemnumber'},$branch, $item->{$hbr}; - warn "item: " . Dumper($item); - ModItemTransfer($item->{'itemnumber'}, $branch, $item->{$hbr}); + $debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->{'itemnumber'},$branch, $hbr; + $debug and warn "item: " . Dumper($item); + ModItemTransfer($item->{'itemnumber'}, $branch, $hbr); $messages->{'WasTransfered'} = 1; } else { $messages->{'NeedsTransfer'} = 1; # TODO: instead of 1, specify branchcode that the transfer SHOULD go to, $item->{homebranch} -- 2.39.2