$VERSION = 0.01;
@ISA = qw(Exporter);
-@EXPORT = qw(&getbranches &getprinters &getpatroninformation ¤tissues &getiteminformation &findborrower &issuebook &returnbook);
+@EXPORT = qw(&getbranches &getprinters &getpatroninformation ¤tissues &getiteminformation &findborrower &issuebook &returnbook
+&find_reserves);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
# your exported package globals go here,
$usth = $dbh->prepare($uquery);
$usth->execute;
$usth->finish;
- $uquery="update items set itemnotes='' where itemnumber=$iteminformation->{'itemnumber'}";
+ $uquery="update items set paidfor='' where itemnumber=$iteminformation->{'itemnumber'}";
$usth = $dbh->prepare($uquery);
$usth->execute;
$usth->finish;
my $resfound = "n";
my $resrec;
my $lastrec;
+# print $query;
while (($resrec=$sth->fetchrow_hashref) && ($resfound eq "n")) {
$lastrec=$resrec;
if ($resrec->{'found'} eq "W") {
if ($resrec->{'itemnumber'} eq $itemno) {
$resfound = "y";
- }
- }
- if ($resrec->{'constrainttype'} eq "a") {
- $resfound = "y";
+ }
} else {
- my $conquery = "select * from reserveconstraints where borrowernumber
-= $resrec->{'borrowernumber'} and reservedate = '$resrec->{'reservedate'}' and biblionumber = $resrec->{'biblionumber'} and biblioitemnumber = $itemdata->{'biblioitemnumber'}";
- my $consth = $dbh->prepare($conquery);
- $consth->execute;
- if (my $conrec=$consth->fetchrow_hashref) {
- if ($resrec->{'constrainttype'} eq "o") {
- $resfound = "y";
- }
+ if ($resrec->{'constrainttype'} eq "a") {
+ $resfound = "y";
} else {
- if ($resrec->{'constrainttype'} eq "e") {
- $resfound = "y";
- }
+ my $conquery = "select * from reserveconstraints where borrowernumber
+= $resrec->{'borrowernumber'} and reservedate = '$resrec->{'reservedate'}' and biblionumber = $resrec->{'biblionumber'} and biblioitemnumber = $itemdata->{'biblioitemnumber'}";
+ my $consth = $dbh->prepare($conquery);
+ $consth->execute;
+ if (my $conrec=$consth->fetchrow_hashref) {
+ if ($resrec->{'constrainttype'} eq "o") {
+ $resfound = "y";
+ }
+ } else {
+ if ($resrec->{'constrainttype'} eq "e") {
+ $resfound = "y";
+ }
+ }
+ $consth->finish;
}
- $consth->finish;
}
if ($resfound eq "y") {
my $updquery = "update reserves
sub FindReserves {
my ($bib,$bor)=@_;
my $dbh=C4Connect;
- my $query="Select *,reserves.branchcode
+ my $query="Select *,reserves.branchcode,biblio.title as btitle
from reserves,borrowers,biblio ";
if ($bib ne ''){
if ($bor ne ''){
}
$x++;
}
- if ($const eq 'o') {if ($found == 1) {push @biblioitems,$data;}
- } else {if ($found == 0) {push @biblioitems,$data;} }
+ if ($const eq 'o') {
+ if ( $found == 1) {
+ push @biblioitems,$data1;
+ }
+ } else {
+ if ($found == 0) {
+ push @biblioitems,$data1;
+ }
+ }
}
}
$sth1->finish;
while (my $itdata=$sth2->fetchrow_hashref) {
my $query3 = "select * from issues
where itemnumber = '$itdata->{'itemnumber'}' and
- returndate is null";
+ returndate is null";
+
my $sth3 = $dbh->prepare($query3);
$sth3->execute();
- if (my $isdata=$sth3->fetchrow_hashref) { } else
- {$allissued = 0; }
+ if (my $isdata=$sth3->fetchrow_hashref) {
+ } else {
+ $allissued = 0;
+ }
}
$x++;
}
where biblionumber = '$biblionumber'";
my $rsth = $dbh->prepare($rquery);
$rsth->execute();
- if (my $rdata = $rsth->fetchrow_hashref) { } else {
+ if (my $rdata = $rsth->fetchrow_hashref) {
+ } else {
$fee = 0;
}
}