MT3801: Serials not received issues cannot be claimed
authorHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Mon, 7 Jun 2010 09:13:10 +0000 (11:13 +0200)
committerColin Campbell <colin.campbell@ptfs-europe.com>
Wed, 15 Dec 2010 16:52:56 +0000 (16:52 +0000)
waiting issues which where planned for an old date were not "claimable"
This also fixes a bug from commit

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
C4/Serials.pm
serials/claims.pl

index f274b18..40ff3b6 100644 (file)
@@ -91,8 +91,8 @@ the array is in name order
 
 sub GetSuppliersWithLateIssues {
     my $dbh   = C4::Context->dbh;
-    my $query = q|
-    SELECT DISTINCT aqbooksellerid as id, aqbooksellers.name as name
+    my $query = qq|
+        SELECT DISTINCT id, name
     FROM            subscription
     LEFT JOIN       serial ON serial.subscriptionid=subscription.subscriptionid
     LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
index 249cf85..fa45330 100755 (executable)
@@ -56,13 +56,12 @@ my ($template, $loggedinuser, $cookie)
             });
 
 my @suploop;
-for ( sort {$supplierlist{$a} cmp $supplierlist{$b} } keys %supplierlist ) {
-    my ($count, @dummy) = GetLateOrMissingIssues($_, "", $order);
+for my $s ( sort {$a->{name} cmp $b->{name} } @$supplierlist ) {
+    my @list = GetLateOrMissingIssues($s, "", $order);
     push @suploop, {
-        id       => $_,
-        name     => $supplierlist{$_},
-        count    => $count,
-        selected => $_ == $supplierid,
+        %$s,
+        count    => scalar(@list),
+        selected => $s->{id} == $supplierid,
     };
 }