$hbr in this context is a branch code, not an item field. Also added use of C4::Debug;
Signed-off-by: Galen Charlton <[email protected]> --- C4/Circulation.pm | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 5edc736..b1fe99a 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} -- 1.6.3.3 _______________________________________________ Koha-patches mailing list [email protected] http://lists.koha.org/mailman/listinfo/koha-patches
