Index: /model/wpsg_order.class.php
===================================================================
--- /model/wpsg_order.class.php	(revision 7228)
+++ /model/wpsg_order.class.php	(revision 7229)
@@ -1159,4 +1159,5 @@
 
 			$bJoinProducts = false;
+			$bJoinOrderProducts = false;			
 			$bJoinCustomer = false;
 			$bJoinInvoice = false;
@@ -1165,9 +1166,15 @@
 			if (wpsg_isSizedInt($arFilter['k_id'])) $strQueryWHERE .= " AND O.`k_id` = '".wpsg_q($arFilter['k_id'])."' ";
 			if (wpsg_isSizedInt($arFilter['cdate_from'])) $strQueryWHERE .= " AND O.`cdate` > '".wpsg_date('Y-m-d', $arFilter['cdate_from'])."' ";
-			if (wpsg_isSizedInt($arFilter['product_id'])) { $strQueryWHERE .= " AND OP.`p_id` = '".wpsg_q($arFilter['product_id'])."' "; $bJoinProducts = true; }
+			if (wpsg_isSizedInt($arFilter['product_id'])) { $strQueryWHERE .= " AND OP.`p_id` = '".wpsg_q($arFilter['product_id'])."' "; $bJoinOrderProducts = true; }
 			if (wpsg_isSizedString($arFilter['cdate_y']) && $arFilter['cdate_y'] != '-1') { $strQueryWHERE .= " AND YEAR(O.`cdate`) = '".wpsg_q($arFilter['cdate_y'])."' "; }
 			if (wpsg_isSizedString($arFilter['cdate_m']) && $arFilter['cdate_m'] != '-1') { $strQueryWHERE .= " AND MONTH(O.`cdate`) = '".wpsg_q(ltrim($arFilter['cdate_m'], '0'))."' "; }
 			if (wpsg_isSizedString($arFilter['invoicedate_y']) && $arFilter['invoicedate_y'] != '-1') { $bJoinInvoice = true; $strQueryWHERE .= " AND YEAR(I.`datum`) = '".wpsg_q($arFilter['invoicedate_y'])."' "; }
 			if (wpsg_isSizedString($arFilter['invoicedate_m']) && $arFilter['invoicedate_m'] != '-1') { $bJoinInvoice = true; $strQueryWHERE .= " AND MONTH(I.`datum`) = '".wpsg_q(ltrim($arFilter['invoicedate_m'], '0'))."' "; }
+			if (wpsg_isSizedInt($arFilter['productgroup_id'])) {
+				
+				$bJoinProducts = true;
+				$strQueryWHERE .= " AND P.`pgruppe` = '".wpsg_q($arFilter['productgroup_id'])."' ";
+				
+			}
 			if (wpsg_isSizedString($arFilter['s']))
 			{
@@ -1257,6 +1264,6 @@
 			else if (wpsg_isSizedString($arFilter['order'], 'products'))
 			{
-
-				$bJoinProducts = true;
+				
+				$bJoinOrderProducts = true;
 				$strQuerySELECT .= ", COUNT(OP.`id`) AS `count_products` ";
 				$strQueryORDER = " `count_products` ";
@@ -1287,6 +1294,9 @@
 			else $strQueryORDER .= " ASC ";
 
+			if ($bJoinProducts === true) $bJoinOrderProducts = true;
+			
 			// Optionale Joins
-			if ($bJoinProducts === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_ORDERPRODUCT."` AS OP ON (O.`id` = OP.`o_id`) ";
+			if ($bJoinOrderProducts === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_ORDERPRODUCT."` AS OP ON (O.`id` = OP.`o_id`) ";
+			if ($bJoinProducts === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_PRODUCTS."` AS P ON (OP.`p_id` = P.`id`) ";
 			if ($bJoinCustomer === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_KU."` AS C ON (C.`id` = O.`k_id`) ";
 			if ($bJoinInvoice === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_RECHNUNGEN."` AS I ON (I.`o_id` =  O.`id` AND I.`storno` = '0000-00-00 00:00:00' AND I.`rnr` != '') ";
Index: /mods/wpsg_mod_produktartikel.class.php
===================================================================
--- /mods/wpsg_mod_produktartikel.class.php	(revision 7228)
+++ /mods/wpsg_mod_produktartikel.class.php	(revision 7229)
@@ -1352,5 +1352,5 @@
         } // public function getProductcategorySelect($ref = 0)
 	
-		public function getProductcategorySelect($arProductFilter = array())
+		public function getProductcategorySelect($arProductFilter = array(), $productCountinLabel = true)
 		{
 		
@@ -1378,6 +1378,13 @@
 			
 				$temp = $GLOBALS['wpsg_db']->fetchAssoc($strQuery);
-				foreach ($temp AS &$v)
-					$v['label'] = $v['name'].' ('.$v['anzahl'].')';
+				
+				foreach ($temp AS &$v) {
+					
+					$v['label'] = $v['name'];
+				
+					if ($productCountinLabel) $v['label'] .= ' ('.$v['anzahl'].')';
+					
+				}
+				
 				return $temp;
 			
Index: /views/order/index.phtml
===================================================================
--- /views/order/index.phtml	(revision 7228)
+++ /views/order/index.phtml	(revision 7229)
@@ -36,5 +36,5 @@
 		<div class="wpsg-filter wpsg-order-tab wpsg-order-tab-0 container-fluid form-horizontal" style="display:<?php echo (($this->view['hasFilter'] === true)?'block':'none'); ?>;">
 			<div class="row">
-				<div class="col-lg-4">
+				<div class="col-lg-5">
 					<form method="post" id="filter_form" >
 
@@ -46,5 +46,19 @@
                         <?php echo wpsg_drawForm_Input('filter[k_id]', __('Kunde (ID)', 'wpsg'), wpsg_getStr($this->view['arFilter']['k_id'])); ?>
 						<?php echo wpsg_drawForm_Select('filter[status]', __('Bestellstatus', 'wpsg'), wpsg_array_merge(array('-1' => __('Alle', 'wpsg')), $this->arStatus), @$this->view['arFilter']['status']); ?>
-
+						
+						<?php /* if ($this->hasMod('wpsg_mod_produktartikel')) { Vorbereitet aber Joins in wpsg_order nach den wp Ktegorien noch nicht umgesetzt! ?>
+							
+							<?php $arCatSelect = []; $arCat = $this->callMod('wpsg_mod_produktartikel', 'getProductcategorySelect'); foreach ($arCat as $cat) $arCatSelect[$cat['term_id']] = $cat['label']; ?>
+							<?php  echo wpsg_drawForm_Select('filter[cat_term_id]', __('Bestellungen mit Produkten aus Kategorie'), ['0' => __('Alle', 'wpsg')] + $arCatSelect, wpsg_getStr($this->view['arFilter']['cat_term_id'])); ?>
+						
+						<?php } */ ?>
+						
+						<?php if ($this->hasMod('wpsg_mod_productgroups')) { ?>
+						
+							<?php $arProductgroups = $this->callMod('wpsg_mod_productgroups', 'getAllProductGroups'); ?>
+							<?php  echo wpsg_drawForm_Select('filter[productgroup_id]', __('Bestellungen mit Produkten aus Produktgruppe'), ['0' => __('Alle', 'wpsg')] + $arProductgroups, wpsg_getStr($this->view['arFilter']['productgroup_id'])); ?>
+							
+						<?php } ?>
+						
                         <?php echo wpsg_drawForm_TextStart(); ?>
                         <div class="row">
