From 7ff55f6c40b802cb196349b707bd793f69a27968 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Wed, 28 May 2008 18:48:07 +0200 Subject: [PATCH] BUGFIX issuingrules : total for all itemtype was not properly calculated Signed-off-by: Joshua Ferraro --- C4/Circulation.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 6bfd69403b..91a7b77e74 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -445,7 +445,6 @@ sub TooMany { $sth->execute( $cat_borrower, $type, $branch ); my $result = $sth->fetchrow_hashref; # warn "$cat_borrower, $type, $branch = ".Data::Dumper::Dumper($result); - if ( $result->{maxissueqty} ne '' ) { # warn "checking on everything set"; $sth2->execute( $borrower->{'borrowernumber'}, $type ); @@ -457,8 +456,8 @@ sub TooMany { $sth->execute( $cat_borrower, '*', $branch ); my $result = $sth->fetchrow_hashref; if ( $result->{maxissueqty} ne '' ) { - $sth2->execute( $borrower->{'borrowernumber'}, $type ); - my $alreadyissued = $sth2->fetchrow; + $sth3->execute( $borrower->{'borrowernumber'} ); + my $alreadyissued = $sth3->fetchrow; if ( $result->{'maxissueqty'} <= $alreadyissued ) { return ( "$alreadyissued / ".( $result->{maxissueqty} + 0 )." (rule on branch/category/total failed)" ); } @@ -481,8 +480,8 @@ sub TooMany { $sth->execute( '*', '*', $branch ); my $result = $sth->fetchrow_hashref; if ( $result->{maxissueqty} ne '' ) { - $sth2->execute( $borrower->{'borrowernumber'}, $type ); - my $alreadyissued = $sth2->fetchrow; + $sth3->execute( $borrower->{'borrowernumber'} ); + my $alreadyissued = $sth3->fetchrow; if ( $result->{'maxissueqty'} <= $alreadyissued ) { return ( "$alreadyissued / ".( $result->{maxissueqty} + 0 )." (rule on branch / default category / total failed)" ); } @@ -505,8 +504,8 @@ sub TooMany { $sth->execute( $cat_borrower, '*', '*' ); my $result = $sth->fetchrow_hashref; if ( $result->{maxissueqty} ne '' ) { - $sth2->execute( $borrower->{'borrowernumber'}, $type ); - my $alreadyissued = $sth2->fetchrow; + $sth3->execute( $borrower->{'borrowernumber'} ); + my $alreadyissued = $sth3->fetchrow; if ( $result->{'maxissueqty'} <= $alreadyissued ) { return ( "$alreadyissued / ".( $result->{maxissueqty} + 0 )." (rule on default branch / category / total failed)" ); } -- 2.39.5