[Koha-bugs] [Bug 1001] New: Issuing Rules Error

bugzilla-daemon at wilbur.katipo.co.nz bugzilla-daemon at wilbur.katipo.co.nz
Tue Jul 12 20:49:25 CEST 2005


http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=1001

           Summary: Issuing Rules Error
           Product: Koha
           Version: 2.2.0
          Platform: PC
               URL: http://article.gmane.org/gmane.comp.misc.koha/4814
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Circulation
        AssignedTo: chris at katipo.co.nz
        ReportedBy: mjr at ttllp.co.uk
         QAContact: koha-bugs at lists.sourceforge.net


Mailing list report from Sandra Smith:

"I am testing out the functions of a borrower group and I get this warning

Too many issues /already issued / max a 0 / 0

I have checked the parameters and changed them to 99,99 on the * area.

But even when the issuing rules were set to 99,99 for just that type of item I
received the same error but that time it was c / 0."

Suggested bugfix is at the URL given in this report. I've not seen a reply
on-list, so I'm copying it here:

sub TooMany ($$){
        my $borrower = shift;
        my $iteminformation = shift;
        my $cat_borrower = $borrower->{'categorycode'};
        my $branch_borrower = $borrower->{'branchcode'};
        my $dbh = C4::Context->dbh;

        my $sth = $dbh->prepare('select itemtype from biblioitems where
biblionumber = ?');
        $sth->execute($iteminformation->{'biblionumber'});
        my $type = $sth->fetchrow;
        $sth = $dbh->prepare('select * from issuingrules where
categorycode = ? and itemtype = ? and branchcode = ?');
        my $sth2 = $dbh->prepare("select COUNT(*) from issues i,
biblioitems s where i.borrowernumber = ? and i.returndate is null
and i.itemnumber = s.biblioitemnumber and s.itemtype like ?");
        my $sth3 = $dbh->prepare('select COUNT(*) from issues where
borrowernumber = ? and returndate is null');
        my $alreadyissued;
        # check the 3 parameters
        $sth->execute($cat_borrower, $type, $branch_borrower);
        my $result = $sth->fetchrow_hashref;
        my $cnt_f = $DBI::rows;

#        return("==>".$result->{maxissueqty}.$cnt_f);

#        return("==>".$result->{maxissueqty});
#       warn "==>".$result->{maxissueqty};
        if (defined($result)) {
                $sth2->execute($borrower->{'borrowernumber'}, "%$type%");
                my $alreadyissued = $sth2->fetchrow;
                return ("a $alreadyissued / ".($result->{maxissueqty}+0))
if ($result->{'maxissueqty'} <= $alreadyissued);
                return;
        }
        # check for branch=*
        $sth->execute($cat_borrower, $type, "");
        my $result = $sth->fetchrow_hashref;
        if (defined($result)) {
                $sth2->execute($borrower->{'borrowernumber'}, "%$type%");
                my $alreadyissued = $sth2->fetchrow;
                return ("b $alreadyissued / ".($result->{maxissueqty}+0))
if ($result->{'maxissueqty'} <= $alreadyissued);
                return;
        }
        # check for itemtype=*
        $sth->execute($cat_borrower, "*", $branch_borrower);
        my $result = $sth->fetchrow_hashref;
        if (defined($result)) {
                $sth3->execute($borrower->{'borrowernumber'});
                my $alreadyissued = $sth2->fetchrow;
          return ("c $alreadyissued / ".($result->{maxissueqty}+0)) if
($result->{'maxissueqty'} <= $alreadyissued);
                return;
        }
        #check for borrowertype=*
        $sth->execute("*", $type, $branch_borrower);
        my $result = $sth->fetchrow_hashref;
        if (defined($result)) {
                $sth2->execute($borrower->{'borrowernumber'}, "%$type%");
                my $alreadyissued = $sth2->fetchrow;
                return ("d $alreadyissued / ".($result->{maxissueqty}+0))
if ($result->{'maxissueqty'} <= $alreadyissued);
                return;
        }

        $sth->execute("*", "*", $branch_borrower);
        my $result = $sth->fetchrow_hashref;
        if (defined($result)) {
                $sth3->execute($borrower->{'borrowernumber'});
                my $alreadyissued = $sth2->fetchrow;
                return ("e $alreadyissued / ".($result->{maxissueqty}+0))
if ($result->{'maxissueqty'} <= $alreadyissued);
                return;
        }

        $sth->execute("*", $type, "");
        my $result = $sth->fetchrow_hashref;
        if (defined($result) && $result->{maxissueqty}>=0) {
                $sth2->execute($borrower->{'borrowernumber'}, "%$type%");
                my $alreadyissued = $sth2->fetchrow;
                return ("f $alreadyissued / ".($result->{maxissueqty}+0))
if ($result->{'maxissueqty'} <= $alreadyissued);
                return;
        }
               return;
        }

        $sth->execute($cat_borrower, "*", "");
        my $result = $sth->fetchrow_hashref;
        if (defined($result)) {
                $sth2->execute($borrower->{'borrowernumber'}, "%$type%");
                my $alreadyissued = $sth2->fetchrow;
                return ("g $alreadyissued / ".($result->{maxissueqty}+0))
if ($result->{'maxissueqty'} <= $alreadyissued);
                return;
        }

        $sth->execute("*", "*", "");
        my $result = $sth->fetchrow_hashref;
        if (defined($result)) {
                $sth3->execute($borrower->{'borrowernumber'});
                my $alreadyissued = $sth2->fetchrow;
                return ("h $alreadyissued / ".($result->{maxissueqty}+0))
if ($result->{'maxissueqty'} <= $alreadyissued);
                return;
        }
        return;
}



------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.




More information about the Koha-bugs mailing list