79 |
WHERE subscription.subscriptionid = serial.subscriptionid AND |
WHERE subscription.subscriptionid = serial.subscriptionid AND |
80 |
((planneddate < now() and serial.STATUS =1) OR serial.STATUS = 3) and |
((planneddate < now() and serial.STATUS =1) OR serial.STATUS = 3) and |
81 |
subscription.aqbooksellerid=$supplierid and |
subscription.aqbooksellerid=$supplierid and |
82 |
biblio.biblionumber = subscription.biblionumber |
biblio.biblionumber = subscription.biblionumber order by title |
83 |
"); |
"); |
84 |
} else { |
} else { |
85 |
$sth = $dbh->prepare("SELECT name,title,planneddate,serialseq,serial.subscriptionid |
$sth = $dbh->prepare("SELECT name,title,planneddate,serialseq,serial.subscriptionid |
87 |
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id |
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id |
88 |
WHERE subscription.subscriptionid = serial.subscriptionid AND |
WHERE subscription.subscriptionid = serial.subscriptionid AND |
89 |
((planneddate < now() and serial.STATUS <=3) OR serial.STATUS = 3) and |
((planneddate < now() and serial.STATUS <=3) OR serial.STATUS = 3) and |
90 |
biblio.biblionumber = subscription.biblionumber |
biblio.biblionumber = subscription.biblionumber order by title |
91 |
"); |
"); |
92 |
} |
} |
93 |
$sth->execute; |
$sth->execute; |
94 |
my @issuelist; |
my @issuelist; |
95 |
my $last_title; |
my $last_title; |
96 |
|
my $odd=0; |
97 |
while (my $line = $sth->fetchrow_hashref) { |
while (my $line = $sth->fetchrow_hashref) { |
98 |
|
$odd++ unless $line->{title} eq $last_title; |
99 |
$line->{title} = "" if $line->{title} eq $last_title; |
$line->{title} = "" if $line->{title} eq $last_title; |
100 |
$last_title = $line->{title} if ($line->{title}); |
$last_title = $line->{title} if ($line->{title}); |
101 |
$line->{planneddate} = format_date($line->{planneddate}); |
$line->{planneddate} = format_date($line->{planneddate}); |
102 |
|
$line->{'odd'} = 1 if $odd %2 ; |
103 |
push @issuelist,$line; |
push @issuelist,$line; |
104 |
} |
} |
105 |
return @issuelist; |
return @issuelist; |
299 |
my $dbh = C4::Context->dbh; |
my $dbh = C4::Context->dbh; |
300 |
my $sth; |
my $sth; |
301 |
if ($biblionumber) { |
if ($biblionumber) { |
302 |
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=?"); |
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=? order by title"); |
303 |
$sth->execute($biblionumber); |
$sth->execute($biblionumber); |
304 |
} else { |
} else { |
305 |
if ($ISSN and $title) |
if ($ISSN and $title) |
306 |
{ |
{ |
307 |
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? )"); |
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? order by title )"); |
308 |
$sth->execute("%$title%",$ISSN); |
$sth->execute("%$title%",$ISSN); |
309 |
} |
} |
310 |
else |
else |
311 |
{ |
{ |
312 |
if ($ISSN) |
if ($ISSN) |
313 |
{ |
{ |
314 |
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblioitems.issn = ?"); |
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblioitems.issn = ? order by title"); |
315 |
$sth->execute($ISSN); |
$sth->execute($ISSN); |
316 |
} |
} |
317 |
else |
else |
318 |
{ |
{ |
319 |
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and |
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and |
320 |
biblio.biblionumber=subscription.biblionumber and biblio.title like ? "); |
biblio.biblionumber=subscription.biblionumber and biblio.title like ? order by title"); |
321 |
$sth->execute("%$title%"); |
$sth->execute("%$title%"); |
322 |
} |
} |
323 |
} |
} |