Bug 26172: (QA follow-up) Fix order of summary
[koha-ffzg.git] / acqui / booksellers.pl
index 8a35b04..9b15aac 100755 (executable)
@@ -51,8 +51,7 @@ The id of the supplier whose baskets we will display
 
 =cut
 
-use strict;
-use warnings;
+use Modern::Perl;
 use C4::Auth;
 use C4::Biblio;
 use C4::Budgets;
@@ -70,7 +69,6 @@ my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
     {   template_name   => 'acqui/booksellers.tt',
         query           => $query,
         type            => 'intranet',
-        authnotrequired => 0,
         flagsrequired   => { acquisition => '*' },
         debug           => 1,
     }
@@ -83,7 +81,7 @@ my $allbaskets= $query->param('allbaskets')||0;
 my @suppliers;
 
 if ($booksellerid) {
-    push @suppliers, scalar Koha::Acquisition::Booksellers->find( $booksellerid );
+    push @suppliers, Koha::Acquisition::Booksellers->find( $booksellerid );
 } else {
     @suppliers = Koha::Acquisition::Booksellers->search(
                         { name => { -like => "%$supplier%" } },
@@ -115,9 +113,6 @@ my $userbranch = $userenv->{branch};
 my $budgets = GetBudgetHierarchy;
 my $has_budgets = 0;
 foreach my $r (@{$budgets}) {
-    if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) {
-        next;
-    }
     next unless (CanUserUseBudget($loggedinuser, $r, $userflags));
 
     $has_budgets = 1;
@@ -139,8 +134,7 @@ for my $vendor (@suppliers) {
                 $basket->{$_} ||= 0;
             }
             if ( $patron ) {
-                $basket->{authorisedby_firstname} = $patron->firstname;
-                $basket->{authorisedby_surname} = $patron->surname;
+                $basket->{authorisedby} = $patron;
             }
             if ($basket->{basketgroupid}) {
                 my $basketgroup = C4::Acquisition::GetBasketgroup($basket->{basketgroupid});