Index: /controller/wpsg_OrderController.class.php
===================================================================
--- /controller/wpsg_OrderController.class.php	(revision 7956)
+++ /controller/wpsg_OrderController.class.php	(revision 7957)
@@ -1739,5 +1739,5 @@
 				$arFilterState = $this->shop->view['arFilter'];
 				$arFilterState['status'] = $status_key;
-
+ 
 				$count = wpsg_order::count($arFilterState);
 
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7956)
+++ /controller/wpsg_ShopController.class.php	(revision 7957)
@@ -104,5 +104,5 @@
 		const STATUS_AKTIVABO = 600;
 		const STATUS_OFFENEABOKUENDIGUNG = 610;
-		const STATUS_GEKUENDIGTEABOS = 620;
+		const STATUS_GEKUENDIGTEABOS = 620; 
 
 		/** Seitenkonstanten */
@@ -1167,5 +1167,5 @@
 		 */
 		public function callMods($func_name, $arParam = array()) {
-		               
+		                
 		    \do_action('wpsg_'.$func_name, $arParam);
 		    
Index: /lib/install.php
===================================================================
--- /lib/install.php	(revision 7956)
+++ /lib/install.php	(revision 7957)
@@ -132,5 +132,5 @@
 		bvars TEXT NOT NULL,
 		pvars text NOT NULL,
-   		status int(5) NOT NULL,
+   		status VARCHAR(255) NOT NULL,
    		transaction varchar(255) NOT NULL,   			
    		dp_cron_planed datetime NOT NULL,
@@ -197,4 +197,5 @@
    		KEY k_id (k_id),
    		KEY gs_id (gs_id),
+   		KEY status (status),
    		PRIMARY KEY  (id)
    	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
Index: /lib/wpsg_cache.class.php
===================================================================
--- /lib/wpsg_cache.class.php	(revision 7956)
+++ /lib/wpsg_cache.class.php	(revision 7957)
@@ -69,11 +69,9 @@
 		 * LÃ€dt die reinen Bestelldaten aus der Datenbank und gibt sie zurÃŒck
 		 */
-		public function loadOrder($order_id, $noCache = false)
-		{
-			
-			if (!array_key_exists($order_id, $this->_arOrder) || $noCache === true)
-			{
-					
-				$this->_arOrder[$order_id] = $this->_db->fetchRow("
+		public function loadOrder($order_id, $noCache = false) {
+			
+			if (!array_key_exists($order_id, $this->_arOrder) || $noCache === true) {
+					
+				$db_order = $this->_db->fetchRow("
 					SELECT
 						*
@@ -82,5 +80,7 @@
 					WHERE
 						`id` = '".wpsg_q($order_id)."'
-				");
+				"); 
+				
+				$this->_arOrder[$order_id] = $db_order;
 				
 			}
Index: /model/wpsg_customer.class.php
===================================================================
--- /model/wpsg_customer.class.php	(revision 7956)
+++ /model/wpsg_customer.class.php	(revision 7957)
@@ -231,9 +231,8 @@
 		 * Gibt die Telefonnummer zurÃŒck
 		 */
-		public function getPhone()
-		{
+		public function getPhone() {
 			
 			if ($this->adress_data === false) return wpsg_getStr($this->data['tel']);
-			else return $this->adress_data['tel']; 
+			else return $this->adress_data['tel']??''; 
 			
 		} // public function getPhone()
Index: /model/wpsg_order.class.php
===================================================================
--- /model/wpsg_order.class.php	(revision 7956)
+++ /model/wpsg_order.class.php	(revision 7957)
@@ -1063,6 +1063,5 @@
 		 * ZÃ€hlt die Bestellungen anhand des Filters
 		 */
-		public static function count($arFilter)
-		{
+		public static function count($arFilter) {
 
 			list($strQuerySELECT, $strQueryWHERE, $strQueryJOIN, $strQueryHAVING, $strQueryORDER) = self::getQueryParts($arFilter);
@@ -1122,5 +1121,5 @@
 				".$strLimit."
 			";
-
+			
 			$arOrderID = $GLOBALS['wpsg_db']->fetchAssocField($strQuery, "id", "id");
 
@@ -1198,11 +1197,9 @@
 			}
 
-			if (wpsg_isSizedInt($arFilter['status']) || $arFilter['status'] == '0') {
+			if ((wpsg_isSizedString($arFilter['status']) || $arFilter['status'] == '0') && intval($arFilter['status']) !== -1) {
 
 				$strQueryWHERE .= " AND O.`status` = '".wpsg_q($arFilter['status'])."' ";
 
-			}
-			else if (wpsg_isSizedArray($arFilter['status']))
-			{
+			} else if (wpsg_isSizedArray($arFilter['status'])) {
 
 				$strQueryWHERE .= " AND O.`status` IN (".wpsg_q(implode(',', $arFilter['status'])).") ";
@@ -1210,12 +1207,9 @@
 			}
 
-			if (wpsg_isSizedInt($arFilter['NOTstatus']))
-			{
+			if (wpsg_isSizedInt($arFilter['NOTstatus'])) {
 
 				$strQueryWHERE .= " AND O.`status` != '".wpsg_q($arFilter['NOTstatus'])."' ";
 
-			}
-			else if (wpsg_isSizedArray($arFilter['NOTstatus']))
-			{
+			} else if (wpsg_isSizedArray($arFilter['NOTstatus'])) {
 
 				$strQueryWHERE .= " AND O.`status` NOT IN (".wpsg_q(implode(',', $arFilter['NOTstatus'])).") ";
Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 7956)
+++ /mods/wpsg_mod_basic.class.php	(revision 7957)
@@ -100,5 +100,6 @@
 			5300	=> 'wpsg_mod_converter', // Konverter von wpsg3 auf wpsg4
             5500    => 'wpsg_mod_datainformation', // Datenauskunft
-            5501 	=> 'wpsg_mod_printshop', // Druckerei
+            5501 	=> 'wpsg_mod_printshop', // Druckerei,
+			5600    => 'wpsg_mod_orderstates'
 		);
 		
Index: /mods/wpsg_mod_orderstates.class.php
===================================================================
--- /mods/wpsg_mod_orderstates.class.php	(revision 7957)
+++ /mods/wpsg_mod_orderstates.class.php	(revision 7957)
@@ -0,0 +1,118 @@
+<?php
+
+	declare(strict_types=1);
+
+	/**
+	 * User: Daschmi (daschmi@daschmi.de)
+	 * Date: 04.11.2021
+	 * Time: 10:23
+	 */
+	
+	define('WPSG_TBL_ORDERSTATES', wpsg_ShopController::getShop()->prefix.'wpsg_orderstates');
+ 
+	class wpsg_mod_orderstates extends wpsg_mod_basic {
+		
+		var $id = 5600;		
+		var $lizenz = 1;
+		var $version = "9.9.9";
+		var $hilfeURL = '';
+		var $free = true;
+		
+		/**
+		 * Erstellt ein neues Modul
+		 */
+		public function __construct() {
+			
+			$this->name = __('BestellzustÃ€nde', 'wpsg');
+			$this->group = __('Bestellung', 'wpsg');
+			$this->desc = __('Erlaubt das anlegen weiterer BestellzustÃ€nde.', 'wpsg');
+			
+			$this->shop = $GLOBALS['wpsg_sc'];
+			$this->db = $GLOBALS['wpsg_db'];
+			
+		} 
+		
+		public function install() {
+			
+			require_once(WPSG_PATH_WP.'/wp-admin/includes/upgrade.php');
+			
+			$sql = "CREATE TABLE ".WPSG_TBL_ORDERSTATES." (
+		   		id mediumint(9) NOT NULL AUTO_INCREMENT,
+		   		name VARCHAR(255) NOT NULL,	
+		   		deleted INT(1) NOT NULL, 		 
+		   		PRIMARY KEY  (id),
+		   		KEY deleted (deleted),
+		   	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
+			
+			dbDelta($sql);
+			
+		}
+
+		public function settings_edit() {
+			
+			$this->shop->view['arStates'] = $this->getCustomStates(true);
+			
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_orderstates/settings_edit.phtml');			
+			
+		}
+		
+		public function settings_save() {
+			
+			if (isset($_REQUEST['wpsg_mod_orderstates']['states'])) {
+				
+				$arStates = json_decode($_REQUEST['wpsg_mod_orderstates']['states'], true);
+				
+				if (is_array($arStates)) {
+				
+					foreach ($arStates as $state_data) {
+											
+						$db_data = [
+							'name' => wpsg_q(trim(\sanitize_text_field($state_data['name']))),
+							'deleted' => wpsg_q((($state_data['deleted'] === '1')?'1':'0'))
+						];
+												
+						if ($db_data['name'] === '') $db_data['name'] = wpsg_q(\sanitize_text_field(__('Unbenannt', 'wpsg')));
+						
+						if (intval($state_data['id']) > 0) {
+							
+							$this->db->UpdateQuery(WPSG_TBL_ORDERSTATES, $db_data, " `id` = '".intval($state_data['id'])."' ");
+							
+							$id = $state_data['id'];
+							
+						} else $id = $this->db->ImportQuery(WPSG_TBL_ORDERSTATES, $db_data);
+						
+						$this->shop->addTranslationString('wpsg_mod_orderstates_name_'.$id, $db_data['name']);
+						
+					}
+
+				}
+								
+			}
+			
+		}
+		
+		public function init() {
+			
+			foreach ($this->getCustomStates() as $state) {
+				
+				$this->shop->arStatus[$this->id.'_'.$state['id']] = __($state['name'], 'wpsg');
+				
+			}
+			
+		}
+		
+		/* Modulfunktionen */
+				
+		public function getCustomStates(bool $bIncludeDeleted = false): array {
+			
+			$strQuery = "SELECT * FROM `".WPSG_TBL_ORDERSTATES."` WHERE 1 ";
+			
+			if (!$bIncludeDeleted) $strQuery .= " AND `deleted` != '1' ";
+			
+			$strQuery .= " ORDER BY `name` ASC ";
+			 
+			return $this->db->fetchAssoc($strQuery);
+			
+		}
+
+	}
Index: /views/admin/module.phtml
===================================================================
--- /views/admin/module.phtml	(revision 7956)
+++ /views/admin/module.phtml	(revision 7957)
@@ -145,5 +145,8 @@
 		<?php } ?>
 
-		<?php if (!isset($this->arAllModule[$_REQUEST['modul']]->version) || (@$wpsg_update_data['modulinfo'][$_REQUEST['modul']]['demo_active'] === true || @$wpsg_update_data['modulinfo'][$_REQUEST['modul']]['active'] === true || $wpsg_update_data['modulinfo'][$_REQUEST['modul']]['free'] === true)) { ?>
+		<?php if (  !isset($this->arAllModule[$_REQUEST['modul']]->version) || 
+                    @$wpsg_update_data['modulinfo'][$_REQUEST['modul']]['demo_active'] === true || 
+                    @$wpsg_update_data['modulinfo'][$_REQUEST['modul']]['active'] === true || 
+                    @$wpsg_update_data['modulinfo'][$_REQUEST['modul']]['free'] === true) { ?>
 
 			<hr />
@@ -169,5 +172,8 @@
 		<?php } else { ?>
 	
-			<?php if (@$wpsg_update_data['modulinfo'][$_REQUEST['modul']]['demo_active'] === true || @$wpsg_update_data['modulinfo'][$_REQUEST['modul']]['active'] === true || $wpsg_update_data['modulinfo'][$_REQUEST['modul']]['free'] === true) { ?>
+			<?php if (
+                    @$wpsg_update_data['modulinfo'][$_REQUEST['modul']]['demo_active'] === true || 
+                    @$wpsg_update_data['modulinfo'][$_REQUEST['modul']]['active'] === true || 
+                    @$wpsg_update_data['modulinfo'][$_REQUEST['modul']]['free'] === true) { ?>
 			<p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit"></p>
 			<?php } ?>
Index: /views/css/admin.css
===================================================================
--- /views/css/admin.css	(revision 7956)
+++ /views/css/admin.css	(revision 7957)
@@ -85,4 +85,13 @@
 #wpsg-bs .mt-0 { margin-top:0; }
 #wpsg-bs .font-normal { font-weight:normal; }
+#wpsg-bs .flex { display:flex; }
+#wpsg-bs .justify-between { justify-content:space-between; }
+#wpsg-bs .items-center { align-items:center; }
+#wpsg-bs .mt-2 { margin-top:0.5rem; }
+#wpsg-bs .w-full { width:100%; }
+#wpsg-bs .p-1 { padding:0.25rem; }
+#wpsg-bs .box-border { box-sizing:border-box; }
+#wpsg-bs .text-right { text-align:right; }
+#wpsg-bs .none { display:none; }
 
 .wp-admin #wpsg-bs select { max-width:100%; padding-right:0; line-height:initial; }
Index: /views/mods/mod_orderstates/settings_edit.phtml
===================================================================
--- /views/mods/mod_orderstates/settings_edit.phtml	(revision 7957)
+++ /views/mods/mod_orderstates/settings_edit.phtml	(revision 7957)
@@ -0,0 +1,92 @@
+<?php
+
+	declare(strict_types=1);
+
+	/**
+	 * User: Daschmi (daschmi@daschmi.de)
+	 * Date: 04.11.2021
+	 * Time: 10:28
+	 */
+	
+?>
+
+<script src="<?php echo WPSG_URL_CONTENT.'plugins/'.WPSG_FOLDERNAME.'/views/js/vue3.js'; ?>"></script>
+
+<div id="wpsg_mod_orderstates_app">
+    
+    <textarea name="wpsg_mod_orderstates[states]" class="none">{{arStates}}</textarea>
+    
+    <p class="flex items-center justify-between">
+        <template v-if="arStatesNotDeleted.length === 0">            
+            <?php echo __('Keine BestellzustÃ€nde angelegt.', 'wpsg'); ?>
+        </template>
+        <template v-if="arStatesNotDeleted.length === 1">
+            <?php echo __('Ein Bestellzustand wurde definiert.', 'wpsg'); ?>
+        </template> 
+        <template v-else>
+            {{arStatesNotDeleted.length}} <?php echo __('BestellzustÃ€nde wurden definiert.', 'wpsg'); ?>
+        </template>
+        <a href="#" @click.prevent="add()">
+            <span class="wpsg-glyphicon glyphicon glyphicon-plus"></span><?php echo __('Neuen Bestellzustand anlegen', 'wpsg'); ?>
+        </a>
+    </p> 
+    
+    <table class="w-full mt-2"> 
+        <tbody v-for="(row, i) of arStatesNotDeleted">
+            <tr>
+                <td class="p-1 w-full">
+                    <input class="w-full box-border" type="text" v-model="row.name" />
+                </td>
+                <td class="p-1 text-right">
+                    
+                    <a href="#" @click.prevent="deleteRow(row)" title="<?php echo __('Bestellzustand lÃ¶schen', 'wpsg'); ?>">
+                        <span class="glyphicon glyphicon-trash"></span>
+                    </a>
+                    
+                </td>
+            </tr>
+        </tbody>
+    </table> 
+    
+</div>
+
+<script>
+    
+    const Counter = {
+        data() {
+            return {
+                arStates: <?php echo json_encode($this->view['arStates']); ?>
+            }
+        },
+        computed: {
+			arStatesNotDeleted() {
+				
+				let r = [];
+				
+				for (let s of this.arStates) if (s.deleted !== '1') r.push(s);
+				
+				return r;
+				
+            }
+        },
+        methods: {
+			add() {
+				
+				this.arStates.push({
+                    id: 0,
+                    name: '',
+                    deleted: 0                    
+				});
+				
+            },
+            deleteRow(row) {
+				
+				row.deleted = '1'; 
+				
+            }
+        }
+    }
+
+    Vue.createApp(Counter).mount('#wpsg_mod_orderstates_app')
+    
+</script>
Index: /views/order/index.phtml
===================================================================
--- /views/order/index.phtml	(revision 7956)
+++ /views/order/index.phtml	(revision 7957)
@@ -14,5 +14,5 @@
 	    
     }
-	
+    
 ?>
  
