Bug 4188 Valid PDF file name when printing basket group with no name
[koha_gimpoz] / acqui / basketgroup.pl
index a3b7dc9..69de099 100755 (executable)
@@ -238,7 +238,10 @@ sub printbasketgrouppdf{
         }
         $orders{$basket->{basketno}}=\@ba_orders;
     }
-    print $input->header( -type => 'application/pdf', -attachment => $basketgroup->{name}.'.pdf' );
+    print $input->header(
+        -type       => 'application/pdf',
+        -attachment => ( $basketgroup->{name} || $basketgroupid ) . '.pdf'
+    );
     my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->{gstrate} || C4::Context->preference("gist")) || die "pdf generation failed";
     print $pdf;
     exit;