diff --git a/C4/Circulation/Fines.pm b/C4/Circulation/Fines.pm index 8ff1a96ceb..e7df14a641 100644 --- a/C4/Circulation/Fines.pm +++ b/C4/Circulation/Fines.pm @@ -147,12 +147,12 @@ sub CalcFine { # firstremind, chargeperiod, accountsent, and chargename from the # categoryitem table. - my $sth=$dbh->prepare("Select * from items,biblioitems,itemtypes,categoryitem where items.itemnumber=? + my $sth=$dbh->prepare("Select * from items,biblioitems,itemtypes,issuingrules where items.itemnumber=? and items.biblioitemnumber=biblioitems.biblioitemnumber and biblioitems.itemtype=itemtypes.itemtype and - categoryitem.itemtype=itemtypes.itemtype and - categoryitem.categorycode=? and (items.itemlost <> 1 or items.itemlost is NULL)"); -# print $query; + issuingrules.itemtype=itemtypes.itemtype and + issuingrules.categorycode=? and (items.itemlost <> 1 or items.itemlost is NULL)"); + $sth->execute($itemnumber,$bortype); my $data=$sth->fetchrow_hashref; # FIXME - Error-checking: the item might be lost, or there