From 3285e34dc2924bdbe0f1573b5d1a6da5032ab5f3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 5 Feb 2014 11:05:19 +0100 Subject: [PATCH] Bug 11689: Take new serial missing statuses into account in more places Bug 10851 introduced new missing status (codes 41,42,43,44), but in GetSerials and _update_missinglist, they are not taken into account. This patch corrects the issue. To reproduce: 1/ Create a serial with 10 issues. 2/ Set different statuses on each one, with at least 6 missing statuses (not only "Missing"). 3/ Go on the subscription detail page, tab "Summary", the issues with a new missing status are not listed in the missing issues list. 4/ On the "Issues" tab, all missing are listed (normally only 5 should be listed. 5/ Apply the patch. 6/ Edit serial (to rewrite the missing list). 6/ Verify that steps 3 and 4 have now correct behavior. Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Works as described, passes QA script and tests. Signed-off-by: Galen Charlton --- C4/Serials.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index c62d1ed81a..e9ac3d89c8 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -769,7 +769,7 @@ sub GetSerials { my @serials; my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes FROM serial - WHERE subscriptionid = ? AND status NOT IN (2,4,5) + WHERE subscriptionid = ? AND status NOT IN (2, 4, 41, 42, 43, 44, 5) ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; my $sth = $dbh->prepare($query); $sth->execute($subscriptionid); @@ -790,7 +790,7 @@ sub GetSerials { $query = "SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes FROM serial WHERE subscriptionid = ? - AND (status in (2,4,5)) + AND (status in (2, 4, 41, 42, 43, 44, 5)) ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC "; $sth = $dbh->prepare($query); @@ -1161,13 +1161,13 @@ sub _update_missinglist { my $subscriptionid = shift; my $dbh = C4::Context->dbh; - my @missingserials = GetSerials2($subscriptionid, "4,5"); + my @missingserials = GetSerials2($subscriptionid, "4,41,42,43,44,5"); my $missinglist; - foreach (@missingserials) { - if($_->{'status'} == 4) { - $missinglist .= $_->{'serialseq'} . "; "; - } elsif($_->{'status'} == 5) { - $missinglist .= "not issued " . $_->{'serialseq'} . "; "; + foreach my $missingserial (@missingserials) { + if ( grep { $_ == $missingserial->{status} } qw( 4 41 42 43 44 ) ) { + $missinglist .= $missingserial->{'serialseq'} . "; "; + } elsif($missingserial->{'status'} == 5) { + $missinglist .= "not issued " . $missingserial->{'serialseq'} . "; "; } } $missinglist =~ s/; $//; -- 2.39.5