From 8b19fd4b0db2ac641ebbbb1b0eeef9bcb4fdfd6e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 29 Aug 2014 12:53:07 +0200 Subject: [PATCH] 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 Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- C4/Serials.pm | 60 +--------------------------------------- t/db_dependent/Serials.t | 4 +-- 2 files changed, 2 insertions(+), 62 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index d127066596..49325cb277 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -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); diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t index 32def21945..c255b9ebaa 100644 --- a/t/db_dependent/Serials.t +++ b/t/db_dependent/Serials.t @@ -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); -- 2.39.5