@@ -, +, @@ records' items available for loan, and the third record's items not for loan. in the search results list. --- C4/Search.pm | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) --- a/C4/Search.pm +++ a/C4/Search.pm @@ -1520,12 +1520,13 @@ sub buildQuery { foreach my $this_limit (@limits) { next unless $this_limit; if ( $this_limit =~ /available/ ) { -# -## 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) -## In English: -## all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 + + + # 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) and ( items.notforloan = 0 ) + # In English: + # all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0, and notforloan equal to 0 $availability_limit .= -"( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )"; #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; + "( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='' ) and ( lost,st-numeric = 0 ) and ( notforloan,st-numeric = 0 ) )"; $limit_cgi .= "&limit=available"; $limit_desc .= ""; } --