diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 2a673f043c..eefc258d59 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1066,11 +1066,6 @@ sub GetLoanLength { return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; - $sth->execute( $borrowertype, $itemtype, "*" ); - $loanlength = $sth->fetchrow_hashref; - return $loanlength->{issuelength} - if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; - $sth->execute( $borrowertype, "*", $branchcode ); $loanlength = $sth->fetchrow_hashref; return $loanlength->{issuelength} @@ -1081,12 +1076,17 @@ sub GetLoanLength { return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; - $sth->execute( $borrowertype, "*", "*" ); + $sth->execute( "*", "*", $branchcode ); $loanlength = $sth->fetchrow_hashref; return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; - $sth->execute( "*", "*", $branchcode ); + $sth->execute( $borrowertype, $itemtype, "*" ); + $loanlength = $sth->fetchrow_hashref; + return $loanlength->{issuelength} + if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; + + $sth->execute( $borrowertype, "*", "*" ); $loanlength = $sth->fetchrow_hashref; return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; @@ -1128,10 +1128,6 @@ sub GetIssuingRule { $irule = $sth->fetchrow_hashref; return $irule if defined($irule) ; - $sth->execute( $borrowertype, $itemtype, "*" ); - $irule = $sth->fetchrow_hashref; - return $irule if defined($irule) ; - $sth->execute( $borrowertype, "*", $branchcode ); $irule = $sth->fetchrow_hashref; return $irule if defined($irule) ; @@ -1140,11 +1136,15 @@ sub GetIssuingRule { $irule = $sth->fetchrow_hashref; return $irule if defined($irule) ; - $sth->execute( $borrowertype, "*", "*" ); + $sth->execute( "*", "*", $branchcode ); $irule = $sth->fetchrow_hashref; return $irule if defined($irule) ; - $sth->execute( "*", "*", $branchcode ); + $sth->execute( $borrowertype, $itemtype, "*" ); + $irule = $sth->fetchrow_hashref; + return $irule if defined($irule) ; + + $sth->execute( $borrowertype, "*", "*" ); $irule = $sth->fetchrow_hashref; return $irule if defined($irule) ; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl index 4bc47cbb41..209b0b4203 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl @@ -35,17 +35,20 @@ $(document).ready(function() {

The rules are applied from most specific to less specific, using the first found in this order:

-

To modify a rule, create a new one with the same borrower type and item type.

+

To modify a rule, create a new one with the same patron type and item type.

- Select a branch : + Select a library :