Bug 35293: (follow-up) Handle all rules as well

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Nick Clemens 2024-01-04 19:03:11 +00:00 committed by Katrin Fischer
parent a0f83767a8
commit 26e7d0c9b3
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -2228,7 +2228,9 @@ sub AddReturn {
foreach my $notloan_rule_key (keys %{ $rules->{$item->itype}} ) {
if ( $item->notforloan eq $notloan_rule_key ) {
$messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$item->itype}->{$notloan_rule_key} };
$item->notforloan($rules->{$item->itype}->{$notloan_rule_key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1 }) unless $rules->{$item->itype}->{$notloan_rule_key} eq 'ONLYMESSAGE';
$item->notforloan( $rules->{ $item->itype }->{$notloan_rule_key} )
->store( { log_action => 0, skip_record_index => 1, skip_holds_queue => 1 } )
unless $rules->{ $item->itype }->{$notloan_rule_key} eq 'ONLYMESSAGE';
last;
}
}
@ -2236,7 +2238,9 @@ sub AddReturn {
foreach my $notloan_rule_key (keys %{ $rules->{'_ALL_'}} ) {
if ( $item->notforloan eq $notloan_rule_key ) {
$messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{'_ALL_'}->{$notloan_rule_key} };
$item->notforloan($rules->{'_ALL_'}->{$notloan_rule_key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1 });
$item->notforloan( $rules->{'_ALL_'}->{$notloan_rule_key} )
->store( { log_action => 0, skip_record_index => 1, skip_holds_queue => 1 } )
unless $rules->{ '_ALL_' }->{$notloan_rule_key} eq 'ONLYMESSAGE';
last;
}
}