Bug 12850: C4::Serials::GetLateIssues can be removed
This routine is not used and can be removed. Test plan: git grep GetLateIssues should not return any result Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
91f67dde13
commit
8b19fd4b0d
2 changed files with 2 additions and 62 deletions
|
@ -48,7 +48,7 @@ BEGIN {
|
|||
|
||||
&GetNextSeq &GetSeq &NewIssue &ItemizeSerials &GetSerials
|
||||
&GetLatestSerials &ModSerialStatus &GetNextDate &GetSerials2
|
||||
&ReNewSubscription &GetLateIssues &GetLateOrMissingIssues
|
||||
&ReNewSubscription &GetLateOrMissingIssues
|
||||
&GetSerialInformation &AddItem2Serial
|
||||
&PrepareSerialsData &GetNextExpected &ModNextExpected
|
||||
|
||||
|
@ -110,64 +110,6 @@ sub GetSuppliersWithLateIssues {
|
|||
return $dbh->selectall_arrayref($query, { Slice => {} });
|
||||
}
|
||||
|
||||
=head2 GetLateIssues
|
||||
|
||||
@issuelist = GetLateIssues($supplierid)
|
||||
|
||||
this function selects late issues from the database
|
||||
|
||||
return :
|
||||
the issuelist as an array. Each element of this array contains a hashi_ref containing
|
||||
name,title,planneddate,serialseq,serial.subscriptionid from tables : subscription, serial & biblio
|
||||
|
||||
=cut
|
||||
|
||||
sub GetLateIssues {
|
||||
my ($supplierid) = @_;
|
||||
|
||||
return unless ($supplierid);
|
||||
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth;
|
||||
if ($supplierid) {
|
||||
my $query = qq|
|
||||
SELECT name,title,planneddate,serialseq,serial.subscriptionid
|
||||
FROM subscription
|
||||
LEFT JOIN serial ON subscription.subscriptionid = serial.subscriptionid
|
||||
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
|
||||
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
|
||||
WHERE ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3)
|
||||
AND subscription.aqbooksellerid=?
|
||||
AND subscription.closed = 0
|
||||
ORDER BY title
|
||||
|;
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute($supplierid);
|
||||
} else {
|
||||
my $query = qq|
|
||||
SELECT name,title,planneddate,serialseq,serial.subscriptionid
|
||||
FROM subscription
|
||||
LEFT JOIN serial ON subscription.subscriptionid = serial.subscriptionid
|
||||
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
|
||||
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
|
||||
WHERE ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3)
|
||||
AND subscription.closed = 0
|
||||
ORDER BY title
|
||||
|;
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute;
|
||||
}
|
||||
my @issuelist;
|
||||
my $last_title;
|
||||
while ( my $line = $sth->fetchrow_hashref ) {
|
||||
$line->{title} = "" if $last_title and $line->{title} eq $last_title;
|
||||
$last_title = $line->{title} if ( $line->{title} );
|
||||
$line->{planneddate} = format_date( $line->{planneddate} );
|
||||
push @issuelist, $line;
|
||||
}
|
||||
return @issuelist;
|
||||
}
|
||||
|
||||
=head2 GetSubscriptionHistoryFromSubscriptionId
|
||||
|
||||
$history = GetSubscriptionHistoryFromSubscriptionId($subscriptionid);
|
||||
|
|
|
@ -15,7 +15,7 @@ use C4::Bookseller;
|
|||
use C4::Biblio;
|
||||
use C4::Budgets;
|
||||
use Koha::DateUtils;
|
||||
use Test::More tests => 44;
|
||||
use Test::More tests => 43;
|
||||
|
||||
BEGIN {
|
||||
use_ok('C4::Serials');
|
||||
|
@ -111,8 +111,6 @@ if (not $frequency->{unit}) {
|
|||
my $expirationdate = GetExpirationDate($subscriptionid) ;
|
||||
ok( $expirationdate, "expiration date is not NULL" );
|
||||
|
||||
is(C4::Serials::GetLateIssues(), undef, 'test getting late issues');
|
||||
|
||||
ok(C4::Serials::GetSubscriptionHistoryFromSubscriptionId($subscriptionid), 'test getting history from sub-scription');
|
||||
|
||||
my ($serials_count, @serials) = GetSerials($subscriptionid);
|
||||
|
|
Loading…
Reference in a new issue