@@ -, +, @@ UpdateNotForLoanStatusOnCheckin 0 : 1 --- C4/Circulation.pm | 4 ++++ admin/itemtypes.pl | 3 +++ 2 files changed, 7 insertions(+) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1934,6 +1934,10 @@ sub AddReturn { } else { foreach my $key ( keys %$rules ) { + # If item type in use has a disabled updatenotforloanstatusoncheckin flag then don't update notforloan + my $updatenotforloanstatusoncheckin = C4::Context->preference("item-level_itypes") ? Koha::ItemTypes->find($item->itype)->updatenotforloanstatusoncheckin : Koha::ItemTypes->find($item->biblioitem->itemtype)->updatenotforloanstatusoncheckin; + last if !$updatenotforloanstatusoncheckin; + if ( $item->notforloan eq $key ) { $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key} }; $item->notforloan($rules->{$key})->store({ log_action => 0 }); --- a/admin/itemtypes.pl +++ a/admin/itemtypes.pl @@ -104,6 +104,7 @@ if ( $op eq 'add_form' ) { my $checkinmsg = $input->param('checkinmsg'); my $checkinmsgtype = $input->param('checkinmsgtype'); my $hideinopac = $input->param('hideinopac') // 0; + my $updatenotforloanstatusoncheckin = $input->param('updatenotforloanstatusoncheckin') // 0; my $searchcategory = $input->param('searchcategory'); my $rentalcharge_daily_calendar = $input->param('rentalcharge_daily_calendar') // 0; my $rentalcharge_hourly_calendar = $input->param('rentalcharge_hourly_calendar') // 0; @@ -122,6 +123,7 @@ if ( $op eq 'add_form' ) { $itemtype->checkinmsgtype($checkinmsgtype); $itemtype->sip_media_type($sip_media_type); $itemtype->hideinopac($hideinopac); + $itemtype->updatenotforloanstatusoncheckin($updatenotforloanstatusoncheckin); $itemtype->searchcategory($searchcategory); $itemtype->rentalcharge_daily_calendar($rentalcharge_daily_calendar); $itemtype->rentalcharge_hourly_calendar($rentalcharge_hourly_calendar); @@ -153,6 +155,7 @@ if ( $op eq 'add_form' ) { checkinmsgtype => $checkinmsgtype, sip_media_type => $sip_media_type, hideinopac => $hideinopac, + updatenotforloanstatusoncheckin => $updatenotforloanstatusoncheckin, searchcategory => $searchcategory, rentalcharge_daily_calendar => $rentalcharge_daily_calendar, rentalcharge_hourly_calendar => $rentalcharge_hourly_calendar, --