Lines 2138-2144
sub AddReturn {
Link Here
|
2138 |
my $patron_unblessed = $patron ? $patron->unblessed : {}; |
2138 |
my $patron_unblessed = $patron ? $patron->unblessed : {}; |
2139 |
|
2139 |
|
2140 |
my $update_loc_rules = C4::Context->yaml_preference('UpdateItemLocationOnCheckin'); |
2140 |
my $update_loc_rules = C4::Context->yaml_preference('UpdateItemLocationOnCheckin'); |
2141 |
map { $update_loc_rules->{$_} = $update_loc_rules->{$_}[0] } keys %$update_loc_rules; #We can only move to one location so we flatten the arrays |
|
|
2142 |
if ($update_loc_rules) { |
2141 |
if ($update_loc_rules) { |
2143 |
if (defined $update_loc_rules->{_ALL_}) { |
2142 |
if (defined $update_loc_rules->{_ALL_}) { |
2144 |
if ($update_loc_rules->{_ALL_} eq '_PERM_') { $update_loc_rules->{_ALL_} = $item->permanent_location; } |
2143 |
if ($update_loc_rules->{_ALL_} eq '_PERM_') { $update_loc_rules->{_ALL_} = $item->permanent_location; } |
Lines 2154-2161
sub AddReturn {
Link Here
|
2154 |
else { |
2153 |
else { |
2155 |
foreach my $key ( keys %$update_loc_rules ) { |
2154 |
foreach my $key ( keys %$update_loc_rules ) { |
2156 |
if ( $update_loc_rules->{$key} eq '_PERM_' ) { $update_loc_rules->{$key} = $item->permanent_location; } |
2155 |
if ( $update_loc_rules->{$key} eq '_PERM_' ) { $update_loc_rules->{$key} = $item->permanent_location; } |
2157 |
if ( $update_loc_rules->{$key} eq '_BLANK_') { $update_loc_rules->{$key} = '' ;} |
2156 |
elsif ( $update_loc_rules->{$key} eq '_BLANK_') { $update_loc_rules->{$key} = '' ;} |
2158 |
if ( ($item->location eq $key && $item->location ne $update_loc_rules->{$key}) || ($key eq '_BLANK_' && $item->location eq '' && $update_loc_rules->{$key} ne '') ) { |
2157 |
if ( (defined $item->location && $item->location eq $key && $item->location ne $update_loc_rules->{$key}) || ($key eq '_BLANK_' && ( !defined $item->location || $item->location eq '' ) && $update_loc_rules->{$key} ne '') ) { |
2159 |
$messages->{'ItemLocationUpdated'} = { from => $item->location, to => $update_loc_rules->{$key} }; |
2158 |
$messages->{'ItemLocationUpdated'} = { from => $item->location, to => $update_loc_rules->{$key} }; |
2160 |
$item->location($update_loc_rules->{$key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1}); |
2159 |
$item->location($update_loc_rules->{$key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1}); |
2161 |
last; |
2160 |
last; |
2162 |
- |
|
|