From 9bfcf01abdaa52f89d41893c44dfe74980cd1252 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Mon, 7 Jun 2010 11:13:10 +0200 Subject: [PATCH] MT3801: Serials not received issues cannot be claimed waiting issues which where planned for an old date were not "claimable" This also fixes a bug from commit Signed-off-by: Colin Campbell --- C4/Serials.pm | 4 ++-- serials/claims.pl | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index f274b18b17..40ff3b6c81 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -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 diff --git a/serials/claims.pl b/serials/claims.pl index 249cf85c12..fa45330c51 100755 --- a/serials/claims.pl +++ b/serials/claims.pl @@ -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, }; } -- 2.39.5