$branches->{$hbr}->{PE} and $messages->{'IsPermanent'} = $hbr;
}
# if indy branches and returning to different branch, refuse the return
# if indy branches and returning to different branch, refuse the return unless canreservefromotherbranches is turned on
if ($hbr ne $branch && C4::Context->preference("IndependantBranches")){
if ($hbr ne $branch && C4::Context->preference("IndependantBranches") && !(C4::Context->preference("canreservefromotherbranches"))){
$messages->{'Wrongbranch'} = {
Wrongbranch => $branch,
Rightbranch => $hbr,
-