|
|
@ -61,14 +61,18 @@ my $priv_func = sub { |
|
|
|
sub pastitems{ |
|
|
|
#Get list of all items borrower has currently on issue |
|
|
|
my ($env,$bornum,$dbh)=@_; |
|
|
|
my $sth=$dbh->prepare("Select * from issues,items,biblio,biblioitems |
|
|
|
where (borrowernumber=$bornum |
|
|
|
and (returndate is null) |
|
|
|
and ((issues.itemnumber=items.itemnumber) |
|
|
|
and items.biblionumber=biblio.biblionumber |
|
|
|
and biblioitems.biblioitemnumber=items.biblioitemnumber)) |
|
|
|
order by date_due"); |
|
|
|
my $query1 = "select * from issues where (borrowernumber=$bornum |
|
|
|
and (returndate is null) order by date_due"; |
|
|
|
my $sth=$dbh->prepare($query1); |
|
|
|
$sth->execute; |
|
|
|
#my $sth=$dbh->prepare("Select * from issues,items,biblio,biblioitems |
|
|
|
# where (borrowernumber=$bornum |
|
|
|
# and (returndate is null) |
|
|
|
# and ((issues.itemnumber=items.itemnumber) |
|
|
|
# and items.biblionumber=biblio.biblionumber |
|
|
|
# and biblioitems.biblioitemnumber=items.biblioitemnumber)) |
|
|
|
# order by date_due"); |
|
|
|
#$sth->execute; |
|
|
|
my $i=0; |
|
|
|
my @items; |
|
|
|
my @items2; |
|
|
@ -76,11 +80,13 @@ sub pastitems{ |
|
|
|
#$items2[0]=" "x29; |
|
|
|
$items[0]=" "x72; |
|
|
|
$items2[0]=" "x72; |
|
|
|
while (my $data=$sth->fetchrow_hashref) { |
|
|
|
my $line = C4::Circulation::Issues::formatitem($env,$data,$data->{'date_due'},""); |
|
|
|
while (my $data1=$sth->fetchrow_hashref) { |
|
|
|
my $data = itemnodata($env,$data,$data1->{'itemnumber'}; |
|
|
|
my $line = C4::Circulation::Issues::formatitem($env,$data,$data1->{'date_due'},""); |
|
|
|
$items[$i]=$line; |
|
|
|
$i++; |
|
|
|
} |
|
|
|
$sth->finish(); |
|
|
|
return(\@items,\@items2); |
|
|
|
} |
|
|
|
|
|
|
|