@@ -, +, @@ branch --- admin/smart-rules.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/admin/smart-rules.pl +++ a/admin/smart-rules.pl @@ -739,12 +739,12 @@ my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['des my $itemtypes = Koha::ItemTypes->search_with_localization; +my $humanbranch = ( $branch ne '*' ? $branch : undef ); + my @used_categorycodes = - Koha::CirculationRules->search( {}, { columns => ['categorycode'], distinct => 1, } )->get_column('categorycode'); + Koha::CirculationRules->search( { branchcode => $humanbranch }, { columns => ['categorycode'], distinct => 1, } )->get_column('categorycode'); my @used_itemtypes = - Koha::CirculationRules->search( {}, { columns => ['itemtype'], distinct => 1, } )->get_column('itemtype'); - -my $humanbranch = ( $branch ne '*' ? $branch : undef ); + Koha::CirculationRules->search( { branchcode => $humanbranch }, { columns => ['itemtype'], distinct => 1, } )->get_column('itemtype'); my $all_rules = Koha::CirculationRules->search({ branchcode => $humanbranch }); my $definedbranch = $all_rules->count ? 1 : 0; --