Lines 48-54
BEGIN {
Link Here
|
48 |
|
48 |
|
49 |
&GetNextSeq &GetSeq &NewIssue &ItemizeSerials &GetSerials |
49 |
&GetNextSeq &GetSeq &NewIssue &ItemizeSerials &GetSerials |
50 |
&GetLatestSerials &ModSerialStatus &GetNextDate &GetSerials2 |
50 |
&GetLatestSerials &ModSerialStatus &GetNextDate &GetSerials2 |
51 |
&ReNewSubscription &GetLateIssues &GetLateOrMissingIssues |
51 |
&ReNewSubscription &GetLateOrMissingIssues |
52 |
&GetSerialInformation &AddItem2Serial |
52 |
&GetSerialInformation &AddItem2Serial |
53 |
&PrepareSerialsData &GetNextExpected &ModNextExpected |
53 |
&PrepareSerialsData &GetNextExpected &ModNextExpected |
54 |
|
54 |
|
Lines 110-173
sub GetSuppliersWithLateIssues {
Link Here
|
110 |
return $dbh->selectall_arrayref($query, { Slice => {} }); |
110 |
return $dbh->selectall_arrayref($query, { Slice => {} }); |
111 |
} |
111 |
} |
112 |
|
112 |
|
113 |
=head2 GetLateIssues |
|
|
114 |
|
115 |
@issuelist = GetLateIssues($supplierid) |
116 |
|
117 |
this function selects late issues from the database |
118 |
|
119 |
return : |
120 |
the issuelist as an array. Each element of this array contains a hashi_ref containing |
121 |
name,title,planneddate,serialseq,serial.subscriptionid from tables : subscription, serial & biblio |
122 |
|
123 |
=cut |
124 |
|
125 |
sub GetLateIssues { |
126 |
my ($supplierid) = @_; |
127 |
|
128 |
return unless ($supplierid); |
129 |
|
130 |
my $dbh = C4::Context->dbh; |
131 |
my $sth; |
132 |
if ($supplierid) { |
133 |
my $query = qq| |
134 |
SELECT name,title,planneddate,serialseq,serial.subscriptionid |
135 |
FROM subscription |
136 |
LEFT JOIN serial ON subscription.subscriptionid = serial.subscriptionid |
137 |
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber |
138 |
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id |
139 |
WHERE ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3) |
140 |
AND subscription.aqbooksellerid=? |
141 |
AND subscription.closed = 0 |
142 |
ORDER BY title |
143 |
|; |
144 |
$sth = $dbh->prepare($query); |
145 |
$sth->execute($supplierid); |
146 |
} else { |
147 |
my $query = qq| |
148 |
SELECT name,title,planneddate,serialseq,serial.subscriptionid |
149 |
FROM subscription |
150 |
LEFT JOIN serial ON subscription.subscriptionid = serial.subscriptionid |
151 |
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber |
152 |
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id |
153 |
WHERE ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3) |
154 |
AND subscription.closed = 0 |
155 |
ORDER BY title |
156 |
|; |
157 |
$sth = $dbh->prepare($query); |
158 |
$sth->execute; |
159 |
} |
160 |
my @issuelist; |
161 |
my $last_title; |
162 |
while ( my $line = $sth->fetchrow_hashref ) { |
163 |
$line->{title} = "" if $last_title and $line->{title} eq $last_title; |
164 |
$last_title = $line->{title} if ( $line->{title} ); |
165 |
$line->{planneddate} = format_date( $line->{planneddate} ); |
166 |
push @issuelist, $line; |
167 |
} |
168 |
return @issuelist; |
169 |
} |
170 |
|
171 |
=head2 GetSubscriptionHistoryFromSubscriptionId |
113 |
=head2 GetSubscriptionHistoryFromSubscriptionId |
172 |
|
114 |
|
173 |
$history = GetSubscriptionHistoryFromSubscriptionId($subscriptionid); |
115 |
$history = GetSubscriptionHistoryFromSubscriptionId($subscriptionid); |