From d2b2eb603b76816e5ddc3146a688c1e16effe9db Mon Sep 17 00:00:00 2001 From: rangi Date: Wed, 31 Aug 2005 23:11:19 +0000 Subject: [PATCH] Fix for loanlength to make the default length work properly --- C4/Circulation/Circ2.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/C4/Circulation/Circ2.pm b/C4/Circulation/Circ2.pm index 3d7fa29915..657a0c6286 100755 --- a/C4/Circulation/Circ2.pm +++ b/C4/Circulation/Circ2.pm @@ -917,35 +917,35 @@ sub getLoanLength { # check with borrowertype, itemtype and branchcode, then without one of those parameters $sth->execute($borrowertype,$itemtype,$branchcode); my $loanlength = $sth->fetchrow_hashref; - return $loanlength->{issuelength} if defined($loanlength); + return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; $sth->execute($borrowertype,$itemtype,""); my $loanlength = $sth->fetchrow_hashref; - return $loanlength->{issuelength} if defined($loanlength); + return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; $sth->execute($borrowertype,"*",$branchcode); my $loanlength = $sth->fetchrow_hashref; - return $loanlength->{issuelength} if defined($loanlength); + return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; $sth->execute("*",$itemtype,$branchcode); my $loanlength = $sth->fetchrow_hashref; - return $loanlength->{issuelength} if defined($loanlength); + return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; $sth->execute($borrowertype,"*",""); my $loanlength = $sth->fetchrow_hashref; - return $loanlength->{issuelength} if defined($loanlength); + return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; $sth->execute("*","*",$branchcode); my $loanlength = $sth->fetchrow_hashref; - return $loanlength->{issuelength} if defined($loanlength); + return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; $sth->execute("*",$itemtype,""); my $loanlength = $sth->fetchrow_hashref; - return $loanlength->{issuelength} if defined($loanlength); + return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; $sth->execute("*","*",""); my $loanlength = $sth->fetchrow_hashref; - return $loanlength->{issuelength} if defined($loanlength); + return $loanlength->{issuelength} if defined($loanlength) && $loanlength->{issuelength} ne 'NULL'; # if no rule is set => 21 days (hardcoded) return 21; -- 2.39.5