Index: /changelog
===================================================================
--- /changelog	(revision 7975)
+++ /changelog	(revision 7976)
@@ -499,3 +499,6 @@
 - Bugfix: Warenkorb-Rabatt wird jetzt vor den Versandkosten berechnet #777
 - Bugfix: Wertgutscheine nutzen jetzt nur noch den verfÃŒgbaren Wert
+- Bugfix: GelÃ¶schte Produkte werden in ProduktÃŒbersichtseite (Backend) nicht mitgezÃ€hlt
 - Feature: Staffelpreise kÃ¶nnen jetzt angewendet werden wenn im Backend ein Produkt hinzugefÃŒgt wird #776
+- Feature: Abo Modul: Spalten im Backend lassen sich sortieren
+
Index: /mods/mod_abo/wpsg_abo.php
===================================================================
--- /mods/mod_abo/wpsg_abo.php	(revision 7975)
+++ /mods/mod_abo/wpsg_abo.php	(revision 7976)
@@ -202,5 +202,5 @@
 				".$strLimit."
 			";
-
+			 
             $arAboID = wpsg_ShopController::getShop()->db->fetchAssocField($strQuery, "id", "id");
 
@@ -301,4 +301,8 @@
             
             $bJoinOrder = false;
+			$bJoinCustomer = false;
+			$bJoinCustomerAddress = false;
+			$bJoinOrderProduct = false;
+			$bJoinProduct = false;
             
             if (wpsg_isSizedString($arFilter['s'])) {
@@ -329,14 +333,53 @@
             if (wpsg_isSizedInt($arFilter['enddate_m'])) $strQueryWHERE .= " AND MONTH(A.`expiration`) = '".wpsg_q($arFilter['enddate_m'])."' ";
             if (wpsg_isSizedInt($arFilter['enddate_y'])) $strQueryWHERE .= " AND YEAR(A.`expiration`) = '".wpsg_q($arFilter['enddate_y'])."' ";
-             
-            if ($bJoinOrder) {
-                
-                $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_ORDER."` AS O ON (O.`id` = A.`order_id`) ";
-                
-            }
-            
-            // Sortierung
-            $strQueryORDER = " A.`id` ";
- 
+                       
+			if (($arFilter['order']??'') === 'cdate') $strQueryORDER = " A.`cdate` ";
+			else if (($arFilter['order']??'') === 'customer') { 
+				
+				$bJoinOrder = true;
+				$bJoinCustomer = true;
+				$bJoinCustomerAddress = true;
+				
+				$strQueryORDER = " CA.`name` ";
+				
+			} else if (($arFilter['order']??'') === 'payment') {
+				
+				$bJoinOrder = true;
+				
+				$strQueryORDER = " O.`type_payment` ";
+				
+			} else if (($arFilter['order']??'') === 'shipping') {
+				
+				$bJoinOrder = true;
+				
+				$strQueryORDER = " O.`type_shipping` ";
+				
+			}			
+			else if (($arFilter['order']??'') === 'products') {
+			
+				$bJoinOrderProduct = true;
+				$bJoinProduct = true;
+				
+				$strQueryORDER = " P.`name` ";
+
+			} else if (($arFilter['order']??'') === 'amount') {
+				
+				$bJoinOrder = true;
+				
+				$strQueryORDER = " O.`price_gesamt_brutto` ";
+
+			} else if (($arFilter['order']??'') === 'expiration') $strQueryORDER = " A.`expiration` ";
+			else if (($arFilter['order']??'') === 'state') $strQueryORDER = " A.`status` ";
+			else $strQueryORDER = " A.`id` ";
+			
+			if (($arFilter['ascdesc']??'') === 'DESC') $strQueryORDER .= " DESC ";
+			else $strQueryORDER .= " ASC ";
+			
+			if ($bJoinOrder) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_ORDER."` AS O ON (O.`id` = A.`order_id`) ";
+			if ($bJoinCustomer) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_KU."` AS C ON (O.`k_id` = C.`id`) ";
+			if ($bJoinCustomerAddress) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_ADRESS."` AS CA ON (C.`adress_id` = CA.`id`)  ";
+			if ($bJoinOrderProduct) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_ORDERPRODUCT."` AS OP ON (OP.`id` = A.`order_product_id`) ";
+			if ($bJoinProduct) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_PRODUCTS."` AS P ON (P.`id` = OP.`p_id`) ";
+						
             return array($strQuerySELECT, $strQueryWHERE, $strQueryJOIN.$strQueryJOINSuffix, $strQueryHAVING, $strQueryORDER);
 
Index: /mods/mod_productgroups/wpsg_productgroup.php
===================================================================
--- /mods/mod_productgroups/wpsg_productgroup.php	(revision 7975)
+++ /mods/mod_productgroups/wpsg_productgroup.php	(revision 7976)
@@ -19,5 +19,5 @@
 				SELECT
 					PG.*,
-					(SELECT COUNT(*) FROM `".WPSG_TBL_PRODUCTS."` AS P WHERE P.`pgruppe` = PG.`id`) AS `product_count`
+					(SELECT COUNT(*) FROM `".WPSG_TBL_PRODUCTS."` AS P WHERE P.`pgruppe` = PG.`id` AND `deleted` != '1') AS `product_count`
 				FROM
 					`".WPSG_TBL_PRODUCTS_GROUP."` AS PG
Index: /mods/wpsg_mod_abo.class.php
===================================================================
--- /mods/wpsg_mod_abo.class.php	(revision 7975)
+++ /mods/wpsg_mod_abo.class.php	(revision 7976)
@@ -153,4 +153,6 @@
             if (isset($_REQUEST['filter']['enddate_m'])) $this->shop->view['arFilter']['enddate_m'] = intval($_REQUEST['filter']['enddate_m']);
             if (isset($_REQUEST['filter']['enddate_y'])) $this->shop->view['arFilter']['enddate_y'] = intval($_REQUEST['filter']['enddate_y']);
+            if (isset($_REQUEST['filter']['order'])) $this->shop->view['arFilter']['order'] = $_REQUEST['filter']['order'];
+            if (isset($_REQUEST['filter']['ascdesc'])) $this->shop->view['arFilter']['ascdesc'] = $_REQUEST['filter']['ascdesc'];
             if (wpsg_isSizedInt($_REQUEST['filter']['status'])) $this->shop->view['arFilter']['state'] = intval($_REQUEST['filter']['status']);
 
@@ -162,5 +164,5 @@
                 'count' => wpsg_abo::count($filter_state)
             ];
-
+ 
 			foreach (wpsg_abo::$arState as $state_key => $state_label) {
 
Index: /views/mods/mod_abo/index.phtml
===================================================================
--- /views/mods/mod_abo/index.phtml	(revision 7975)
+++ /views/mods/mod_abo/index.phtml	(revision 7976)
@@ -130,6 +130,6 @@
                         <th class="col_products wpsg_order" data-order="products"><?php echo __('Abonnement', 'wpsg'); ?></th>                       
                         <th class="col_sum wpsg_order" data-order="amount"><?php echo __('Bestellwert', 'wpsg'); ?></th>
-                        <th class="col_time wpsg_order" data-order="time"><?php echo __('Laufzeit', 'wpsg'); ?></th>
-						<th class="col_state wpsg_order" data-order="time"><?php echo __('Status', 'wpsg'); ?></th>
+                        <th class="col_time wpsg_order" data-order="expiration"><?php echo __('Laufzeit', 'wpsg'); ?></th>
+						<th class="col_state"><?php echo __('Status', 'wpsg'); ?></th>
                     </tr>
                 </thead>
