Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
my $behaviour = C4::Context->preference( 'RefundLostOnReturnControl' ) // 'CheckinLibrary';
my $behaviour_mapping = {
- CheckinLibrary => $params->{'return_branch'},
- ItemHomeBranch => $item->homebranch,
+ CheckinLibrary => $params->{'return_branch'} // $item->homebranch,
+ ItemHomeBranch => $item->homebranch,
ItemHoldingBranch => $item->holdingbranch
};
return $self
unless Koha::CirculationRules->get_lostreturn_policy(
{
- current_branch => C4::Context->userenv->{branch},
- item => $self,
+ item => $self,
+ return_branch => C4::Context->userenv
+ ? C4::Context->userenv->{'branch'}
+ : undef,
}
);