ordering supplier list & reindenting a little
authorPaul POULAIN <paul@koha-fr.org>
Fri, 17 Aug 2007 16:07:20 +0000 (18:07 +0200)
committerChris Cormack <crc@liblime.com>
Sat, 18 Aug 2007 22:37:56 +0000 (17:37 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
C4/Serials.pm
serials/claims.pl

index 82e1094..93afe6b 100644 (file)
@@ -103,6 +103,7 @@ sub GetSuppliersWithLateIssues {
         LEFT JOIN       aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
         WHERE           subscription.subscriptionid = serial.subscriptionid
         AND             (planneddate < now() OR serial.STATUS = 3 OR serial.STATUS = 4)
+        ORDER BY name
     |;
     my $sth = $dbh->prepare($query);
     $sth->execute;
index da8ae3a..a96857e 100755 (executable)
@@ -20,7 +20,7 @@ my $order = $input->param('order');
 my %supplierlist = GetSuppliersWithLateIssues;
 my @select_supplier;
 
-foreach my $supplierid (keys %supplierlist){
+foreach my $supplierid (sort {$supplierlist{$a} cmp $supplierlist{$b} } keys %supplierlist){
         my ($count, @dummy) = GetLateOrMissingIssues($supplierid,"",$order);
         my $counting = $count;
         $supplierlist{$supplierid} = $supplierlist{$supplierid}." ($counting)";
@@ -77,19 +77,19 @@ my ($template, $loggedinuser, $cookie)
 
 $template->param('letters'=>\@letters,'letter'=>$letter);
 $template->param(
-    order =>$order,
-       CGIsupplier => $CGIsupplier,
-    phone => $supplierinfo[0]->{phone},
-    booksellerfax => $supplierinfo[0]->{booksellerfax},
-    bookselleremail => $supplierinfo[0]->{bookselleremail},
+        order =>$order,
+        CGIsupplier => $CGIsupplier,
+        phone => $supplierinfo[0]->{phone},
+        booksellerfax => $supplierinfo[0]->{booksellerfax},
+        bookselleremail => $supplierinfo[0]->{bookselleremail},
         preview => $preview,
         missingissues => \@missingissues,
         supplierid => $supplierid,
         claimletter => $claimletter,
         singlesupplier => $singlesupplier,
         supplierloop => \@supplierinfo,
-       intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
-               intranetstylesheet => C4::Context->preference("intranetstylesheet"),
-               IntranetNav => C4::Context->preference("IntranetNav"),
-       );
+        intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
+        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+        IntranetNav => C4::Context->preference("IntranetNav"),
+        );
 output_html_with_http_headers $input, $cookie, $template->output;