Bug 15184: Change permission (+x) on .pl
[koha.git] / acqui / invoices.pl
index 7f0ed5d..8ab7a32 100755 (executable)
@@ -26,8 +26,7 @@ Search for invoices
 
 =cut
 
-use strict;
-use warnings;
+use Modern::Perl;
 
 use CGI qw ( -utf8 );
 use C4::Auth;
@@ -36,6 +35,7 @@ use C4::Output;
 use C4::Acquisition qw/GetInvoices/;
 use C4::Budgets;
 use Koha::DateUtils;
+use Koha::Acquisition::Booksellers;
 
 my $input = CGI->new;
 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
@@ -89,19 +89,19 @@ if ( $op and $op eq 'do_search' ) {
 }
 
 # Build suppliers list
-my @suppliers      = Koha::Acquisition::Bookseller->search;
+my @suppliers      = Koha::Acquisition::Booksellers->search( undef, { order_by => { -asc => 'name' } } );
 my $suppliers_loop = [];
 my $suppliername;
 foreach (@suppliers) {
     my $selected = 0;
-    if ($supplierid && $supplierid == $_->{id} ) {
+    if ($supplierid && $supplierid == $_->id ) {
         $selected = 1;
-        $suppliername = $_->{name};
+        $suppliername = $_->name;
     }
     push @{$suppliers_loop},
       {
-        suppliername => $_->{name},
-        booksellerid   => $_->{id},
+        suppliername => $_->name,
+        booksellerid   => $_->id,
         selected     => $selected,
       };
 }