Bug 14610: Follow-up 2
[koha.git] / acqui / invoices.pl
index 48adb80..7f0ed5d 100755 (executable)
@@ -34,7 +34,6 @@ use C4::Auth;
 use C4::Output;
 
 use C4::Acquisition qw/GetInvoices/;
-use C4::Branch qw/GetBranches/;
 use C4::Budgets;
 use Koha::DateUtils;
 
@@ -62,6 +61,7 @@ my $author           = $input->param('author');
 my $publisher        = $input->param('publisher');
 my $publicationyear  = $input->param('publicationyear');
 my $branch           = $input->param('branch');
+my $message_id       = $input->param('message_id');
 my $op               = $input->param('op');
 
 $shipmentdatefrom and $shipmentdatefrom = eval { dt_from_string( $shipmentdatefrom ) };
@@ -83,7 +83,8 @@ if ( $op and $op eq 'do_search' ) {
         author           => $author,
         publisher        => $publisher,
         publicationyear  => $publicationyear,
-        branchcode       => $branch
+        branchcode       => $branch,
+        message_id       => $message_id,
     );
 }
 
@@ -105,24 +106,6 @@ foreach (@suppliers) {
       };
 }
 
-# Build branches list
-my $branches      = GetBranches();
-my $branches_loop = [];
-my $branchname;
-foreach ( sort keys %$branches ) {
-    my $selected = 0;
-    if ( $branch && $branch eq $_ ) {
-        $selected   = 1;
-        $branchname = $branches->{$_}->{'branchname'};
-    }
-    push @{$branches_loop},
-      {
-        branchcode => $_,
-        branchname => $branches->{$_}->{branchname},
-        selected   => $selected,
-      };
-}
-
 my $budgets = GetBudgets();
 my @budgets_loop;
 foreach my $budget (@$budgets) {
@@ -147,9 +130,7 @@ $template->param(
     publisher       => $publisher,
     publicationyear => $publicationyear,
     branch          => $branch,
-    branchname      => $branchname,
     suppliers_loop  => $suppliers_loop,
-    branches_loop   => $branches_loop,
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;