Dateimanagement: Anhänge-aller-Artikel-Download: auch für andere OE-Typen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 28 Feb 2017 08:58:15 +0000 (09:58 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 28 Feb 2017 09:03:55 +0000 (10:03 +0100)
SL/Controller/DownloadZip.pm

index 3304ff6..92a03fc 100644 (file)
@@ -43,8 +43,9 @@ sub action_download_orderitems_files {
   #my $name_encoding = 'cp850';
   my $name_encoding = 'UTF-8';
 
-  # today only sales_order implementation !
-  if ( $object_id && $object_type eq 'sales_order' && $element_type eq 'part' ) {
+  if (   $object_id
+      && ($object_type =~ m{^(?:sales_order|purchase_order|sales_quotation|request_quotation)$})
+      && ($element_type eq 'part')) {
     my $orderitems = SL::DB::Manager::OrderItem->get_all(query => ['order.id' => $object_id ],
                                                          with_objects => [ 'order', 'part' ],
                                                          sort_by => 'part.partnumber ASC');