@@ -, +, @@ UpdateNotForLoanStatusOnCheckin -1: 0 -1: 0 -1: 0 -1: 0 1: 0 --- C4/Circulation.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2141,10 +2141,16 @@ sub AddReturn { } else { foreach my $key ( keys %$rules ) { - if ( $item->notforloan eq $key ) { - $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key} }; - $item->notforloan($rules->{$key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1 }); - last; + + # Check and apply rules for the item type being returned + if ( $item->itype eq $key ) { + foreach my $itype_rule_key ( keys %{ $rules->{$key}} ) { + if ( $item->notforloan eq $itype_rule_key ) { + $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key}->{$itype_rule_key} }; + $item->notforloan($rules->{$key}->{$itype_rule_key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1 }); + last; + } + } } } } --